Skip to content

Commit 93fb144

Browse files
authored
Merge pull request #21 from hoangsonww/fix/fix-index
fix: speed up reveal animations and update demo video sources
2 parents e447ac6 + 1a23105 commit 93fb144

3 files changed

Lines changed: 27 additions & 15 deletions

File tree

index.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,17 +266,20 @@ <h3>Run these for yourself</h3>
266266

267267
<div class="code-win" style="margin: 0 0 32px; display: flex; flex-direction: column;">
268268
<div class="titlebar"><div class="traffic"><i></i><i></i><i></i></div><span class="ttl">REPL demo · forge</span></div>
269-
<video src="images/REPL.mp4" poster="images/repl.png" controls muted playsinline preload="metadata"
269+
<video src="https://github.com/user-attachments/assets/eb592bbf-62a1-4d74-a540-7e066ebe56a4
270+
" poster="images/repl.png" controls muted playsinline preload="metadata"
270271
style="display:block;width:100%;max-height:70vh;height:auto;object-fit:contain;background:#000"></video>
271272
</div>
272273
<div class="code-win" style="margin: 0 0 32px; display: flex; flex-direction: column;">
273274
<div class="titlebar"><div class="traffic"><i></i><i></i><i></i></div><span class="ttl">CLI demo · forge run</span></div>
274-
<video src="images/CLI.mp4" poster="images/cli.png" controls muted playsinline preload="metadata"
275+
<video src="https://github.com/user-attachments/assets/bc3b3204-fd87-436f-9467-604535edb4e2
276+
" poster="images/cli.png" controls muted playsinline preload="metadata"
275277
style="display:block;width:100%;max-height:70vh;height:auto;object-fit:contain;background:#000"></video>
276278
</div>
277279
<div class="code-win" style="margin: 0; display: flex; flex-direction: column;">
278280
<div class="titlebar"><div class="traffic"><i></i><i></i><i></i></div><span class="ttl">Web dashboard demo · forge ui start</span></div>
279-
<video src="images/UI.mp4" poster="images/ui.png" controls muted playsinline preload="metadata"
281+
<video src="https://github.com/user-attachments/assets/218cd64f-40fe-4836-9c62-c7a08538056b
282+
" poster="images/ui.png" controls muted playsinline preload="metadata"
280283
style="display:block;width:100%;height:auto;background:#000"></video>
281284
</div>
282285
</div>

wiki/app.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,26 +252,29 @@ revealTargets.forEach((el) => {
252252
el.setAttribute('data-reveal', '');
253253
});
254254

255-
/* Stagger grid children so they reveal in a cascade, not a slab. */
255+
/* Stagger grid children so they reveal in a cascade, not a slab.
256+
Delays deliberately shallow and capped at item #5 so large grids don't
257+
take a full second before the last card appears — the user was
258+
previously waiting ~880ms for an 8-card grid to finish. */
256259
document.querySelectorAll('.grid').forEach((grid) => {
257260
Array.from(grid.children).forEach((child, i) => {
258261
if (child.hasAttribute('data-reveal')) {
259-
child.style.setProperty('--reveal-delay', `${Math.min(i, 8) * 110}ms`);
262+
child.style.setProperty('--reveal-delay', `${Math.min(i, 5) * 40}ms`);
260263
}
261264
});
262265
});
263266
document.querySelectorAll('.bars').forEach((bars) => {
264267
Array.from(bars.children).forEach((row, i) => {
265268
if (row.hasAttribute('data-reveal')) {
266-
row.style.setProperty('--reveal-delay', `${Math.min(i, 8) * 90}ms`);
269+
row.style.setProperty('--reveal-delay', `${Math.min(i, 5) * 30}ms`);
267270
}
268271
});
269272
});
270273
/* Hero stats always cascade even though they're above the fold. */
271274
document.querySelectorAll('.hero-stats').forEach((row) => {
272275
Array.from(row.children).forEach((stat, i) => {
273276
if (stat.hasAttribute('data-reveal')) {
274-
stat.style.setProperty('--reveal-delay', `${i * 120}ms`);
277+
stat.style.setProperty('--reveal-delay', `${i * 50}ms`);
275278
}
276279
});
277280
});
@@ -285,7 +288,11 @@ if ('IntersectionObserver' in window && revealTargets.length) {
285288
revealIO.unobserve(entry.target);
286289
}
287290
},
288-
{ threshold: 0.12, rootMargin: '0px 0px -8% 0px' },
291+
// Trigger earlier: fire as soon as any pixel enters the viewport,
292+
// and pre-reveal a band above the fold (240px) so elements finish
293+
// animating right as the user scrolls them into view instead of
294+
// starting the animation only once they're already on screen.
295+
{ threshold: 0, rootMargin: '0px 0px 240px 0px' },
289296
);
290297
revealTargets.forEach((el) => revealIO.observe(el));
291298
} else {

wiki/styles.css

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,12 +1400,14 @@ footer a {
14001400

14011401
[data-reveal] {
14021402
opacity: 0;
1403-
transform: translate3d(0, 48px, 0) scale(.94);
1404-
filter: blur(8px);
1403+
transform: translate3d(0, 24px, 0) scale(.97);
1404+
filter: blur(4px);
1405+
/* Snappier reveal: durations roughly halved so elements don't feel like
1406+
they're floating in over a full second. Delay still honored via JS. */
14051407
transition:
1406-
opacity .9s var(--ease) var(--reveal-delay, 0ms),
1407-
transform 1s var(--ease-snap) var(--reveal-delay, 0ms),
1408-
filter .8s var(--ease) var(--reveal-delay, 0ms);
1408+
opacity .45s var(--ease) var(--reveal-delay, 0ms),
1409+
transform .5s var(--ease-snap) var(--reveal-delay, 0ms),
1410+
filter .35s var(--ease) var(--reveal-delay, 0ms);
14091411
will-change: opacity, transform, filter;
14101412
}
14111413

@@ -1418,11 +1420,11 @@ footer a {
14181420
/* Cards get a short extra slide from the side depending on column position —
14191421
gives a gentle cascade instead of a flat sweep. */
14201422
.grid > [data-reveal] {
1421-
transform: translate3d(-12px, 56px, 0) scale(.92);
1423+
transform: translate3d(-6px, 28px, 0) scale(.96);
14221424
}
14231425

14241426
.grid > [data-reveal]:nth-child(even) {
1425-
transform: translate3d(12px, 56px, 0) scale(.92);
1427+
transform: translate3d(6px, 28px, 0) scale(.96);
14261428
}
14271429

14281430
.grid > [data-reveal].is-visible {

0 commit comments

Comments
 (0)