Added animations, improved footer

This commit is contained in:
2024-06-23 11:32:30 +02:00
parent 6ab4e3f2df
commit 0da0957373
21 changed files with 137 additions and 49 deletions

50
V1/resources/js/index.js Normal file
View File

@@ -0,0 +1,50 @@
document.addEventListener('DOMContentLoaded', () => {
const carrousel = document.getElementById('carrousel');
if (carrousel) {
new Flickity(carrousel, {
autoPlay: true,
groupCells: '75%',
});
}
const punch = document.getElementById('punch');
const navbar = document.getElementById('navbar');
const homeTitle = document.getElementById('home-title');
if (navbar || punch || homeTitle) {
let lastScrollY = window.scrollY;
window.addEventListener('scroll', () => {
let currentScrollY = window.scrollY;
if (navbar) {
if (lastScrollY > currentScrollY) {
navbar.style.top = '0';
} else {
navbar.style.top = '-140px';
}
lastScrollY = currentScrollY;
}
if (punch) {
const punchPosition = punch.getBoundingClientRect();
if (currentScrollY > punchPosition.bottom + (window.innerHeight / 2)) {
punch.style.color = '#F8FAFC';
punch.style.backgroundColor = '#222';
} else {
punch.style.color = '#222';
punch.style.backgroundColor = '#F8FAFC';
}
}
if (homeTitle) {
if (currentScrollY > 1000) {
homeTitle.style.display = 'none';
} else {
homeTitle.style.display = 'flex';
}
}
});
}
});