-
Notifications
You must be signed in to change notification settings - Fork 7
/
_scroll-reveal.less
39 lines (34 loc) · 1.26 KB
/
_scroll-reveal.less
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
& when (@media-common = true) {
& when (@critical = unsure), (@critical) {
:root {
--animation-slide-in: slideIn 600ms cubic-bezier(0, 0, .3, 1) forwards;
}
@media (prefers-reduced-motion: no-preference) {
.js #html-body.scroll-reveal-enabled .scroll-reveal {
opacity: 0;
&.reveal-slide-in {
transform: translateY(2rem);
}
&.reveal-ready {
animation: var(--animation, var(--animation-slide-in));
animation-delay: ~"calc(var(--animation-order) * 75ms)";
}
}
// hide animated elements until slider is rebuilt to fix flickering
.js #html-body.scroll-reveal-enabled .scroll-reveal-container [data-content-type="slide"]:not(.slick-list > [data-content-type="slide"]) [data-element="content"] > button,
.js #html-body.scroll-reveal-enabled .scroll-reveal-container [data-content-type="slide"]:not(.slick-list > [data-content-type="slide"]) [data-element="content"] > div > * {
opacity: 0;
}
}
@keyframes slideIn {
from {
transform: translateY(2rem);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
}
}