Skip to content

Commit 30a28df

Browse files
committed
fix: Freeze hero flow background
1 parent 8b9f0ad commit 30a28df

2 files changed

Lines changed: 4 additions & 35 deletions

File tree

‎src/index.css‎

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,9 +1714,9 @@
17141714
opacity: 1;
17151715
}
17161716

1717-
.hero-signal-active-0 { animation-delay: 0s; }
1718-
.hero-signal-active-1 { animation-delay: -2.5s; }
1719-
.hero-signal-active-2 { animation-delay: -5s; }
1717+
.hero-signal-graph .hero-signal-active-0 { stroke-dashoffset: 0; }
1718+
.hero-signal-graph .hero-signal-active-1 { stroke-dashoffset: -21.333; }
1719+
.hero-signal-graph .hero-signal-active-2 { stroke-dashoffset: -42.667; }
17201720

17211721
.quickstart-section {
17221722
padding-top: var(--spacing-09);
@@ -2234,16 +2234,6 @@
22342234
animation-delay: 4.14s;
22352235
}
22362236

2237-
.hero-workflow-signal-field .hero-signal-active {
2238-
animation: hero-signal-flow 6.4s linear infinite;
2239-
animation-play-state: paused;
2240-
}
2241-
2242-
.hero-workflow-signal-field.is-flowing .hero-signal-active {
2243-
animation-play-state: running;
2244-
will-change: stroke-dashoffset;
2245-
}
2246-
22472237
.demo-slide-in-next {
22482238
animation: demo-in-next 0.34s cubic-bezier(0.22, 1, 0.36, 1);
22492239
}
@@ -2265,10 +2255,6 @@
22652255
display: none;
22662256
}
22672257

2268-
.hero-signal-active {
2269-
animation: none;
2270-
}
2271-
22722258
.workflow-preview {
22732259
transition: none;
22742260
}
@@ -2286,12 +2272,6 @@
22862272
30.01%, 100% { opacity: 0; transform: translate3d(0, 0.14em, 0); }
22872273
}
22882274

2289-
@keyframes hero-signal-flow {
2290-
/* One exact dash-pattern period makes the restart visually identical to the
2291-
final frame, so the current never jumps as the animation cycles. */
2292-
to { stroke-dashoffset: -64; }
2293-
}
2294-
22952275
@keyframes enact-transform-flow {
22962276
0% { transform: translateX(0); opacity: 0; }
22972277
20% { opacity: 1; }

‎src/pages/index.astro‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const heroWorkflowActivePaths = Array.from({ length: 3 }, (_, phase) => heroWork
9090
<SiteHeader />
9191
<main id="main" class="landing-sections flex-1 pt-16">
9292
<div class="hero-workflow-group">
93-
<svg class="hero-workflow-signal-field is-flowing" viewBox="0 0 1200 1440" preserveAspectRatio="none" aria-hidden="true">
93+
<svg class="hero-workflow-signal-field" viewBox="0 0 1200 1440" preserveAspectRatio="none" aria-hidden="true">
9494
<g class="hero-signal-graph">
9595
<path class="hero-signal-base" d={heroWorkflowBasePath}></path>
9696
{heroWorkflowActivePaths.map((path, phase) => (
@@ -127,15 +127,4 @@ const heroWorkflowActivePaths = Array.from({ length: 3 }, (_, phase) => heroWork
127127
</div>
128128
</main>
129129
</div>
130-
<script>
131-
const signalField = document.querySelector<SVGElement>(".hero-workflow-signal-field");
132-
133-
if (signalField && "IntersectionObserver" in window) {
134-
const observer = new IntersectionObserver(([entry]) => {
135-
signalField.classList.toggle("is-flowing", entry.isIntersecting);
136-
}, { rootMargin: "160px 0px" });
137-
138-
observer.observe(signalField);
139-
}
140-
</script>
141130
</BaseLayout>

0 commit comments

Comments
 (0)