-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
732 lines (637 loc) · 22.1 KB
/
Copy pathdemo.html
File metadata and controls
732 lines (637 loc) · 22.1 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Dolly — demo stage</title>
<!--
A stage for recording Dolly's own product demo. Every panel is 16/9, so a
focus region drawn on one fills the frame exactly, and the whole layout
fits a single viewport — focus regions clamp to what is on screen.
#sec-focus camera (CSS animation, runs on its own)
#sec-crisp crispness (CSS animation, runs on its own)
#sec-export 4K 60fps (CSS animation, runs on its own)
#brand the Dolly mark — the closing shot
Script keyframes:
// typing
Dolly.type('#search', 'wireless headphones', 1400)
Dolly.type('#search', 'noise cancelling', 1200, { clear: true })
// Keyframe A — before the camera reaches the card: clear the row.
// rubberBand and tada only animate transform, so fill-mode cannot
// hide them the way it hides the …In effects. They have to be hidden
// by hand, or they sit there visible while the others play.
[
'#fx-bounceIn', '#fx-flipInX', '#fx-zoomIn',
'#fx-fadeInUp', '#fx-rubberBand', '#fx-tada',
].forEach((sel) => {
const el = document.querySelector(sel);
el.style.transition = 'opacity 200ms ease';
el.style.opacity = '0';
});
// Keyframe B — camera on the card: each chip appears as its effect
// plays. setTimeout is the page's, so the export steps it on video
// time rather than wall time.
[
['#fx-bounceIn', 'bounceIn', 700],
['#fx-flipInX', 'flipInX', 700],
['#fx-zoomIn', 'zoomIn', 700],
['#fx-fadeInUp', 'fadeInUp', 700],
['#fx-rubberBand', 'rubberBand', 900],
['#fx-tada', 'tada', 900],
].forEach(([sel, effect, ms], i) => {
setTimeout(() => {
const el = document.querySelector(sel);
el.style.opacity = '1';
Dolly.animate(el, effect, ms);
}, i * 300);
});
// the dialog
document.getElementById('dialog').classList.add('is-open')
document.getElementById('dialog').classList.remove('is-open')
That panel is deliberately not a <dialog>: a modal dialog is centred in
the layout viewport, so with the camera zoomed into a card it would open
off frame. This one opens inside the card.
-->
<style>
:root {
--bg: #16161a;
--bg-deep: #0a0a0d;
--divider: #2a2a30;
--text: #e5e5e5;
--muted: #a1a1aa;
--dim: #71717a;
--accent: #7d6aff;
--cursor: #22b8cf;
--js: #f0a13a;
--green: #4ade80;
--sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
'Helvetica Neue', sans-serif;
--mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
background:
radial-gradient(1100px 620px at 50% -10%,
rgba(125, 106, 255, 0.13),
transparent 60%),
var(--bg);
color: var(--text);
font-family: var(--sans);
-webkit-font-smoothing: antialiased;
}
.stage {
min-height: 100vh;
padding: 20px;
display: grid;
grid-template-columns: repeat(3, 1fr);
align-content: center;
justify-items: stretch;
gap: 16px;
}
/* ── panels ────────────────────────────────────────────────────────── */
/* 16/9, so a region drawn on one matches the exported frame exactly. */
.card {
position: relative;
overflow: hidden;
aspect-ratio: 16 / 9;
padding: 15px 17px;
display: flex;
flex-direction: column;
border: 1px solid var(--divider);
border-radius: 14px;
background: transparent;
}
h2 {
margin: 0;
font-size: 18px;
font-weight: 650;
letter-spacing: -0.012em;
}
.sub {
margin: 3px 0 0;
font-size: 12px;
color: var(--muted);
}
/*
* Fills whatever space the copy leaves and scales its own contents to
* fit, so no illustration can be clipped by a narrower window.
*/
.art {
flex: 1;
min-height: 0;
width: 100%;
margin-top: 8px;
display: block;
}
/* ── focus regions ─────────────────────────────────────────────────── */
.vf-frame {
fill: none;
stroke-width: 1;
}
.vf-bracket {
fill: none;
stroke: var(--dim);
stroke-width: 1.6;
stroke-linecap: round;
}
.vf-target {
fill: rgba(125, 106, 255, 0.14);
stroke: var(--accent);
stroke-width: 1.6;
}
.vf-tick {
stroke: var(--accent);
stroke-width: 1.4;
stroke-linecap: round;
}
/* The reticle closing in and opening out: the camera move, in miniature. */
.vf-zoom {
transform-box: fill-box;
transform-origin: center;
animation: reticle 3.4s cubic-bezier(0.45, 0, 0.35, 1) infinite;
}
@keyframes reticle {
0%,
12% {
transform: scale(1) translate(0, 0);
}
44%,
60% {
transform: scale(0.46) translate(-30px, -8px);
}
92%,
100% {
transform: scale(1) translate(0, 0);
}
}
/* ── crispness: curves, gradients and hairline seams to judge ──────── */
.ball-seam {
fill: none;
stroke: rgba(255, 255, 255, 0.85);
stroke-width: 1.1;
}
.ball-rim {
fill: none;
stroke: rgba(255, 255, 255, 0.5);
stroke-width: 1.1;
}
.ball {
transform-box: fill-box;
transform-origin: center;
animation: bob 4.2s ease-in-out infinite;
}
@keyframes bob {
0%,
100% {
transform: translateY(0) rotate(-10deg);
}
50% {
transform: translateY(-6px) rotate(-4deg);
}
}
/* Tightens as the ball lifts, so it reads as resting on the ground. */
.ball-shadow {
transform-box: fill-box;
transform-origin: center;
animation: shadow-bob 4.2s ease-in-out infinite;
}
@keyframes shadow-bob {
0%,
100% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(0.85);
opacity: 0.6;
}
}
/* ── 4K 60fps ──────────────────────────────────────────────────────── */
.rail {
stroke: var(--divider);
stroke-width: 2;
stroke-linecap: round;
}
.sleeper {
stroke: rgba(42, 42, 48, 0.9);
stroke-width: 3;
stroke-linecap: round;
}
.cart-body {
fill: #26262c;
stroke: var(--dim);
stroke-width: 1.2;
}
.cart-cam {
fill: rgba(125, 106, 255, 0.18);
stroke: var(--accent);
stroke-width: 1.4;
}
.cart-lens {
fill: var(--bg-deep);
stroke: var(--accent);
stroke-width: 1.4;
}
.wheel {
fill: var(--bg-deep);
stroke: var(--accent);
stroke-width: 1.6;
}
.spoke {
stroke: var(--accent);
stroke-width: 1;
stroke-linecap: round;
}
/* transform, so it rides the compositor — the smoothness under test. */
.cart {
transform-box: fill-box;
animation: roll 5.4s cubic-bezier(0.4, 0, 0.4, 1) infinite alternate;
}
@keyframes roll {
from {
transform: translateX(0);
}
to {
transform: translateX(178px);
}
}
.wheel-group {
transform-box: fill-box;
transform-origin: center;
animation: spin 1.9s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
/* ── typewriter ────────────────────────────────────────────────────── */
/* No copy on this card: the field says what it is once text lands in it. */
.card--type {
justify-content: center;
}
.search {
display: flex;
align-items: center;
gap: 11px;
padding: 13px 18px;
border: 1px solid var(--divider);
border-radius: 999px;
background: var(--bg-deep);
transition: border-color 160ms ease, box-shadow 160ms ease;
}
.search:focus-within {
border-color: rgba(125, 106, 255, 0.6);
box-shadow: 0 0 0 3px rgba(125, 106, 255, 0.14);
}
.search svg {
flex: none;
color: var(--dim);
}
.search input {
flex: 1;
min-width: 0;
border: 0;
outline: 0;
background: none;
color: var(--text);
font-family: var(--sans);
font-size: 15px;
/* Visible on camera, and the only cue the field is a field while empty. */
caret-color: var(--accent);
}
/* ── animation effects ─────────────────────────────────────────────── */
.chips {
margin-top: auto;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
}
.chip {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 5px;
padding: 10px 4px;
border: 1px solid var(--divider);
border-radius: 10px;
font-family: var(--mono);
font-size: 9.5px;
color: var(--muted);
text-align: center;
}
.chip svg {
color: var(--accent);
}
.chip:nth-child(3n + 2) svg {
color: var(--cursor);
}
.chip:nth-child(3n) svg {
color: var(--js);
}
/* ── javascript keyframes ──────────────────────────────────────────── */
.code {
margin-top: auto;
padding: 11px 13px;
border: 1px solid var(--divider);
border-radius: 10px;
background: var(--bg-deep);
font-family: var(--mono);
font-size: 11px;
line-height: 1.65;
color: var(--muted);
overflow: hidden;
}
.code .k {
color: var(--js);
}
.code .s {
color: var(--green);
}
.code .c {
color: var(--dim);
}
.dialog {
position: absolute;
inset: 0;
z-index: 5;
display: grid;
place-items: center;
padding: 18px;
background: rgba(10, 10, 13, 0.76);
backdrop-filter: blur(2px);
opacity: 0;
pointer-events: none;
transition: opacity 200ms ease;
}
.dialog.is-open {
opacity: 1;
pointer-events: auto;
}
.dialog__panel {
display: flex;
align-items: center;
gap: 11px;
padding: 14px 18px;
border: 1px solid rgba(125, 106, 255, 0.4);
border-radius: 12px;
background: #1b1b21;
box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
transform: translateY(6px) scale(0.97);
transition: transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.dialog.is-open .dialog__panel {
transform: translateY(0) scale(1);
}
.dialog__title {
font-size: 13px;
font-weight: 650;
white-space: nowrap;
}
/* ── the mark ──────────────────────────────────────────────────────── */
/*
* Its own full row, so nothing can auto-place beside it. Not a card: no
* border, no aspect-ratio of its own. Stacked and narrow instead, so its
* bounding box is already close to 16/9 — a region drawn round it crops
* nothing and wastes little.
*/
/*
* Small, with generous room above and below. A 16/9 region is as tall as
* 9/16 of its width, so the narrower this group is the shorter that region
* needs to be — and the padding keeps the neighbouring cards' borders well
* outside it.
*/
.brand {
grid-column: 1 / -1;
display: flex;
align-items: center;
justify-content: center;
gap: 14px;
padding: 52px 0;
}
.brand__logo {
display: block;
width: 42px;
height: 42px;
border-radius: 11px;
}
.brand__word {
font-size: 26px;
font-weight: 700;
letter-spacing: -0.035em;
line-height: 1;
background: linear-gradient(100deg,
#ffffff 0%,
#ffffff 38%,
var(--accent) 62%,
#ffffff 86%);
background-size: 260% 100%;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
animation: sheen 6s ease-in-out infinite;
}
@keyframes sheen {
0%,
100% {
background-position: 100% 0;
}
50% {
background-position: 0 0;
}
}
.brand__tag {
margin: 4px 0 0;
font-size: 10px;
color: var(--muted);
}
</style>
</head>
<body>
<main class="stage">
<!-- ── camera ──────────────────────────────────────────────────────── -->
<section class="card" id="sec-focus">
<h2>Focus on specific regions</h2>
<p class="sub">with smooth transitions</p>
<svg class="art" viewBox="0 0 220 104" aria-hidden="true">
<rect class="vf-frame" x="4" y="4" width="212" height="96" rx="7" />
<path class="vf-bracket" d="M16 32V18h13M204 32V18h-13M16 72v14h13M204 72v14h-13" />
<g class="vf-zoom">
<rect class="vf-target" x="74" y="32" width="72" height="40" rx="5" />
<path class="vf-tick" d="M110 36v-7M110 68v7M78 52h-7M142 52h7" />
</g>
</svg>
</section>
<!-- ── crispness ───────────────────────────────────────────────────── -->
<section class="card" id="sec-crisp">
<h2>Get crisp outputs</h2>
<p class="sub">even at 100× zoom</p>
<svg class="art" viewBox="0 0 220 104" aria-hidden="true">
<defs>
<radialGradient id="gloss" cx="34%" cy="26%" r="62%">
<stop offset="0%" stop-color="#fff" stop-opacity="0.65" />
<stop offset="42%" stop-color="#fff" stop-opacity="0.08" />
<stop offset="100%" stop-color="#fff" stop-opacity="0" />
</radialGradient>
<radialGradient id="shade" cx="42%" cy="36%" r="72%">
<stop offset="55%" stop-color="#000" stop-opacity="0" />
<stop offset="100%" stop-color="#000" stop-opacity="0.45" />
</radialGradient>
<radialGradient id="floor" cx="50%" cy="50%" r="50%">
<stop offset="0%" stop-color="#000" stop-opacity="0.55" />
<stop offset="100%" stop-color="#000" stop-opacity="0" />
</radialGradient>
</defs>
<!-- Ball spans y 16..88; the shadow sits right under it. -->
<ellipse class="ball-shadow" cx="110" cy="92" rx="40" ry="6" fill="url(#floor)" />
<!--
The placing translate and the animation must live on separate
groups: a CSS transform replaces an SVG transform attribute
outright, so animating this group directly would drop it back to
the origin.
-->
<g transform="translate(110 52)">
<g class="ball">
<!-- Four lunes, meridian to meridian: real curves to raster. -->
<path d="M0 -36A36 36 0 0 1 0 36A12 36 0 0 0 0 -36Z" fill="#ff5f6d" />
<path d="M0 -36A12 36 0 0 1 0 36L0 -36Z" fill="#ffd166" />
<path d="M0 -36L0 36A12 36 0 0 1 0 -36Z" fill="#4ade80" />
<path d="M0 -36A12 36 0 0 0 0 36A36 36 0 0 1 0 -36Z" fill="#38bdf8" />
<!-- Hairline seams, then gloss and shading over the top. -->
<path class="ball-seam" d="M0 -36A12 36 0 0 1 0 36" />
<path class="ball-seam" d="M0 -36A12 36 0 0 0 0 36" />
<path class="ball-seam" d="M0 -36L0 36" />
<circle r="36" fill="url(#shade)" />
<circle r="36" fill="url(#gloss)" />
<circle class="ball-rim" r="36" />
<ellipse cx="-12" cy="-18" rx="7" ry="4.6" fill="#fff" opacity="0.5" transform="rotate(-24 -12 -18)" />
</g>
</g>
</svg>
</section>
<!-- ── 4K 60fps ────────────────────────────────────────────────────── -->
<section class="card" id="sec-export">
<h2>Export at 4K 60fps</h2>
<p class="sub">regardless of your native resolution</p>
<svg class="art" viewBox="0 0 300 90" aria-hidden="true">
<g class="sleeper">
<line x1="14" y1="74" x2="14" y2="82" />
<line x1="55" y1="74" x2="55" y2="82" />
<line x1="96" y1="74" x2="96" y2="82" />
<line x1="137" y1="74" x2="137" y2="82" />
<line x1="178" y1="74" x2="178" y2="82" />
<line x1="219" y1="74" x2="219" y2="82" />
<line x1="260" y1="74" x2="260" y2="82" />
</g>
<path class="rail" d="M6 74h288" />
<g class="cart">
<rect class="cart-body" x="30" y="48" width="56" height="17" rx="4" />
<rect class="cart-cam" x="43" y="28" width="32" height="20" rx="4" />
<circle class="cart-lens" cx="75" cy="38" r="5.5" />
<g class="wheel-group">
<circle class="wheel" cx="42" cy="68" r="6.5" />
<path class="spoke" d="M42 62v12M36 68h12" />
</g>
<g class="wheel-group">
<circle class="wheel" cx="74" cy="68" r="6.5" />
<path class="spoke" d="M74 62v12M68 68h12" />
</g>
</g>
</svg>
</section>
<!-- ── the mark ────────────────────────────────────────────────────── -->
<div class="brand" id="brand">
<img class="brand__logo" src="logo.svg" alt="" />
<div>
<div class="brand__word">Dolly</div>
<p class="brand__tag">Cinematic product demos in the browser.</p>
</div>
</div>
<!-- ── typewriter ──────────────────────────────────────────────────── -->
<section class="card card--type" id="sec-type">
<div class="search">
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round">
<circle cx="11" cy="11" r="7" />
<path d="m20 20-3.5-3.5" />
</svg>
<input id="search" type="text" />
</div>
</section>
<!-- ── animation effects ───────────────────────────────────────────── -->
<section class="card" id="sec-anim">
<h2>And animation effects</h2>
<p class="sub">on cue, anywhere on the page</p>
<div class="chips">
<div class="chip" id="fx-bounceIn">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round">
<path d="M12 3v6M12 21a6 6 0 1 0 0-12" />
</svg>
bounceIn
</div>
<div class="chip" id="fx-flipInX">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round">
<path d="M3 12h18M7 7l-4 5 4 5M17 7l4 5-4 5" />
</svg>
flipInX
</div>
<div class="chip" id="fx-zoomIn">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round">
<circle cx="11" cy="11" r="7" />
<path d="M11 8v6M8 11h6" />
</svg>
zoomIn
</div>
<div class="chip" id="fx-fadeInUp">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round">
<path d="M12 20V6M6 12l6-6 6 6" />
</svg>
fadeInUp
</div>
<div class="chip" id="fx-rubberBand">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round">
<path d="M4 12c4-7 12-7 16 0M4 12c4 7 12 7 16 0" />
</svg>
rubberBand
</div>
<div class="chip" id="fx-tada">
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round">
<path d="M12 3v3M12 18v3M3 12h3M18 12h3M6 6l2 2M16 16l2 2M6 18l2-2M16 8l2-2" />
</svg>
tada
</div>
</div>
</section>
<!-- ── javascript keyframes ────────────────────────────────────────── -->
<section class="card" id="sec-js">
<h2>And JavaScript keyframes</h2>
<p class="sub">run code mid-shot</p>
<div class="code">
<span class="c">// at 4.0s</span><br />
<span class="k">document</span>.getElementById(<span class="s">'dialog'</span>)<br />
.classList.add(<span class="s">'is-open'</span>)
</div>
<div class="dialog" id="dialog">
<div class="dialog__panel">
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#7d6aff" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round">
<path d="m9 8-4 4 4 4M15 8l4 4-4 4" />
</svg>
<div class="dialog__title">Triggered by a JS keyframe</div>
</div>
</div>
</section>
</main>
</body>
</html>