fix: animations timing

This commit is contained in:
Torsten Dittmann
2023-09-25 22:22:16 +02:00
parent 28b5045ded
commit 9c3ac6b3da
3 changed files with 12 additions and 15 deletions

View File

@@ -131,7 +131,7 @@
remaning: Infinity
};
const animScale: Scale = [0.1, 1];
const animScale: Scale = [0.075, 1];
const productsScales = products.map((_, idx) => {
const diff = animScale[1] - animScale[0];
const step = diff / products.length;
@@ -192,7 +192,10 @@
}}
>
<div class="sticky-wrapper">
{#if scrollInfo.percentage < 0.1}
<!-- <div class="debug">
<pre>{scrollInfo.percentage}</pre>
</div> -->
{#if scrollInfo.percentage < 0.075}
<div
class="main-text"
out:fly={{ duration: 250, y: -300 }}
@@ -221,7 +224,7 @@
class="products"
out:fly={{ duration: 250, y: 300 }}
in:fly={{ duration: 500, delay: 250, y: 300 }}
data-active={scrollInfo.percentage > 0.1 ? '' : undefined}
data-active={scrollInfo.percentage > 0.075 ? '' : undefined}
>
<div class="text" id="pd-{$elId}">
<ScrollIndicator percentage={toScale(scrollInfo.percentage, animScale, [0, 1])} />
@@ -346,12 +349,6 @@
}
}
// .debug {
// position: absolute;
// top: 8rem;
// left: 0;
// }
.sticky-wrapper {
display: flex;
flex-direction: column;