Update 404

This commit is contained in:
Eduar Ursu 2021-08-24 12:42:30 +02:00
parent 6e51b389a2
commit d9b161e6c7

View file

@ -173,6 +173,68 @@ background-image: linear-gradient(315deg, #f7b42c 0%, #fc575e 74%);
</div>
</main>
</body>
<script src="./src/js/script.js"></script>
<script>
function aos() {
const t = this;
t.items = document.querySelectorAll("[class*=_aos]");
if (IntersectionObserver && t.items) {
let callback = function (entries) {
entries.forEach(entry => {
if (entry.isIntersecting && !entry.target.classList.contains('_aos-done')) {
entry.target.classList.add('_aos-done');
} else {
entry.target.classList.remove('_aos-done');
}
});
}
let observer = new IntersectionObserver(callback, {
root: null,
threshold: 0
});
t.items.forEach((item) => {
observer.observe(item);
});
}
}
function gotop() {
var t = this;
t.gt = document.getElementById('gt-link');
t.scrollToTop = function () {
window.scroll({
top: 0,
left: 0,
behavior: 'smooth'
});
}
t.listeners = function () {
window.addEventListener("scroll", () => {
let y = window.scrollY;
if (y > 0) {
t.gt.classList.remove("hidden");
} else {
t.gt.classList.add("hidden");
}
});
t.gt.onclick = function (e) {
e.preventDefault();
if (document.documentElement.scrollTop || document.body.scrollTop > 0) {
t.scrollToTop();
}
}
}
if (t.gt) {
t.listeners();
}
}
// Call the function when the DOM is loaded
document.addEventListener("DOMContentLoaded", () => {
new gotop();
new aos();
});
</script>
</html>