| 1 | <!DOCTYPE html> |
| 2 | <html lang="en" data-theme="system" data-motion="full"> |
| 3 | <head> |
| 4 | <meta charset="utf-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | <title>Thinking line: three variants</title> |
| 7 | <style> |
| 8 | /* Theme tokens, copied from internal/equipo/static/theme.css and |
| 9 | tokens.css (day theme). Everything below this block uses only these. */ |
| 10 | :root { |
| 11 | color-scheme: light dark; |
| 12 | --rst-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; |
| 13 | --rst-radius: 6px; |
| 14 | --rst-radius-sm: 4px; |
| 15 | --rst-radius-pill: 999px; |
| 16 | --rst-bg: light-dark(#fbfbfc, #0c0d0f); |
| 17 | --rst-surface: light-dark(#ffffff, #141518); |
| 18 | --rst-surface-2: light-dark(#f3f3f5, #18191d); |
| 19 | --rst-line: light-dark(#e6e6ea, #26282e); |
| 20 | --rst-line-strong: light-dark(#868691, #71737c); |
| 21 | --rst-text: light-dark(#18181b, #ededf0); |
| 22 | --rst-text-muted: light-dark(#52525c, #a1a1aa); |
| 23 | --rst-text-faint: light-dark(#6b6b75, #8c8c96); |
| 24 | --rst-accent: light-dark(#1f56d6, #7aa2ff); |
| 25 | --rst-accent-strong: light-dark(color-mix(in srgb, var(--rst-accent) 80%, #000000), color-mix(in srgb, var(--rst-accent) 68.5%, #ffffff)); |
| 26 | --rst-accent-soft: light-dark(#ecf1ff, #16234a); |
| 27 | --rst-on-accent-fill: #ffffff; |
| 28 | --rst-shadow-pop: 0 2px 4px light-dark(rgba(16, 24, 40, 0.06), rgba(0, 0, 0, 0.35)), 0 8px 16px -4px light-dark(rgba(16, 24, 40, 0.1), rgba(0, 0, 0, 0.5)); |
| 29 | --rst-shadow-lift: 0 1px 2px light-dark(rgba(16, 24, 40, 0.08), rgba(0, 0, 0, 0.3)); |
| 30 | --rst-control-face: light-dark(#ffffff, #141518); |
| 31 | --rst-control-border: light-dark(#d0d4dc, #343843); |
| 32 | --rst-focus-edge: var(--rst-accent); |
| 33 | --rst-title-size: 1.25rem; |
| 34 | --rst-title-weight: 600; |
| 35 | --rst-title-track: -0.012em; |
| 36 | --rst-fs-lg: 1.0625rem; |
| 37 | --rst-fs-base: 0.875rem; |
| 38 | --rst-fs-sm: 0.78125rem; |
| 39 | --rst-fs-xs: 0.71875rem; |
| 40 | --rst-sp-1: 0.25rem; |
| 41 | --rst-sp-2: 0.5rem; |
| 42 | --rst-sp-3: 0.75rem; |
| 43 | --rst-sp-4: 1rem; |
| 44 | --rst-sp-5: 1.5rem; |
| 45 | --rst-sp-6: 2.5rem; |
| 46 | } |
| 47 | :root[data-theme="light"] { color-scheme: light; } |
| 48 | :root[data-theme="dark"] { color-scheme: dark; } |
| 49 | |
| 50 | /* Motion curve shared by every variant: quick start, long soft landing. */ |
| 51 | :root { --ease: cubic-bezier(.22, .8, .24, 1); --warm: color-mix(in srgb, var(--rst-tone-warning-fg) 85%, var(--rst-tone-warning-bg)); } |
| 52 | |
| 53 | /* ── The page ─────────────────────────────────────────────────────── */ |
| 54 | *, *::before, *::after { box-sizing: border-box; } |
| 55 | body { margin: 0; background: var(--rst-bg); color: var(--rst-text); font: var(--rst-fs-base)/1.5 var(--rst-font); -webkit-font-smoothing: antialiased; } |
| 56 | .page { padding: var(--rst-sp-6) clamp(var(--rst-sp-3), 3vw, var(--rst-sp-6)); } |
| 57 | .intro { max-width: 46rem; margin-block-end: var(--rst-sp-5); } |
| 58 | .intro h1 { font-size: var(--rst-title-size); font-weight: var(--rst-title-weight); letter-spacing: var(--rst-title-track); margin: 0 0 var(--rst-sp-2); } |
| 59 | .intro p { margin: 0; color: var(--rst-text-muted); } |
| 60 | .controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rst-sp-3) var(--rst-sp-5); margin-block-end: var(--rst-sp-6); } |
| 61 | .control { display: flex; align-items: center; gap: var(--rst-sp-2); font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| 62 | .seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--rst-control-border); border-radius: var(--rst-radius); background: var(--rst-control-face); } |
| 63 | .seg button, .replay { font: inherit; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); background: transparent; border: 0; border-radius: var(--rst-radius-sm); padding: .3rem .7rem; cursor: pointer; white-space: nowrap; } |
| 64 | .seg button[aria-pressed="true"] { background: var(--rst-accent-soft); color: var(--rst-accent); } |
| 65 | .replay { border: 1px solid var(--rst-control-border); background: var(--rst-control-face); color: var(--rst-text); border-radius: var(--rst-radius); padding: .35rem .85rem; } |
| 66 | :focus-visible { outline: 2px solid var(--rst-focus-edge); outline-offset: 2px; } |
| 67 | |
| 68 | .band + .band { margin-block-start: var(--rst-sp-6); } |
| 69 | .band > h2 { font-size: var(--rst-fs-base); font-weight: 600; margin: 0 0 var(--rst-sp-3); } |
| 70 | .grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); } |
| 71 | .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24.5rem), 1fr)); gap: var(--rst-sp-5); align-items: start; } |
| 72 | .variant h3 { font-size: var(--rst-fs-base); font-weight: 600; margin: 0 0 var(--rst-sp-1); } |
| 73 | .variant > p { margin: 0 0 var(--rst-sp-3); color: var(--rst-text-muted); font-size: var(--rst-fs-sm); max-width: 34rem; min-block-size: 6em; } |
| 74 | .caption { text-align: center; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); margin: var(--rst-sp-2) 0 0; } |
| 75 | |
| 76 | /* Frames: a desktop conversation and a 390px phone. */ |
| 77 | .frame { display: flex; flex-direction: column; block-size: 27rem; overflow: hidden; background: var(--rst-bg); border: 1px solid var(--rst-line); border-radius: calc(2 * var(--rst-radius)); box-shadow: var(--rst-shadow-lift); } |
| 78 | .frame > header { display: flex; align-items: center; gap: var(--rst-sp-2); flex: none; padding: var(--rst-sp-3) var(--rst-sp-5); border-block-end: 1px solid var(--rst-line); background: var(--rst-surface); font-weight: 600; } |
| 79 | .frame > header svg { inline-size: 1rem; block-size: 1rem; color: var(--rst-text-muted); } |
| 80 | .scroll { flex: 1; min-block-size: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: var(--rst-sp-4) var(--rst-sp-5); } |
| 81 | .composer { flex: none; margin: 0 var(--rst-sp-5) var(--rst-sp-4); padding: var(--rst-sp-3) var(--rst-sp-4); border: 1px solid var(--rst-control-border); border-radius: calc(2 * var(--rst-radius)); background: var(--rst-surface); color: var(--rst-text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } |
| 82 | .phone { inline-size: min(390px, 100%); block-size: 38rem; margin-inline: auto; border-radius: 2.25rem; box-shadow: var(--rst-shadow-pop); |
| 83 | /* The touch step from tokens.css, and the phone feed's smaller text (equipo.css). */ |
| 84 | --rst-fs-lg: 1.1875rem; --rst-fs-base: 1rem; --rst-fs-sm: 0.875rem; --rst-fs-xs: 0.8125rem; font-size: var(--rst-fs-base); } |
| 85 | .phone > .status { flex: none; display: flex; justify-content: space-between; padding: var(--rst-sp-3) var(--rst-sp-5) 0 1.75rem; background: var(--rst-surface); font-size: var(--rst-fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; } |
| 86 | .phone > header { padding: var(--rst-sp-2) var(--rst-sp-3); min-block-size: 2.75rem; } |
| 87 | .phone > header .back { display: inline-flex; align-items: center; gap: 2px; color: var(--rst-accent); font-weight: 400; margin-inline-end: auto; } |
| 88 | .phone > header .title { position: absolute; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: var(--rst-sp-2); } |
| 89 | .phone > header { position: relative; } |
| 90 | .phone .scroll { padding: var(--rst-sp-4) var(--rst-sp-3); } |
| 91 | .phone .feed { font-size: var(--rst-fs-sm); } |
| 92 | .phone .composer { margin: 0 var(--rst-sp-3) var(--rst-sp-5); border-radius: var(--rst-radius-pill); } |
| 93 | |
| 94 | /* The conversation, as equipo.css draws it. */ |
| 95 | .feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--rst-sp-4); transition: opacity .3s; } |
| 96 | .feed.fading { opacity: 0; } |
| 97 | .day { align-self: center; color: var(--rst-text-muted); font-size: var(--rst-fs-sm); } |
| 98 | .msg { max-inline-size: 88%; min-inline-size: 0; align-self: flex-start; } |
| 99 | .msg.own { align-self: flex-end; } |
| 100 | .msg.own .bubble { padding: var(--rst-sp-3) var(--rst-sp-4); border: 1px solid var(--rst-line); border-radius: calc(2 * var(--rst-radius)); background: var(--rst-accent-soft); } |
| 101 | .msg.new { animation: arrive .45s var(--ease) both; } |
| 102 | @keyframes arrive { from { opacity: 0; transform: translateY(.4rem); } } |
| 103 | .meta { display: flex; align-items: center; gap: var(--rst-sp-2); color: var(--rst-text-muted); font-size: var(--rst-fs-sm); margin-block-end: var(--rst-sp-2); } |
| 104 | .meta svg { inline-size: 1em; block-size: 1em; flex: none; } |
| 105 | .msg p { margin: 0; } |
| 106 | .msg p + p { margin-block-start: var(--rst-sp-3); } |
| 107 | .card { align-self: flex-start; max-inline-size: 88%; padding: var(--rst-sp-2) var(--rst-sp-3); border: 1px solid var(--rst-line); border-radius: calc(2 * var(--rst-radius)); background: color-mix(in oklab, var(--rst-surface), var(--rst-accent-soft) 45%); font-size: var(--rst-fs-sm); } |
| 108 | |
| 109 | /* ── The thinking line, common parts ──────────────────────────────── */ |
| 110 | .shell { inline-size: fit-content; max-inline-size: 100%; } |
| 111 | .shell.notrans, .shell.notrans * { transition: none !important; } |
| 112 | .tl { display: flex; align-items: center; font-size: var(--rst-fs-sm); line-height: 1.4; white-space: nowrap; min-inline-size: 0; } |
| 113 | .tl[hidden], .reply[hidden] { display: none; } |
| 114 | .win { --pad: 0em; position: relative; flex: 0 1 auto; min-inline-size: 0; block-size: calc(1.4em + 2 * var(--pad)); margin-block: calc(-1 * var(--pad)); font-weight: 500; color: var(--rst-text); transition: inline-size .6s var(--ease); } |
| 115 | .win.instant { transition: none; } |
| 116 | .ph { position: absolute; inset-inline-start: 0; inset-block-start: var(--pad); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } |
| 117 | .measure { position: absolute; inset-inline-start: 0; inset-block-start: 0; visibility: hidden; white-space: nowrap; pointer-events: none; } |
| 118 | /* "Thinking · 9s": a thin space each side of the middle dot. */ |
| 119 | .sep { flex: none; color: var(--rst-text-faint); } |
| 120 | .el { flex: none; display: inline-block; overflow: hidden; color: var(--rst-text-muted); font-variant-numeric: tabular-nums; transition: inline-size .35s var(--ease); } |
| 121 | .tl.leaving .sep, .tl.leaving .el { opacity: 0; transition: opacity .25s; } |
| 122 | .reply .w { display: inline-block; } |
| 123 | |
| 124 | /* Morph: the line's box dissolves into the plain reply. */ |
| 125 | .shell.morph { transition: inline-size .5s var(--ease), block-size .5s var(--ease), padding .5s var(--ease), background-color .45s, border-color .45s, box-shadow .45s; } |
| 126 | .shell.morph .reply { white-space: nowrap; } |
| 127 | .shell.plain { background-color: transparent !important; border-color: transparent !important; box-shadow: none !important; padding: 0 !important; } |
| 128 | |
| 129 | /* ── A. Breathing orb, rolling words ─────────────────────────────── */ |
| 130 | [data-v="a"] .shell { padding: var(--rst-sp-2) calc(var(--rst-sp-3) + 2px) var(--rst-sp-2) var(--rst-sp-3); border: 1px solid var(--rst-line); border-radius: var(--rst-radius-pill); background: var(--rst-surface); box-shadow: var(--rst-shadow-lift); } |
| 131 | [data-v="a"] .shell.enter { animation: a-pop .45s var(--ease) both; } |
| 132 | @keyframes a-pop { from { opacity: 0; transform: translateY(.25rem) scale(.97); } } |
| 133 | [data-v="a"] .mark { position: relative; flex: none; inline-size: .625rem; block-size: .625rem; margin-inline-end: .625rem; border-radius: 50%; |
| 134 | background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--rst-accent) 30%, var(--rst-on-accent-fill)) 0%, var(--rst-accent) 55%, var(--rst-accent-strong) 100%); |
| 135 | animation: a-breathe 3.2s ease-in-out infinite; transition: transform .3s var(--ease), opacity .3s; } |
| 136 | [data-v="a"] .mark::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 55%, color-mix(in srgb, var(--rst-on-accent-fill) 60%, transparent) 72%, transparent 90%); animation: spin 2.8s linear infinite; } |
| 137 | @keyframes a-breathe { |
| 138 | 0%, 100% { transform: scale(.8); box-shadow: 0 0 .2rem 0 color-mix(in srgb, var(--rst-accent) 25%, transparent); } |
| 139 | 50% { transform: scale(1); box-shadow: 0 0 .75rem .15rem color-mix(in srgb, var(--rst-accent) 45%, transparent); } |
| 140 | } |
| 141 | @keyframes spin { to { transform: rotate(1turn); } } |
| 142 | [data-v="a"] .win { --pad: .3em; overflow: clip; mask-image: linear-gradient(to bottom, transparent 0, #000 var(--pad), #000 calc(100% - var(--pad)), transparent 100%); } |
| 143 | [data-v="a"] .ph.in { animation: a-in .6s var(--ease) both; } |
| 144 | [data-v="a"] .ph.out { animation: a-out .5s var(--ease) both; } |
| 145 | @keyframes a-in { from { opacity: 0; transform: translateY(1em); filter: blur(1.5px); } } |
| 146 | @keyframes a-out { to { opacity: 0; transform: translateY(-1em); filter: blur(1.5px); } } |
| 147 | [data-v="a"] .tl.leaving .mark { animation: none; transform: scale(0); opacity: 0; } |
| 148 | [data-v="a"] .tl.leaving .ph { animation: a-out .35s var(--ease) both; } |
| 149 | [data-v="a"] .reply .w.in { animation: a-word .45s var(--ease) both; } |
| 150 | @keyframes a-word { from { opacity: 0; transform: translateY(.3em); } } |
| 151 | |
| 152 | /* ── B. Sparkle, letter cascade, light through the letters ────────── */ |
| 153 | [data-v="b"] .tl, :is([data-v^="s"], [data-v^="d"]) .tl { padding-block: var(--rst-sp-1); } |
| 154 | [data-v="b"] .spark, .caret > svg { inline-size: 1rem; block-size: 1rem; flex: none; overflow: visible; filter: drop-shadow(0 0 .3rem color-mix(in srgb, var(--rst-accent) 45%, transparent)); } |
| 155 | [data-v="b"] .spark { margin-inline-end: .5rem; } |
| 156 | [data-v="b"] .shell.enter .spark, :is([data-v^="s"], [data-v^="d"]) .shell.enter .spk { animation: b-arrive .6s var(--ease) both; } |
| 157 | @keyframes b-arrive { from { opacity: 0; transform: scale(.3) rotate(-90deg); } } |
| 158 | .s1 { fill: var(--rst-accent); transform-box: fill-box; transform-origin: center; animation: b-turn 5s ease-in-out infinite; } |
| 159 | .s2 { fill: color-mix(in srgb, var(--rst-accent) 55%, var(--rst-surface)); transform-box: fill-box; transform-origin: center; animation: b-twinkle 2.5s ease-in-out infinite; } |
| 160 | @keyframes b-turn { 0% { transform: rotate(0) scale(.84); } 50% { transform: rotate(45deg) scale(1); } 100% { transform: rotate(90deg) scale(.84); } } |
| 161 | @keyframes b-twinkle { 0%, 100% { opacity: .15; transform: scale(.4); } 50% { opacity: 1; transform: scale(1); } } |
| 162 | [data-v="b"] .win, :is([data-v^="s"], [data-v^="d"]) .win { overflow-x: clip; overflow-y: visible; } |
| 163 | [data-v="b"] .win.cut, :is([data-v^="s"], [data-v^="d"]) .win.cut { mask-image: linear-gradient(to right, #000 calc(100% - 2.5em), transparent); } |
| 164 | [data-v="b"] .ph, :is([data-v^="s"], [data-v^="d"]) .ph { overflow: visible; } |
| 165 | .ch { display: inline-block; white-space: pre; } |
| 166 | [data-v="b"] .ph.in .ch { animation: b-in .5s var(--ease) calc(120ms + var(--i) * 20ms) both, b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; } |
| 167 | [data-v="b"] .ph.in .ch.keep { animation: b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; } |
| 168 | [data-v="b"] .ph.out .ch { animation: b-out .26s ease-in calc(var(--i) * 7ms) both; } |
| 169 | [data-v="b"] .tl.leaving .ph .ch { animation: b-out .28s ease-in calc(var(--i) * 8ms) both; } |
| 170 | @keyframes b-in { from { opacity: 0; transform: translateY(.45em); filter: blur(3px); } } |
| 171 | @keyframes b-out { to { opacity: 0; transform: translateY(-.35em); filter: blur(2px); } } |
| 172 | @keyframes b-wave { 0%, 22%, 100% { color: var(--rst-text); } 8% { color: var(--rst-accent); } } |
| 173 | .caret { display: inline-block; margin-inline-start: .3em; vertical-align: -.12em; transform-origin: 0 0; } |
| 174 | .caret > svg { display: block; inline-size: .85em; block-size: .85em; } |
| 175 | [data-v="b"] .reply .w.in { animation: b-word .16s ease-out both; } |
| 176 | @keyframes b-word { from { opacity: 0; } } |
| 177 | |
| 178 | /* ── Chosen 1-3: B's line, crisp text, a livelier sparkle ─────────── */ |
| 179 | /* The sparkle: a cobalt star that turns and pulses, a white glint at its |
| 180 | heart, and three satellites that pop in and out on their own clocks. */ |
| 181 | .spk { --dist: 2em; position: relative; flex: none; display: inline-block; inline-size: 1.15em; block-size: 1.15em; margin-inline-end: .6em; } |
| 182 | .spk > svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; filter: drop-shadow(0 0 .22em color-mix(in srgb, var(--rst-accent) 55%, transparent)); } |
| 183 | .spk .st { fill: var(--rst-accent); transform-box: fill-box; transform-origin: center; animation: k-main 4.2s ease-in-out infinite; } |
| 184 | .spk .core { fill: var(--rst-on-accent-fill); transform-box: fill-box; transform-origin: center; animation: k-core 2.1s ease-in-out infinite; } |
| 185 | @keyframes k-main { 0% { transform: rotate(0) scale(.8); } 50% { transform: rotate(45deg) scale(1.05); } 100% { transform: rotate(90deg) scale(.8); } } |
| 186 | @keyframes k-core { 0%, 100% { transform: scale(.75); opacity: .65; } 50% { transform: scale(1.1); opacity: 1; } } |
| 187 | .sat, .gl { position: absolute; background: var(--rst-accent); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); } |
| 188 | .sat { inline-size: .44em; block-size: .44em; opacity: 0; transform: scale(0); animation: k-sat 3.1s ease-in-out infinite; } |
| 189 | .sat:nth-of-type(1) { inset-block-start: -.32em; inset-inline-end: -.38em; animation-duration: 2.7s; animation-delay: .4s; } |
| 190 | .sat:nth-of-type(2) { inset-block-end: -.22em; inset-inline-start: -.36em; inline-size: .34em; block-size: .34em; animation-duration: 3.7s; animation-delay: 1.5s; background: color-mix(in srgb, var(--rst-accent) 45%, var(--rst-on-accent-fill)); } |
| 191 | .sat:nth-of-type(3) { inset-block-start: -.45em; inset-inline-start: -.05em; inline-size: .3em; block-size: .3em; animation-duration: 4.3s; animation-delay: 2.6s; } |
| 192 | @keyframes k-sat { 0%, 24%, 100% { opacity: 0; transform: scale(0) rotate(0); } 10% { opacity: 1; transform: scale(1) rotate(45deg); } } |
| 193 | /* Flourish: the star pops; each take adds its own flourish. */ |
| 194 | .spk.fl > svg { animation: k-pop .6s var(--ease); } |
| 195 | @keyframes k-pop { 35% { transform: scale(1.3) rotate(20deg); } } |
| 196 | /* 1: a burst of glints. */ |
| 197 | .gl { inset-block-start: 50%; inset-inline-start: 50%; inline-size: .46em; block-size: .46em; margin: -.23em; opacity: 0; } |
| 198 | .gl:nth-of-type(even) { inline-size: .34em; block-size: .34em; margin: -.17em; background: color-mix(in srgb, var(--rst-accent) 40%, var(--rst-on-accent-fill)); } |
| 199 | .spk.fl .gl { animation: k-glint .75s var(--ease) both; } |
| 200 | @keyframes k-glint { 0% { opacity: 0; transform: rotate(var(--a)) translateY(-.3em) scale(.2); } 25% { opacity: 1; transform: rotate(var(--a)) translateY(-.75em) scale(1.15); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-1.6em) scale(.2); } } |
| 201 | /* 2: a glint arcs over the phrase and the letters light as it passes. */ |
| 202 | .arc { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; inline-size: .7em; block-size: .7em; margin: -.35em; border-radius: 50%; opacity: 0; background: radial-gradient(circle, var(--rst-on-accent-fill) 0 18%, var(--rst-accent) 34%, transparent 70%); } |
| 203 | .spk.fl .arc { animation: k-arc .9s cubic-bezier(.3, .1, .3, 1) both; } |
| 204 | @keyframes k-arc { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 12% { opacity: 1; } 50% { transform: translate(calc(var(--dist) * .5), -.7em) scale(1); } 88% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dist), 0) scale(.4); } } |
| 205 | @keyframes k-sweep { 40% { color: var(--rst-accent); text-shadow: 0 0 .45em color-mix(in srgb, var(--rst-accent) 60%, transparent); } } |
| 206 | /* 3: a trail of stardust drifts off along the words. */ |
| 207 | .du { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; inline-size: .26em; block-size: .26em; margin: -.13em; border-radius: 50%; opacity: 0; background: var(--rst-accent); box-shadow: 0 0 .25em color-mix(in srgb, var(--rst-accent) 70%, transparent); } |
| 208 | .du:nth-of-type(odd) { background: color-mix(in srgb, var(--rst-accent) 40%, var(--rst-on-accent-fill)); } |
| 209 | .spk.fl .du { animation: k-dust 1.2s ease-out var(--d) both; } |
| 210 | @keyframes k-dust { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 15% { opacity: 1; transform: translate(calc(var(--dx) * .12), calc(var(--dy) * .12)) scale(1.2); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } } |
| 211 | [data-v="s3"] .spk.fl > svg { animation: k-spin .7s var(--ease); } |
| 212 | @keyframes k-spin { 50% { transform: rotate(90deg) scale(1.28); } 100% { transform: rotate(180deg); } } |
| 213 | .caret .spk { font-size: .8em; margin: 0; vertical-align: -.05em; } |
| 214 | |
| 215 | /* Text arriving: crisp. Old letters fade fast; new ones follow. */ |
| 216 | :is([data-v^="s"], [data-v^="d"]) .ph.out .ch, :is([data-v^="s"], [data-v^="d"]) .tl.leaving .ph .ch { animation: t-out .2s ease-in both; } |
| 217 | @keyframes t-out { to { opacity: 0; transform: translateY(-.15em); } } |
| 218 | :is([data-v^="s"], [data-v^="d"]) .ph.in .ch.keep { animation: b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; } |
| 219 | /* 1: rise with a trace of blur, gone in the first third. */ |
| 220 | [data-v="s1"] .ph.in .ch { animation: t1-in .45s var(--ease) .2s both, b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; } |
| 221 | [data-v="s1"] .reply .w.in { animation: t1-in .45s var(--ease) both; } |
| 222 | @keyframes t1-in { 0% { opacity: 0; transform: translateY(.25em); filter: blur(1.5px); } 30% { filter: blur(0); } 100% { opacity: 1; transform: none; filter: none; } } |
| 223 | /* 2: letters settle together from a touch of extra spacing. */ |
| 224 | [data-v="s2"] .ph.in .ch { animation: t2-in .5s var(--ease) .2s both, b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; } |
| 225 | [data-v="s2"] .ph.in.sweep .ch { animation: t2-in .5s var(--ease) .2s both, b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite, k-sweep .5s ease-out calc(var(--j) * 26ms) both; } |
| 226 | [data-v="s2"] .ph.in.sweep .ch.keep { animation: b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite, k-sweep .5s ease-out calc(var(--j) * 26ms) both; } |
| 227 | [data-v="s2"] .reply .w.in { animation: t2-in .5s var(--ease) both; } |
| 228 | @keyframes t2-in { from { opacity: 0; letter-spacing: .14em; } } |
| 229 | /* 3: letters fade in one after another, left to right. */ |
| 230 | [data-v="s3"] .ph.in .ch { animation: t3-in .32s ease-out calc(.2s + var(--i) * 12ms) both, b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; } |
| 231 | [data-v="s3"] .reply .w.in { animation: t3-in .32s ease-out both; } |
| 232 | @keyframes t3-in { from { opacity: 0; transform: translateY(.18em); } } |
| 233 | |
| 234 | /* ── C. Travelling light round the border, blur crossfade ─────────── */ |
| 235 | @property --c-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; } |
| 236 | [data-v="c"] .shell { position: relative; isolation: isolate; padding: calc(var(--rst-sp-2) + 2px) var(--rst-sp-4); border: 1px solid var(--rst-line); border-radius: calc(2 * var(--rst-radius)); background: color-mix(in srgb, var(--rst-accent-soft) 45%, var(--rst-surface)); } |
| 237 | [data-v="c"] .shell.enter { animation: c-enter .55s var(--ease) both; } |
| 238 | @keyframes c-enter { from { opacity: 0; filter: blur(4px); } } |
| 239 | .ring, .glow, .flash { position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; transition: opacity .4s; } |
| 240 | .ring { padding: 1px; background: conic-gradient(from var(--c-angle), transparent 0deg 210deg, color-mix(in srgb, var(--rst-accent) 30%, transparent) 285deg, var(--rst-accent) 342deg, transparent 360deg); |
| 241 | -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; |
| 242 | mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); |
| 243 | animation: c-orbit 3.6s linear infinite; } |
| 244 | .glow { filter: blur(3px); opacity: .55; z-index: -1; } |
| 245 | .glow > .ring { inset: 0; padding: 2px; } |
| 246 | @keyframes c-orbit { to { --c-angle: 360deg; } } |
| 247 | .flash { opacity: 0; box-shadow: 0 0 0 1px var(--rst-accent), 0 0 1rem color-mix(in srgb, var(--rst-accent) 35%, transparent); } |
| 248 | [data-v="c"] .shell.flare .flash { animation: c-flash .8s ease-out both; } |
| 249 | [data-v="c"] .shell.flare > .ring, [data-v="c"] .shell.flare > .glow { opacity: 0; } |
| 250 | @keyframes c-flash { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } } |
| 251 | [data-v="c"] .win { overflow: clip; overflow-clip-margin: 6px; } |
| 252 | [data-v="c"] .ph.in { animation: c-in .6s var(--ease) both; } |
| 253 | [data-v="c"] .ph.out { animation: c-out .45s ease-out both; } |
| 254 | [data-v="c"] .tl.leaving .ph { animation: c-out .3s ease-out both; } |
| 255 | @keyframes c-in { from { opacity: 0; filter: blur(6px); transform: scale(.98); } } |
| 256 | @keyframes c-out { to { opacity: 0; filter: blur(6px); } } |
| 257 | [data-v="c"] .reply .w.in { animation: c-word .42s ease-out both; } |
| 258 | @keyframes c-word { from { opacity: 0; filter: blur(4px); } } |
| 259 | |
| 260 | /* ── Stardust A-D: crisp text, the star, dust, and a quiet handoff ── */ |
| 261 | [data-v^="d"] .shell { position: relative; } |
| 262 | .tl.ghost { position: absolute; inset-block-start: 0; inset-inline-start: 0; pointer-events: none; } |
| 263 | /* Gone: the star, its satellites and the timer fade where they sit; two |
| 264 | motes rise as a last wisp. */ |
| 265 | [data-v^="d"] .tl.leaving .spk > svg { animation: none; opacity: 0; transform: scale(.5); transition: opacity .25s ease-in, transform .25s ease-in; } |
| 266 | [data-v^="d"] .tl.leaving .sat { animation: none; opacity: 0; } |
| 267 | [data-v^="d"] .tl.leaving .du:nth-of-type(4), [data-v^="d"] .tl.leaving .du:nth-of-type(6) { animation: k-wisp .9s ease-out both; } |
| 268 | @keyframes k-wisp { 0% { opacity: 0; transform: translate(0, 0); } 25% { opacity: .5; } 100% { opacity: 0; transform: translate(.5em, -1.1em) scale(.5); } } |
| 269 | .du.warm, [data-v="d3"] .sat:nth-of-type(2), [data-v="d4"] .sat:nth-of-type(2) { background: var(--warm); } |
| 270 | .du.warm { box-shadow: 0 0 .3em color-mix(in srgb, var(--warm) 70%, transparent); } |
| 271 | /* A. Whisper */ |
| 272 | [data-v="d1"] .spk .st { animation: k-turn 7s ease-in-out infinite; } |
| 273 | @keyframes k-turn { 0% { transform: rotate(0) scale(.86); } 50% { transform: rotate(45deg) scale(.98); } 100% { transform: rotate(90deg) scale(.86); } } |
| 274 | [data-v="d1"] .spk.fl > svg { animation: k-nudge .7s var(--ease); } |
| 275 | @keyframes k-nudge { 40% { transform: scale(1.12) rotate(12deg); } } |
| 276 | [data-v="d1"] .ph.in .ch { animation: t-rise .26s ease-out calc(.2s + var(--i) * 6ms) both, b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; } |
| 277 | [data-v="d1"] .reply .w.in { animation: t-rise .28s ease-out both; } |
| 278 | @keyframes t-rise { from { opacity: 0; transform: translateY(.14em); } } |
| 279 | [data-v="d1"] .du { inline-size: .2em; block-size: .2em; margin: -.1em; } |
| 280 | [data-v="d1"] .spk.fl .du { animation-duration: 1.5s; } |
| 281 | /* B. Drift */ |
| 282 | [data-v="d2"] .spk.fl > svg { animation: k-spin .7s var(--ease); } |
| 283 | [data-v="d2"] .ph.in .ch { animation: t3-in .32s ease-out calc(.2s + var(--i) * 14ms) both, b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; } |
| 284 | [data-v="d2"] .reply .w.in { animation: t3-in .32s ease-out both; } |
| 285 | /* C. Embers */ |
| 286 | [data-v="d3"] .spk.fl > svg { animation: k-flip .8s var(--ease); } |
| 287 | @keyframes k-flip { 50% { transform: rotateY(180deg) scale(1.2); } 100% { transform: rotateY(360deg); } } |
| 288 | [data-v="d3"] .ph.in .ch { animation: t-word .4s ease-out calc(.2s + var(--w) * 70ms) both, b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; } |
| 289 | [data-v="d3"] .reply .w.in { animation: t-word .4s ease-out both; } |
| 290 | @keyframes t-word { from { opacity: 0; transform: translateY(.22em); } } |
| 291 | [data-v="d3"] .spk.fl .du { animation-duration: 1.4s; } |
| 292 | /* D. Glitter */ |
| 293 | [data-v="d4"] .spk .st { animation-duration: 3s; } |
| 294 | [data-v="d4"] .spk.fl > svg { animation: k-whirl .85s cubic-bezier(.3, 1.5, .5, 1); } |
| 295 | @keyframes k-whirl { 45% { transform: rotate(240deg) scale(1.38); } 100% { transform: rotate(360deg); } } |
| 296 | [data-v="d4"] .ph.in .ch { animation: t-drop .42s cubic-bezier(.3, 1.4, .5, 1) calc(.2s + var(--i) * 24ms) both, b-wave 3.2s ease-in-out calc(.7s + var(--j) * 45ms) infinite; } |
| 297 | [data-v="d4"] .reply .w.in { animation: t-drop .4s cubic-bezier(.3, 1.4, .5, 1) both; } |
| 298 | @keyframes t-drop { from { opacity: 0; transform: translateY(-.3em); } } |
| 299 | [data-v="d4"] .du { inline-size: .3em; block-size: .3em; margin: -.15em; } |
| 300 | [data-v="d4"] .spk.fl .du { animation: k-settle 1.6s cubic-bezier(.2, .6, .4, 1) var(--d) both; } |
| 301 | @keyframes k-settle { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 12% { opacity: 1; } 35% { transform: translate(calc(var(--dx) * .45), -.8em) scale(1.1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.5); } } |
| 302 | /* Subtle handoff: a thin caret or a soft dot at the end of the reply. */ |
| 303 | .tcaret, .tdot { display: inline-block; margin-inline-start: .18em; transition: opacity .4s; } |
| 304 | .tcaret { inline-size: 2px; block-size: 1.05em; vertical-align: -.18em; border-radius: 1px; background: var(--rst-text-muted); animation: k-blink 1.1s ease-in-out infinite; } |
| 305 | .tdot { inline-size: .45em; block-size: .45em; vertical-align: .02em; border-radius: 50%; background: color-mix(in srgb, var(--rst-accent) 75%, transparent); box-shadow: 0 0 .35em color-mix(in srgb, var(--rst-accent) 40%, transparent); animation: k-breathe 1.6s ease-in-out infinite; } |
| 306 | @keyframes k-blink { 50% { opacity: .2; } } |
| 307 | @keyframes k-breathe { 0%, 100% { opacity: .45; transform: scale(.75); } 50% { opacity: 1; transform: scale(1); } } |
| 308 | .tcaret.gone, .tdot.gone { animation: none; opacity: 0; } |
| 309 | |
| 310 | /* ── Reduced motion: everything still, and still finished ─────────── */ |
| 311 | [data-motion="reduced"] .turn *, [data-motion="reduced"] .turn *::after, [data-motion="reduced"] .msg.new { animation: none !important; transition: none !important; } |
| 312 | [data-motion="reduced"] .feed { transition: none; } |
| 313 | [data-motion="reduced"] .ph.out { display: none; } |
| 314 | [data-motion="reduced"] [data-v="a"] .mark { transform: none; box-shadow: 0 0 .5rem .1rem color-mix(in srgb, var(--rst-accent) 35%, transparent); } |
| 315 | [data-motion="reduced"] [data-v="a"] .mark::after { transform: rotate(-35deg); } |
| 316 | [data-motion="reduced"] .s2 { opacity: .7; transform: scale(.8); } |
| 317 | [data-motion="reduced"] .spk .core { transform: scale(.9); } |
| 318 | [data-motion="reduced"] .sat:nth-of-type(-n+2) { opacity: .7; transform: scale(.8) rotate(45deg); } |
| 319 | [data-motion="reduced"] .ring { --c-angle: 40deg; } |
| 320 | |
| 321 | @media (max-width: 40rem) { |
| 322 | .page { padding-block: var(--rst-sp-5); } |
| 323 | .variant > p { min-block-size: 0; } |
| 324 | } |
| 325 | |
| 326 | /* Calm Stardust (Paul, 2026-11-08: "more gentle and calming rather than |
| 327 | jittery"), over every take above: a slow continuous turn, a soft sine |
| 328 | breath, a slow glow at the heart, satellites that fade rather than pop, |
| 329 | two or three motes drifting out of step, and a flourish that is only a |
| 330 | soft brightening. The handoff fades over about 600 ms. */ |
| 331 | [data-v] .spk > svg { animation: k-calm-turn 16s linear infinite; } |
| 332 | [data-v] .spk .st { animation: k-calm-breathe 3.6s cubic-bezier(.37, 0, .63, 1) infinite; } |
| 333 | [data-v] .spk .core { animation: k-calm-glow 4.8s cubic-bezier(.37, 0, .63, 1) infinite; } |
| 334 | [data-v] .spk .sat { transform: scale(.85) rotate(45deg); animation: k-calm-sat 6.5s cubic-bezier(.37, 0, .63, 1) .4s infinite; } |
| 335 | [data-v] .spk .sat:nth-of-type(2) { animation-duration: 7.7s; animation-delay: 2.3s; } |
| 336 | [data-v] .spk .sat:nth-of-type(3) { animation-duration: 8.9s; animation-delay: 4.1s; } |
| 337 | [data-v] .spk.fl > svg { animation: k-calm-turn 16s linear infinite; } |
| 338 | [data-v] .spk.fl .st { animation: k-calm-breathe 3.6s cubic-bezier(.37, 0, .63, 1) infinite, k-calm-bright 1.6s cubic-bezier(.37, 0, .63, 1); } |
| 339 | [data-v] .spk.fl .gl, [data-v] .spk.fl .arc { animation: none; } |
| 340 | [data-v] .spk .du, [data-v] .spk.fl .du { animation: k-calm-mote 5s cubic-bezier(.37, 0, .63, 1) var(--d, 0s) infinite both; } |
| 341 | [data-v] .spk .du:nth-of-type(2) { animation-duration: 5.7s; animation-delay: 1.9s; } |
| 342 | [data-v] .spk .du:nth-of-type(3) { animation-duration: 4.4s; animation-delay: 3.6s; } |
| 343 | [data-v] .spk .du:nth-of-type(n+4) { display: none; } |
| 344 | [data-v] .tl.leaving .du:nth-of-type(n) { animation: none; opacity: 0; transition: opacity .6s ease; } |
| 345 | :is([data-v^="s"], [data-v^="d"]) .tl.leaving .ph .ch { animation: t-out .6s ease both; } |
| 346 | @keyframes k-calm-turn { to { transform: rotate(360deg); } } |
| 347 | @keyframes k-calm-breathe { 0%, 100% { transform: scale(.96); } 50% { transform: scale(1.04); } } |
| 348 | @keyframes k-calm-glow { 0%, 100% { opacity: .7; } 50% { opacity: 1; } } |
| 349 | @keyframes k-calm-sat { 0%, 100% { opacity: 0; } 45%, 60% { opacity: .75; } } |
| 350 | @keyframes k-calm-bright { 50% { filter: brightness(1.3); } } |
| 351 | @keyframes k-calm-mote { 0% { opacity: 0; transform: translate(0, 0) scale(.7); } 35% { opacity: .65; } 70% { opacity: .5; } 100% { opacity: 0; transform: translate(calc(var(--dx, 1em) * .5), calc(var(--dy, 0em) * .5)) scale(.45); } } |
| 352 | @media (prefers-reduced-motion: reduce) { [data-v] .spk > svg, [data-v] .spk .st, [data-v] .spk .core, [data-v] .spk .sat, [data-v] .spk .du { animation: none !important; } } |
| 353 | </style> |
| 354 | </head> |
| 355 | <body> |
| 356 | <main class="page"> |
| 357 | <section class="intro"> |
| 358 | <h1>The thinking line</h1> |
| 359 | <p>The line the coordinator shows while it works. At the top, four takes on Stardust; Reply switches between the two ways the line can give way to the reply. Below, the earlier versions. Every preview plays the same turn together: the activity changes every couple of seconds, the timer counts up, and the reply takes over. Copy is placeholder.</p> |
| 360 | </section> |
| 361 | |
| 362 | <div class="controls"> |
| 363 | <div class="control">Theme <span class="seg" data-control="theme"><button data-value="system" aria-pressed="true">System</button><button data-value="light" aria-pressed="false">Light</button><button data-value="dark" aria-pressed="false">Dark</button></span></div> |
| 364 | <div class="control">Turn <span class="seg" data-control="script"><button data-value="question" aria-pressed="true">A question</button><button data-value="movein" aria-pressed="false">Moving in</button></span></div> |
| 365 | <div class="control">Motion <span class="seg" data-control="motion"><button data-value="full" aria-pressed="true">Full</button><button data-value="reduced" aria-pressed="false">Reduced</button></span></div> |
| 366 | <div class="control">Reply <span class="seg" data-control="reply"><button data-value="gone" aria-pressed="true">Gone</button><button data-value="caret" aria-pressed="false">Caret</button><button data-value="dot" aria-pressed="false">Dot</button></span></div> |
| 367 | <button class="replay" type="button" data-replay>Play again</button> |
| 368 | </div> |
| 369 | |
| 370 | <section class="band"> |
| 371 | <h2>Stardust</h2> |
| 372 | <div class="grid two"> |
| 373 | <div class="variant"> |
| 374 | <h3>Stardust A. Whisper</h3> |
| 375 | <p>The quietest. Letters fade up in a quick ripple and the star turns slowly. Every five seconds or so it nudges and three motes drift off along the words.</p> |
| 376 | <div class="frame" data-mount="desk" data-v="d1"></div> |
| 377 | </div> |
| 378 | <div class="variant"> |
| 379 | <h3>Stardust B. Drift</h3> |
| 380 | <p>The one you picked, tuned. Letters fade in left to right, and on each flourish the star spins half a turn while five motes drift off along the words.</p> |
| 381 | <div class="frame" data-mount="desk" data-v="d2"></div> |
| 382 | </div> |
| 383 | <div class="variant"> |
| 384 | <h3>Stardust C. Embers</h3> |
| 385 | <p>Whole words fade up one after another. On each flourish the star flips like a coin and six motes rise from it like embers, two of them warm gold.</p> |
| 386 | <div class="frame" data-mount="desk" data-v="d3"></div> |
| 387 | </div> |
| 388 | <div class="variant"> |
| 389 | <h3>Stardust D. Glitter</h3> |
| 390 | <p>The most playful. Letters drop in slowly, the star whirls a full turn with a little bounce, and eight motes, some gold, toss up and settle past the words.</p> |
| 391 | <div class="frame" data-mount="desk" data-v="d4"></div> |
| 392 | </div> |
| 393 | </div> |
| 394 | <div class="grid two" style="margin-block-start: var(--rst-sp-5)"> |
| 395 | <div><div class="frame phone" data-mount="phone" data-v="d1"></div><p class="caption">Stardust A. Whisper</p></div> |
| 396 | <div><div class="frame phone" data-mount="phone" data-v="d2"></div><p class="caption">Stardust B. Drift</p></div> |
| 397 | <div><div class="frame phone" data-mount="phone" data-v="d3"></div><p class="caption">Stardust C. Embers</p></div> |
| 398 | <div><div class="frame phone" data-mount="phone" data-v="d4"></div><p class="caption">Stardust D. Glitter</p></div> |
| 399 | </div> |
| 400 | <p class="caption" style="text-align: start">Reply sets how the line gives way to the reply. Gone: as the first words arrive, the sparkle and the timer fade where they sit, with a last wisp of dust. Caret or Dot: the same, then a thin pulsing caret or a soft dot rides the end of the streaming text and fades when the reply ends. The earlier versions keep their own handoff.</p> |
| 401 | </section> |
| 402 | |
| 403 | <section class="band"> |
| 404 | <h2>Earlier, desktop</h2> |
| 405 | <div class="grid"> |
| 406 | <div class="variant"> |
| 407 | <h3>A. Breathing orb</h3> |
| 408 | <p>A pill with a small cobalt orb that breathes and glows. Each new activity rolls up into place through a soft-edged window while the pill eases to its new width. When the reply starts, the orb sinks away and the pill opens out into the plain reply.</p> |
| 409 | <div class="frame" data-mount="desk" data-v="a"></div> |
| 410 | </div> |
| 411 | <div class="variant"> |
| 412 | <h3>B. Sparkle</h3> |
| 413 | <p>No box. A twinkling sparkle leads the line and a slow wave of cobalt runs through the letters. New activities cascade in letter by letter as the old ones lift away. When the reply starts, the sparkle flies to the end of the text and rides it as the cursor, then fades.</p> |
| 414 | <div class="frame" data-mount="desk" data-v="b"></div> |
| 415 | </div> |
| 416 | <div class="variant"> |
| 417 | <h3>C. Travelling light</h3> |
| 418 | <p>A softly tinted card with a comet of light circling its hairline border. Activities change with a blur crossfade, as if focus pulls from one to the next. When the reply starts, the border flares once and the card dissolves into the reply, words coming into focus.</p> |
| 419 | <div class="frame" data-mount="desk" data-v="c"></div> |
| 420 | </div> |
| 421 | <div class="variant"> |
| 422 | <h3>Glint burst</h3> |
| 423 | <p>New words rise into place with a trace of blur that clears at once. When the activity changes, and every few seconds, the sparkle pops and throws a ring of tiny glints.</p> |
| 424 | <div class="frame" data-mount="desk" data-v="s1"></div> |
| 425 | </div> |
| 426 | <div class="variant"> |
| 427 | <h3>Shimmer arc</h3> |
| 428 | <p>New words settle in from a touch of extra spacing, with no blur. The flourish is a glint that arcs from the sparkle over the words, and the letters light up as it passes.</p> |
| 429 | <div class="frame" data-mount="desk" data-v="s2"></div> |
| 430 | </div> |
| 431 | </div> |
| 432 | </section> |
| 433 | |
| 434 | <section class="band"> |
| 435 | <h2>Earlier, phone, 390px</h2> |
| 436 | <div class="grid"> |
| 437 | <div><div class="frame phone" data-mount="phone" data-v="a"></div><p class="caption">A. Breathing orb</p></div> |
| 438 | <div><div class="frame phone" data-mount="phone" data-v="b"></div><p class="caption">B. Sparkle</p></div> |
| 439 | <div><div class="frame phone" data-mount="phone" data-v="c"></div><p class="caption">C. Travelling light</p></div> |
| 440 | <div><div class="frame phone" data-mount="phone" data-v="s1"></div><p class="caption">Glint burst</p></div> |
| 441 | <div><div class="frame phone" data-mount="phone" data-v="s2"></div><p class="caption">Shimmer arc</p></div> |
| 442 | </div> |
| 443 | </section> |
| 444 | </main> |
| 445 | |
| 446 | <script> |
| 447 | (function () { |
| 448 | "use strict"; |
| 449 | var ICON_CHAT = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/></svg>'; |
| 450 | var ICON_BACK = '<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg>'; |
| 451 | var SPARK = '<svg class="spark" viewBox="-1 -3 20 20" aria-hidden="true">' + |
| 452 | '<path class="s1" d="M8 0C8.6 4.6 11.4 7.4 16 8 11.4 8.6 8.6 11.4 8 16 7.4 11.4 4.6 8.6 0 8 4.6 7.4 7.4 4.6 8 0Z"/>' + |
| 453 | '<path class="s2" d="M15.5-2.5C15.7-.7 16.2-.2 18-0 16.2.2 15.7.7 15.5 2.5 15.3.7 14.8.2 13-0 14.8-.2 15.3-.7 15.5-2.5Z"/></svg>'; |
| 454 | |
| 455 | // The chosen takes' sparkle: star, white glint, satellites, and the |
| 456 | // take's own flourish parts. |
| 457 | function sparkle(v) { |
| 458 | var el = h("span", "spk"); |
| 459 | el.setAttribute("aria-hidden", "true"); |
| 460 | el.innerHTML = '<svg viewBox="0 0 16 16"><path class="st" d="M8 0C8.6 4.6 11.4 7.4 16 8 11.4 8.6 8.6 11.4 8 16 7.4 11.4 4.6 8.6 0 8 4.6 7.4 7.4 4.6 8 0Z"/><circle class="core" cx="8" cy="8" r="1.7"/></svg><i class="sat"></i><i class="sat"></i><i class="sat"></i>'; |
| 461 | if (v === "s1") [0, 60, 120, 180, 240, 300].forEach(function (a) { var g = h("i", "gl"); g.style.setProperty("--a", (a + 15) + "deg"); el.append(g); }); |
| 462 | if (v === "s2") el.append(h("i", "arc")); |
| 463 | // Dust: [dx em, dy em, delay ms, warm]. |
| 464 | var DUST = { |
| 465 | d1: [[1.8, -0.25, 0], [2.8, 0.2, 120], [2.2, -0.45, 240]], |
| 466 | d2: [[2.4, -0.5, 0], [3.4, 0.35, 90], [1.7, 0.6, 160], [4.6, -0.2, 240], [2.9, -0.75, 330]], |
| 467 | d3: [[-0.3, -1.6, 0], [0.4, -2.1, 80, 1], [1, -1.4, 160], [0.1, -2.4, 260], [0.7, -1.9, 340, 1], [1.4, -1.2, 420]], |
| 468 | d4: [[-0.8, 0.9, 0], [0.3, 0.7, 40, 1], [1.2, 1, 80], [2, 0.6, 120, 1], [2.8, 0.9, 160], [0.8, 1.1, 200], [1.7, 0.8, 240, 1], [3.4, 1, 280]] |
| 469 | }; |
| 470 | (DUST[v] || []).forEach(function (d) { |
| 471 | var g = h("i", d[3] ? "du warm" : "du"); g.style.setProperty("--dx", d[0] + "em"); g.style.setProperty("--dy", d[1] + "em"); g.style.setProperty("--d", d[2] + "ms"); el.append(g); |
| 472 | }); |
| 473 | return el; |
| 474 | } |
| 475 | |
| 476 | var SCRIPTS = { |
| 477 | question: { |
| 478 | lead: [{ own: "What's waiting for me in oficina/equipo?" }], |
| 479 | steps: [[0, "Thinking"], [1900, "Checking your projects…"], [3900, "Reading oficina/equipo…"], [6200, "Searching oficina/equipo…"], [8300, "Reading notes…"], [10300, "Thinking"]], |
| 480 | replyAt: 12300, |
| 481 | reply: "Three things are waiting in oficina/equipo. Two tasks need your review, and the staging deploy from Tuesday stopped halfway.\n\nI can pick up the deploy first. It needs one answer from you: which region to stage in." |
| 482 | }, |
| 483 | movein: { |
| 484 | lead: [{ card: "Added oficina/equipo" }], |
| 485 | steps: [[0, "Moving in…"], [1800, "Moving in… reading oficina/equipo"], [3900, "Moving in… reading docs/ARCHITECTURE.md"], [6100, "Moving in… checking the open tasks"], [8300, "Writing notes…"]], |
| 486 | replyAt: 10500, |
| 487 | reply: "I've moved in to oficina/equipo. I read the README, the open tasks and last week's notes, and wrote down what I need to remember.\n\nOne question before I start: should specialists work on main, or open a branch each?" |
| 488 | } |
| 489 | }; |
| 490 | |
| 491 | var root = document.documentElement; |
| 492 | var state = { script: "question", reply: "gone" }; |
| 493 | var PERIOD = { s1: 3600, s2: 3600, d1: 5200, d2: 3600, d3: 4000, d4: 2800 }; |
| 494 | root.dataset.motion = matchMedia("(prefers-reduced-motion: reduce)").matches ? "reduced" : "full"; |
| 495 | function reduced() { return root.dataset.motion === "reduced"; } |
| 496 | |
| 497 | function h(tag, cls, text) { |
| 498 | var el = document.createElement(tag); |
| 499 | if (cls) el.className = cls; |
| 500 | if (text != null) el.textContent = text; |
| 501 | return el; |
| 502 | } |
| 503 | |
| 504 | // ── Frames ──────────────────────────────────────────────────────── |
| 505 | function buildFrame(mount) { |
| 506 | var phone = mount.dataset.mount === "phone"; |
| 507 | if (phone) mount.insertAdjacentHTML("beforeend", '<div class="status"><span>9:41</span><span></span></div>'); |
| 508 | var header = h("header"); |
| 509 | if (phone) header.innerHTML = '<span class="back">' + ICON_BACK + 'Teams</span><span class="title">' + ICON_CHAT + 'Coordinator</span>'; |
| 510 | else header.innerHTML = ICON_CHAT + "<span>Coordinator</span>"; |
| 511 | var scroll = h("div", "scroll"); |
| 512 | var feed = h("ol", "feed"); |
| 513 | scroll.append(feed); |
| 514 | mount.append(header, scroll, h("div", "composer", "Message your coordinator")); |
| 515 | return feed; |
| 516 | } |
| 517 | |
| 518 | // ── One live thinking line ──────────────────────────────────────── |
| 519 | function Turn(mount) { |
| 520 | this.v = mount.dataset.v; |
| 521 | this.letters = this.v === "b" || this.v[0] === "s" || this.v[0] === "d"; |
| 522 | this.dust = this.v[0] === "d"; |
| 523 | this.take = this.v[0] === "s" || this.dust; |
| 524 | this.feed = buildFrame(mount); |
| 525 | } |
| 526 | Turn.prototype.reset = function (sc) { |
| 527 | clearInterval(this.flTimer); |
| 528 | var feed = this.feed; |
| 529 | feed.replaceChildren(); |
| 530 | feed.append(h("li", "day", "Today")); |
| 531 | var earlier = h("li", "msg in"); |
| 532 | earlier.innerHTML = '<div class="meta">' + ICON_CHAT + "<span>Coordinator</span></div>"; |
| 533 | earlier.append(h("p", null, "Morning. Two specialists finished overnight, and their notes are on the Tasks page.")); |
| 534 | feed.append(earlier); |
| 535 | sc.lead.forEach(function (item) { |
| 536 | var li; |
| 537 | if (item.own) { |
| 538 | li = h("li", "msg own new"); |
| 539 | li.append(h("div", "bubble", item.own)); |
| 540 | } else { |
| 541 | li = h("li", "card new", item.card); |
| 542 | } |
| 543 | feed.append(li); |
| 544 | }); |
| 545 | this.li = null; |
| 546 | }; |
| 547 | // keep: letters shared with the phrase before, which stay still. |
| 548 | Turn.prototype.makePhrase = function (text, keep) { |
| 549 | var el = h("span", "ph"); |
| 550 | keep = keep || 0; |
| 551 | if (this.letters) { |
| 552 | var w = 0; |
| 553 | Array.from(text).forEach(function (c, i) { |
| 554 | var s = h("span", i < keep ? "ch keep" : "ch", c); |
| 555 | if (/\s/.test(c) && i >= keep) w++; |
| 556 | s.style.setProperty("--w", w); |
| 557 | s.style.setProperty("--i", Math.max(0, i - keep)); |
| 558 | s.style.setProperty("--j", i); |
| 559 | el.append(s); |
| 560 | }); |
| 561 | } else { |
| 562 | el.textContent = text; |
| 563 | } |
| 564 | return el; |
| 565 | }; |
| 566 | Turn.prototype.start = function (text) { |
| 567 | var v = this.v; |
| 568 | var li = h("li", "msg in turn"); |
| 569 | li.dataset.v = v; |
| 570 | li.setAttribute("aria-busy", "true"); |
| 571 | li.innerHTML = '<div class="meta">' + ICON_CHAT + "<span>Coordinator</span></div>"; |
| 572 | var shell = h("div", "shell enter"); |
| 573 | if (v === "c") { |
| 574 | shell.append(h("span", "ring")); |
| 575 | var glow = h("span", "glow"); |
| 576 | glow.append(h("span", "ring")); |
| 577 | shell.append(glow, h("span", "flash")); |
| 578 | shell.querySelectorAll(".ring,.glow,.flash").forEach(function (e) { e.setAttribute("aria-hidden", "true"); }); |
| 579 | } |
| 580 | var tl = h("div", "tl"); |
| 581 | if (v === "a") { var mark = h("span", "mark"); mark.setAttribute("aria-hidden", "true"); tl.append(mark); } |
| 582 | if (this.take) tl.append(sparkle(v)); |
| 583 | else if (this.letters) tl.insertAdjacentHTML("beforeend", SPARK); |
| 584 | var win = h("span", "win instant"); |
| 585 | var measure = h("span", "measure"); |
| 586 | win.append(measure); |
| 587 | var sep = h("span", "sep", " · "); |
| 588 | sep.setAttribute("aria-hidden", "true"); |
| 589 | var elapsed = h("span", "el"); |
| 590 | var num = h("span", "num", "0s"); |
| 591 | elapsed.append(num); |
| 592 | tl.append(win, sep, elapsed); |
| 593 | var reply = h("div", "reply"); |
| 594 | reply.hidden = true; |
| 595 | shell.append(tl, reply); |
| 596 | li.append(shell); |
| 597 | this.feed.append(li); |
| 598 | Object.assign(this, { li: li, shell: shell, tl: tl, win: win, measure: measure, el: elapsed, num: num, reply: reply, p: null, caret: null, lastT: "" }); |
| 599 | this.phrase(text, true); |
| 600 | this.time(0); |
| 601 | if (this.take) { |
| 602 | var self2 = this; |
| 603 | this.lastFl = performance.now(); |
| 604 | this.flTimer = setInterval(function () { if (performance.now() - self2.lastFl > PERIOD[self2.v]) self2.flourish(); }, 300); |
| 605 | } |
| 606 | var self = this; |
| 607 | requestAnimationFrame(function () { requestAnimationFrame(function () { self.win.classList.remove("instant"); }); }); |
| 608 | }; |
| 609 | Turn.prototype.phrase = function (text, first) { |
| 610 | if (!this.li) return; |
| 611 | var win = this.win; |
| 612 | this.measure.replaceChildren.apply(this.measure, this.letters ? Array.from(this.makePhrase(text).children) : [text]); |
| 613 | // Layout widths, not rects: the line may be mid-entrance, scaled. |
| 614 | var natural = this.measure.offsetWidth + 1; |
| 615 | // The room left once the mark, the dot and the timer have theirs. |
| 616 | var others = this.shell.offsetWidth - win.offsetWidth; |
| 617 | var room = Math.floor(this.feed.clientWidth * 0.88 - others - 8); |
| 618 | var target = Math.max(40, Math.min(natural, room)); |
| 619 | // B keeps the words both phrases share ("Moving in… ") and moves |
| 620 | // only the rest. |
| 621 | var keep = 0; |
| 622 | if (this.letters && this.text && !first) { |
| 623 | var a = Array.from(this.text), b = Array.from(text), n = 0; |
| 624 | while (n < a.length && n < b.length && a[n] === b[n]) n++; |
| 625 | if (n < b.length) while (n > 0 && !/[\s…]/.test(b[n - 1])) n--; |
| 626 | keep = n; |
| 627 | } |
| 628 | this.text = text; |
| 629 | var next = this.makePhrase(text, keep); |
| 630 | next.style.inlineSize = (this.letters ? natural : target) + "px"; |
| 631 | var old = win.querySelectorAll(".ph:not(.out)"); |
| 632 | old.forEach(function (o) { |
| 633 | o.classList.remove("in"); |
| 634 | o.classList.add("out"); |
| 635 | Array.from(o.children).forEach(function (c, i) { |
| 636 | if (i < keep) c.style.visibility = "hidden"; |
| 637 | else c.style.setProperty("--i", i - keep); |
| 638 | }); |
| 639 | setTimeout(function () { o.remove(); }, 900); |
| 640 | }); |
| 641 | if (!first || this.letters) next.classList.add("in"); |
| 642 | win.append(next); |
| 643 | win.classList.toggle("cut", natural > room); |
| 644 | win.style.inlineSize = target + "px"; |
| 645 | if (this.take && !first) this.flourish(); |
| 646 | }; |
| 647 | // A flourish on the line's sparkle (or the cursor's). |
| 648 | Turn.prototype.flourish = function (spk) { |
| 649 | if (reduced() || (!spk && this.tl.classList.contains("leaving"))) return; |
| 650 | spk = spk || this.tl.querySelector(".spk"); |
| 651 | this.lastFl = performance.now(); |
| 652 | if (this.v === "s2" && !this.tl.hidden) { |
| 653 | spk.style.setProperty("--dist", (this.win.offsetWidth + 6) + "px"); |
| 654 | var ph = this.win.querySelector(".ph.in:not(.out)") || this.win.querySelector(".ph:not(.out)"); |
| 655 | if (ph) { ph.classList.remove("sweep"); void ph.offsetWidth; ph.classList.add("sweep"); } |
| 656 | } |
| 657 | spk.classList.remove("fl"); |
| 658 | void spk.offsetWidth; |
| 659 | spk.classList.add("fl"); |
| 660 | clearTimeout(spk._fl); |
| 661 | spk._fl = setTimeout(function () { spk.classList.remove("fl"); }, 1300); |
| 662 | }; |
| 663 | Turn.prototype.time = function (s) { |
| 664 | if (!this.li || this.tl.hidden) return; |
| 665 | var str = s + "s"; |
| 666 | if (str === this.lastT) return; |
| 667 | var grow = str.length !== this.lastT.length; |
| 668 | this.lastT = str; |
| 669 | this.num.textContent = str; |
| 670 | if (grow) this.el.style.inlineSize = (this.num.offsetWidth + 1) + "px"; |
| 671 | }; |
| 672 | Turn.prototype.leave = function () { |
| 673 | if (!this.li) return; |
| 674 | this.tl.classList.add("leaving"); |
| 675 | if (this.v === "c") this.shell.classList.add("flare"); |
| 676 | }; |
| 677 | Turn.prototype.para = function () { |
| 678 | this.p = h("p"); |
| 679 | this.reply.append(this.p); |
| 680 | if (this.caret) this.p.append(this.caret); |
| 681 | }; |
| 682 | Turn.prototype.append = function (chunk) { |
| 683 | if (!this.li) return; |
| 684 | var self = this; |
| 685 | chunk.split(/(\s+)/).forEach(function (piece) { |
| 686 | if (!piece) return; |
| 687 | var node; |
| 688 | if (/\n\n/.test(piece)) { self.para(); return; } |
| 689 | if (/^\s+$/.test(piece)) node = document.createTextNode(" "); |
| 690 | else node = h("span", "w in", piece); |
| 691 | if (self.caret && self.caret.parentNode === self.p) self.p.insertBefore(node, self.caret); |
| 692 | else self.p.append(node); |
| 693 | }); |
| 694 | }; |
| 695 | Turn.prototype.handoff = function (chunk) { |
| 696 | if (!this.li) return; |
| 697 | var shell = this.shell, motion = !reduced(); |
| 698 | if (this.dust) { |
| 699 | // The line stays where it is while it fades; the reply takes its place. |
| 700 | clearInterval(this.flTimer); |
| 701 | var tl = this.tl; |
| 702 | tl.classList.add("ghost"); |
| 703 | this.reply.hidden = false; |
| 704 | if (state.reply !== "gone") { this.caret = h("span", state.reply === "dot" ? "tdot" : "tcaret"); this.caret.setAttribute("aria-hidden", "true"); } |
| 705 | this.para(); |
| 706 | this.append(chunk); |
| 707 | if (!motion) tl.hidden = true; |
| 708 | else setTimeout(function () { tl.hidden = true; }, 900); |
| 709 | return; |
| 710 | } |
| 711 | if (this.letters) { |
| 712 | var spark = this.tl.querySelector(".spark, .spk"); |
| 713 | var r0 = spark.getBoundingClientRect(); |
| 714 | this.caret = h("span", "caret"); |
| 715 | this.caret.setAttribute("aria-hidden", "true"); |
| 716 | clearInterval(this.flTimer); |
| 717 | if (this.take) { |
| 718 | var mini = sparkle(this.v); |
| 719 | mini.classList.remove("fl"); |
| 720 | this.caret.append(mini); |
| 721 | } else { |
| 722 | this.caret.innerHTML = SPARK; |
| 723 | this.caret.firstChild.classList.remove("spark"); |
| 724 | } |
| 725 | this.tl.hidden = true; |
| 726 | this.reply.hidden = false; |
| 727 | this.para(); |
| 728 | this.append(chunk); |
| 729 | if (motion) { |
| 730 | var r1 = this.caret.getBoundingClientRect(); |
| 731 | this.caret.animate([ |
| 732 | { transform: "translate(" + (r0.left - r1.left) + "px," + (r0.top - r1.top) + "px) scale(" + (r0.width / r1.width) + ")" }, |
| 733 | { transform: "none" } |
| 734 | ], { duration: 620, easing: "cubic-bezier(.22,.8,.24,1)" }); |
| 735 | if (this.take) { var me = this, c = this.caret; setTimeout(function () { me.flourish(c.firstChild); }, 560); } |
| 736 | } |
| 737 | return; |
| 738 | } |
| 739 | // A and C: measure the box now and as plain text, then animate between. |
| 740 | var a = shell.getBoundingClientRect(); |
| 741 | this.tl.hidden = true; |
| 742 | this.reply.hidden = false; |
| 743 | this.para(); |
| 744 | this.append(chunk); |
| 745 | if (!motion) { shell.classList.add("plain"); return; } |
| 746 | shell.classList.add("notrans", "plain"); |
| 747 | var b = shell.getBoundingClientRect(); |
| 748 | shell.classList.remove("plain"); |
| 749 | shell.style.inlineSize = a.width + "px"; |
| 750 | shell.style.blockSize = a.height + "px"; |
| 751 | void shell.offsetWidth; |
| 752 | shell.classList.remove("notrans"); |
| 753 | shell.classList.add("morph", "plain"); |
| 754 | shell.style.inlineSize = b.width + "px"; |
| 755 | shell.style.blockSize = b.height + "px"; |
| 756 | setTimeout(function () { |
| 757 | shell.classList.add("notrans"); |
| 758 | shell.classList.remove("morph"); |
| 759 | shell.style.inlineSize = ""; |
| 760 | shell.style.blockSize = ""; |
| 761 | void shell.offsetWidth; |
| 762 | shell.classList.remove("notrans"); |
| 763 | }, 520); |
| 764 | }; |
| 765 | Turn.prototype.done = function () { |
| 766 | if (!this.li) return; |
| 767 | this.li.removeAttribute("aria-busy"); |
| 768 | var caret = this.caret; |
| 769 | if (!caret) return; |
| 770 | if (reduced()) { caret.remove(); return; } |
| 771 | if (this.dust) { caret.classList.add("gone"); setTimeout(function () { caret.remove(); }, 450); return; } |
| 772 | if (this.take) this.flourish(caret.firstChild); |
| 773 | caret.animate([{ opacity: 1, transform: "none" }, { opacity: 0, transform: "scale(.3) rotate(45deg)" }], { duration: 450, delay: this.take ? 900 : 500, easing: "ease-in", fill: "forwards" }) |
| 774 | .finished.then(function () { caret.remove(); }).catch(function () {}); |
| 775 | }; |
| 776 | |
| 777 | var turns = Array.from(document.querySelectorAll("[data-mount]")).map(function (m) { return new Turn(m); }); |
| 778 | function all(fn) { var args = [].slice.call(arguments, 1); turns.forEach(function (t) { t[fn].apply(t, args); }); } |
| 779 | |
| 780 | // ── The scripted turn, played on all six at once ───────────────── |
| 781 | var runId = 0, ticker = null; |
| 782 | function wait(ms) { return new Promise(function (r) { setTimeout(r, ms); }); } |
| 783 | function until(at) { return wait(Math.max(0, at - performance.now())); } |
| 784 | function chunks(text) { |
| 785 | // Deterministic, uneven token sizes, so it reads like a stream. |
| 786 | var parts = text.match(/\s*\S+/g), out = [], sizes = [2, 1, 1, 3, 1, 2, 2, 1, 3, 1], i = 0, k = 0; |
| 787 | while (i < parts.length) { var n = sizes[k++ % sizes.length]; out.push(parts.slice(i, i + n).join("")); i += n; } |
| 788 | return out; |
| 789 | } |
| 790 | async function play(again) { |
| 791 | var id = ++runId; |
| 792 | clearInterval(ticker); |
| 793 | var sc = SCRIPTS[state.script]; |
| 794 | if (again) { |
| 795 | document.querySelectorAll(".feed").forEach(function (f) { f.classList.add("fading"); }); |
| 796 | await wait(reduced() ? 0 : 320); |
| 797 | if (id !== runId) return; |
| 798 | } |
| 799 | all("reset", sc); |
| 800 | document.querySelectorAll(".feed").forEach(function (f) { f.classList.remove("fading"); }); |
| 801 | await wait(900); |
| 802 | if (id !== runId) return; |
| 803 | var t0 = performance.now(); |
| 804 | all("start", sc.steps[0][1]); |
| 805 | ticker = setInterval(function () { all("time", Math.floor((performance.now() - t0) / 1000)); }, 200); |
| 806 | for (var s = 1; s < sc.steps.length; s++) { |
| 807 | await until(t0 + sc.steps[s][0]); |
| 808 | if (id !== runId) return; |
| 809 | all("phrase", sc.steps[s][1]); |
| 810 | } |
| 811 | await until(t0 + sc.replyAt); |
| 812 | if (id !== runId) return; |
| 813 | clearInterval(ticker); |
| 814 | all("leave"); |
| 815 | await wait(reduced() ? 0 : 240); |
| 816 | if (id !== runId) return; |
| 817 | var cs = chunks(sc.reply); |
| 818 | all("handoff", cs[0]); |
| 819 | await wait(reduced() ? 60 : 540); |
| 820 | for (var c = 1; c < cs.length; c++) { |
| 821 | await wait(cs[c].length > 12 ? 120 : 75); |
| 822 | if (id !== runId) return; |
| 823 | all("append", cs[c]); |
| 824 | } |
| 825 | all("done"); |
| 826 | await wait(5000); |
| 827 | if (id !== runId) return; |
| 828 | play(true); |
| 829 | } |
| 830 | |
| 831 | // ── Controls ────────────────────────────────────────────────────── |
| 832 | function setPressed(group, value) { |
| 833 | group.querySelectorAll("button").forEach(function (b) { b.setAttribute("aria-pressed", String(b.dataset.value === value)); }); |
| 834 | } |
| 835 | // ?theme=dark&motion=reduced&turn=movein opens straight into a state. |
| 836 | var q = new URLSearchParams(location.search); |
| 837 | if (/^(light|dark)$/.test(q.get("theme"))) root.dataset.theme = q.get("theme"); |
| 838 | if (/^(full|reduced)$/.test(q.get("motion"))) root.dataset.motion = q.get("motion"); |
| 839 | if (SCRIPTS[q.get("turn")]) state.script = q.get("turn"); |
| 840 | if (/^(gone|caret|dot)$/.test(q.get("reply"))) state.reply = q.get("reply"); |
| 841 | setPressed(document.querySelector('[data-control="reply"]'), state.reply); |
| 842 | setPressed(document.querySelector('[data-control="theme"]'), root.dataset.theme); |
| 843 | setPressed(document.querySelector('[data-control="script"]'), state.script); |
| 844 | setPressed(document.querySelector('[data-control="motion"]'), root.dataset.motion); |
| 845 | document.querySelectorAll("[data-control]").forEach(function (group) { |
| 846 | group.addEventListener("click", function (e) { |
| 847 | var b = e.target.closest("button"); |
| 848 | if (!b) return; |
| 849 | var kind = group.dataset.control, value = b.dataset.value; |
| 850 | setPressed(group, value); |
| 851 | if (kind === "theme") root.dataset.theme = value; |
| 852 | if (kind === "motion") { root.dataset.motion = value; play(true); } |
| 853 | if (kind === "script") { state.script = value; play(true); } |
| 854 | if (kind === "reply") { state.reply = value; play(true); } |
| 855 | }); |
| 856 | }); |
| 857 | document.querySelector("[data-replay]").addEventListener("click", function () { play(true); }); |
| 858 | play(false); |
| 859 | })(); |
| 860 | </script> |
| 861 | </body> |
| 862 | </html> |
| 863 | |