Skip to content

Commit bc0e207

Browse files
committed
implement mobile scroll-triggered animations for footer links; adjust background styles in crumple.css and footer-delay.js
1 parent a3cb6ea commit bc0e207

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

css/crumple.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,3 +639,17 @@ body:has(.footer__link--home:hover) .crumple:after {
639639
animation: d 1s .25s linear forwards;
640640
}
641641
}
642+
643+
/* Mobile Scroll Test - Trigger animations on scroll */
644+
@media (hover: none) and (pointer: coarse) {
645+
/* Test if animations work by triggering on scroll */
646+
body:has(.footer__link--writings) .crumple {
647+
background: #020121;
648+
z-index: 0;
649+
}
650+
651+
body:has(.footer__link--writings) .crumple:after {
652+
-webkit-animation: e 1s .25s linear forwards;
653+
animation: e 1s .25s linear forwards;
654+
}
655+
}

js/footer-delay.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,23 @@ function initFooterDelay() {
199199
if (animationName) {
200200
// Create a temporary style to trigger the animation
201201
const style = document.createElement('style');
202+
let backgroundStyle = '';
203+
204+
// Set background color based on link type
205+
if (linkClass.includes('footer__link--writings')) {
206+
backgroundStyle = 'background: #020121; z-index: 0;';
207+
} else if (linkClass.includes('footer__link--alhambra')) {
208+
backgroundStyle = 'background: #020121; z-index: 0;';
209+
}
210+
202211
style.textContent = `
212+
.crumple {
213+
${backgroundStyle}
214+
}
203215
.crumple:after {
204216
-webkit-animation: ${animationName} 1s .25s linear forwards;
205217
animation: ${animationName} 1s .25s linear forwards;
218+
background-color: #222;
206219
}
207220
`;
208221
document.head.appendChild(style);

0 commit comments

Comments
 (0)