| @@ -4,6 +4,19 @@ |
| 4 | 4 | (() => { |
| 5 | 5 | 'use strict'; |
| 6 | 6 | const T = window.TL; |
| 7 | +新增: // ?portrait renders the 9:16 cut: same timeline, re-laid out for 1080 × 1920. |
| 8 | +新增: const PORTRAIT = new URLSearchParams(location.search).has('portrait'); |
| 9 | +新增: if (PORTRAIT) { T.width = 1080; T.height = 1920; document.body.classList.add('portrait'); } |
| 10 | +新增: // Positions computed here rather than in CSS, per orientation. |
| 11 | +新增: const L = PORTRAIT |
| 12 | +新增: ? { chipY: 650, chipStep: 108, chipX: 680, node: [540, 1330], holdScale: 0.38, holdLift: -35, holdScroll: 0, |
| 13 | +新增: panelTop: 330, colLeft: 280, colTop: 1290, pillStep: 124, pillH: 104, inputDrop: 500, zBase: 1.32, shadeFrom: 1.45, rings: 2 } |
| 14 | +新增: : { chipY: 360, chipStep: 98, chipX: 972, node: [1330, 590], holdScale: 0.36, holdLift: -70, holdScroll: 430, |
| 15 | +新增: panelTop: 214, colLeft: 1330, colTop: 330, pillStep: 112, pillH: 92, inputDrop: 360, zBase: 1.0, shadeFrom: 1.15, rings: 3 }; |
| 16 | +新增: // The real workbench, captured at a landscape or a tall window size (see capture-plates.mjs). |
| 17 | +新增: const PL = window.PLATE_LAYOUT[PORTRAIT ? 'portrait' : 'landscape']; |
| 18 | +新增: const PLATES = PORTRAIT ? 'plates/portrait/' : 'plates/'; |
| 19 | +新增: const mid = ([x, y, w, h]) => [x + w / 2, y + h / 2]; |
| 7 | 20 | const $ = (s, r = document) => r.querySelector(s); |
| 8 | 21 | const $$ = (s, r = document) => [...r.querySelectorAll(s)]; |
| 9 | 22 | |
| @@ -137,9 +150,6 @@ |
| 137 | 150 | { n: 'Claude', c: '#d97757', w: '时区与 IP 对不上' }, |
| 138 | 151 | ]; |
| 139 | 152 | |
| 140 | | −删除: const CHECKS = ['VM 外出站约束', '终端检测通道', 'DNS 与解析约束', '系统时区与语言', '浏览器时区与语言', '共享文件与宿主私有目录', |
| 141 | | −删除: '宿主管理接口', '代理故障关闭', 'UDP 出站约束', 'IPv6 出站约束', '出口符合已保存规则']; |
| 142 | | −删除: |
| 143 | 153 | // ---------- build ---------- |
| 144 | 154 | const els = {}; |
| 145 | 155 | function build() { |
| @@ -147,7 +157,7 @@ |
| 147 | 157 | |
| 148 | 158 | const chips = $('#appChips'), wires = $('#wires'); |
| 149 | 159 | els.apps = APPS.map((a, i) => { |
| 150 | | −删除: const y = 360 + i * 98; |
| 160 | +新增: const y = L.chipY + i * L.chipStep; |
| 151 | 161 | const chip = document.createElement('div'); |
| 152 | 162 | chip.className = 'app-chip dark-card'; |
| 153 | 163 | chip.style.top = y + 'px'; |
| @@ -159,7 +169,10 @@ |
| 159 | 169 | chips.append(chip, warn); |
| 160 | 170 | const y0 = y + 39; |
| 161 | 171 | const path = document.createElementNS(SVGNS, 'path'); |
| 162 | | −删除: path.setAttribute('d', `M972 ${y0} C 1150 ${y0}, 1170 590, 1330 590`); |
| 172 | +新增: const [nx, ny] = L.node; |
| 173 | +新增: path.setAttribute('d', PORTRAIT |
| 174 | +新增: ? `M${L.chipX} ${y0} C 900 ${y0}, ${nx + (i - 2) * 40} ${ny - 160}, ${nx + (i - 2) * 40} ${ny}` |
| 175 | +新增: : `M${L.chipX} ${y0} C 1150 ${y0}, 1170 ${ny}, ${nx} ${ny}`); |
| 163 | 176 | const dot = document.createElementNS(SVGNS, 'circle'); |
| 164 | 177 | dot.setAttribute('r', 6); |
| 165 | 178 | dot.setAttribute('fill', '#ffb08f'); |
| @@ -177,29 +190,53 @@ |
| 177 | 190 | svgEnd.classList.add('logo-svg'); |
| 178 | 191 | $('#endLogo').appendChild(svgEnd); |
| 179 | 192 | els.endLogo = buildLogo(svgEnd); |
| 180 | | −删除: els.mini = buildLogo($('#miniLogo')); |
| 181 | | −删除: |
| 182 | | −删除: const box = $('#checks'); |
| 183 | | −删除: box.style.gridTemplateRows = 'repeat(6, 38px)'; |
| 184 | | −删除: box.style.gridAutoFlow = 'column'; |
| 185 | | −删除: els.checks = CHECKS.map(name => { |
| 186 | | −删除: const d = document.createElement('div'); |
| 187 | | −删除: d.className = 'ck'; |
| 188 | | −删除: d.innerHTML = `<div class="flash"></div><div class="st"><div class="wait"></div><div class="spin"></div><div class="ok"><svg class="i" viewBox="0 0 24 24"><path d="M5.5 12.5l4 4 9-9"/></svg></div></div><span>${name}</span><span class="res"><span class="n">检查中…</span><span class="y">通过</span></span>`; |
| 189 | | −删除: box.appendChild(d); |
| 190 | | −删除: return d; |
| 191 | | −删除: }); |
| 192 | 193 | |
| 193 | 194 | els.caps = $$('#caption .cap'); |
| 194 | 195 | els.dots = $$('#progressDots b'); |
| 195 | | −删除: els.prog = $$('.prog .p'); |
| 196 | | −删除: els.replies = $$('#reply [data-r]'); |
| 197 | | −删除: els.termLines = $$('#term > .ln'); |
| 198 | | −删除: els.navEnable = $$('[data-enable]'); |
| 199 | | −删除: els.nodes = $$('#modal .node'); |
| 200 | | −删除: const last = els.replies[3]; |
| 201 | | −删除: last.lastChild.textContent = ''; |
| 202 | | −删除: els.lastReply = last.lastChild; |
| 196 | +新增: els.plates = $$('#win .plate'); |
| 197 | +新增: Object.assign($('#win').style, { width: PL.width + 'px', height: PL.height + 'px' }); |
| 198 | +新增: els.plates.forEach(el => { el.src = PLATES + el.dataset.plate + '.png'; }); |
| 199 | +新增: // Panes sit where the real UI leaves its remote views and terminal empty. |
| 200 | +新增: const side = PL.home.sidebar[2] + 1, foot = PL.home.status[3]; |
| 201 | +新增: const place = (el, top) => Object.assign(el.style, { left: side + 'px', top: top + 'px', bottom: foot + 'px' }); |
| 202 | +新增: place($('#paneDesktop'), PL.desktop.header[3]); |
| 203 | +新增: place($('#paneTerm'), PL.term.header[3]); |
| 204 | +新增: place($('#paneBrowser'), PL.browser.navigation[1] + PL.browser.navigation[3] + 34); |
| 205 | +新增: // One overlay per check row, cut from the "all passed" plate. |
| 206 | +新增: const S = PL['safety-done'], fx = $('#checkFx'); |
| 207 | +新增: els.checkRows = S.rows.map(([x, y, w, h]) => { |
| 208 | +新增: const row = document.createElement('div'); |
| 209 | +新增: row.className = 'row'; |
| 210 | +新增: Object.assign(row.style, { |
| 211 | +新增: left: x + 'px', top: y + 'px', width: w + 'px', height: h + 'px', |
| 212 | +新增: backgroundImage: `url(${PLATES}safety-done.png)`, backgroundSize: `${PL.width}px ${PL.height}px`, backgroundPosition: `${-x}px ${-y}px`, |
| 213 | +新增: }); |
| 214 | +新增: row.innerHTML = '<div class="flash"></div>'; |
| 215 | +新增: const spin = document.createElement('div'); |
| 216 | +新增: spin.className = 'spin'; |
| 217 | +新增: Object.assign(spin.style, { left: (x + 20.5) + 'px', top: (y + h / 2) + 'px' }); |
| 218 | +新增: fx.append(row, spin); |
| 219 | +新增: return { row, spin }; |
| 220 | +新增: }); |
| 221 | +新增: const [cx, cy, , ch] = S.count; |
| 222 | +新增: Object.assign($('#checkCount').style, { left: cx + 'px', top: cy + 'px', height: ch + 'px' }); |
| 223 | +新增: // Status-bar highlights: exit, location and (when the window is wide enough to show it) timezone. |
| 224 | +新增: els.rings = PL.home.statusItems.slice(0, L.rings).map(([x, y, w, h]) => { |
| 225 | +新增: const ring = document.createElement('div'); |
| 226 | +新增: ring.className = 'ring2'; |
| 227 | +新增: Object.assign(ring.style, { left: (x - 5) + 'px', top: y + 'px', width: (w + 10) + 'px', height: h + 'px' }); |
| 228 | +新增: $('#win').insertBefore(ring, $('#ripple')); |
| 229 | +新增: return ring; |
| 230 | +新增: }); |
| 231 | +新增: els.cdReply = $$('#cdReply p'); |
| 232 | +新增: els.termA = $$('#termA > *'); |
| 233 | +新增: els.termB = $$('#termB > *'); |
| 234 | +新增: els.reply2 = $$('#termB [data-r]'); |
| 235 | +新增: els.acctBars = $$('#acctPanel .bar i').map(el => ({ el, v: parseFloat(el.style.transform.slice(7)) })); |
| 236 | +新增: els.accts = $$('#acctPanel .acct'); |
| 237 | +新增: els.accts[2].classList.add('done'); |
| 238 | +新增: els.pills = $$('#termCol .tpill'); |
| 239 | +新增: els.pills.forEach((pl, j) => { pl.style.top = (40 + j * L.pillStep) + 'px'; }); |
| 203 | 240 | } |
| 204 | 241 | |
| 205 | 242 | // Window-local position of an element's centre (offsets ignore transforms). |
| @@ -214,45 +251,79 @@ |
| 214 | 251 | let cursorKeys, clicks; |
| 215 | 252 | function measure() { |
| 216 | 253 | const A = T.app; |
| 217 | | −删除: const proxy = center($('#btnProxy'), 10, 4); |
| 218 | | −删除: const launch = center($('#btnLaunch'), 6, 4); |
| 219 | | −删除: const node = center($('#nodeLA'), -120, 3); |
| 220 | | −删除: const use = center($('#btnUse'), 8, 4); |
| 221 | | −删除: const plus = center($('#projPlus'), 2, 3); |
| 254 | +新增: // Sidebar targets come from the captured layout; pane targets are measured. |
| 255 | +新增: const desk = mid(PL.home.desktopNav), icon = mid(PL.home.termIcon), claudeItem = mid(PL.menu.claudeItem); |
| 256 | +新增: const input = center($('#cdInput'), 0, -22); |
| 257 | +新增: const go = center($('#authGo')); |
| 222 | 258 | // [time, x, y, opacity] |
| 259 | +新增: const shield = mid(PL.home.shield); |
| 223 | 260 | cursorKeys = [ |
| 224 | | −删除: [20.6, 1120, 690, 0], [21.0, 1060, 620, 1], [21.55, ...proxy, 1], [21.9, ...proxy, 1], |
| 225 | | −删除: [23.25, ...node, 1], [23.6, ...node, 1], [24.15, ...use, 1], [24.5, use[0] + 20, use[1] + 30, 1], [24.8, use[0] + 60, use[1] + 90, 0], |
| 226 | | −删除: [27.3, 1060, 640, 0], [27.55, 1010, 600, 1], [27.98, ...launch, 1], [28.3, ...launch, 1], [28.7, launch[0] + 70, launch[1] + 80, 0], |
| 227 | | −删除: [34.4, 520, 520, 0], [34.6, 420, 420, 1], [34.82, ...plus, 1], [35.15, ...plus, 1], [35.5, plus[0] + 60, plus[1] + 60, 0], |
| 261 | +新增: [A.step1 - 0.2, 620, 700, 0], [A.step1 + 0.1, 420, 740, 1], [A.safetyOpen - 0.05, ...shield, 1], [A.safetyOpen + 0.25, ...shield, 1], |
| 262 | +新增: [A.safetyOpen + 0.7, 260, 700, 0], |
| 263 | +新增: [A.step2 + 0.1, 760, 560, 0], [A.step2 + 0.3, 620, 420, 1], [A.clickDesktop - 0.05, ...desk, 1], [A.clickDesktop + 0.25, ...desk, 1], |
| 264 | +新增: [A.clickInput - 0.05, ...input, 1], [A.clickInput + 0.35, ...input, 1], [A.clickInput + 0.75, input[0] + 30, input[1] + 60, 0], |
| 265 | +新增: [A.step3, 620, 520, 0], [A.step3 + 0.25, 420, 430, 1], [A.clickTermIcon - 0.05, ...icon, 1], [A.clickTermIcon + 0.2, ...icon, 1], |
| 266 | +新增: [A.clickClaudeTerm - 0.05, ...claudeItem, 1], [A.clickClaudeTerm + 0.15, ...claudeItem, 1], [A.clickClaudeTerm + 0.55, 300, 520, 0], |
| 267 | +新增: [A.browserOpen + 0.2, go[0] + 160, go[1] + 140, 0], [A.browserOpen + 0.45, go[0] + 120, go[1] + 110, 1], |
| 268 | +新增: [A.clickAuthorize - 0.05, ...go, 1], [A.clickAuthorize + 0.25, ...go, 1], [A.clickAuthorize + 0.7, go[0] + 40, go[1] + 60, 0], |
| 228 | 269 | ]; |
| 229 | | −删除: cursorKeys.forEach(k => { k[0] += O; }); |
| 230 | | −删除: clicks = [[A.clickProxy, proxy], [A.clickNode, node], [A.clickUse, use], [A.clickLaunch, launch], [A.clickTerminal, plus]]; |
| 270 | +新增: // Wires from each new terminal to the account it lands on. |
| 271 | +新增: const wires = $('#acctWires'); |
| 272 | +新增: wires.textContent = ''; |
| 273 | +新增: els.acctWires = ACCT_ASSIGN.map((ai, j) => { |
| 274 | +新增: const acct = els.accts[ai]; |
| 275 | +新增: const ay = L.panelTop + acct.offsetTop + acct.offsetHeight / 2; |
| 276 | +新增: const py = L.colTop + 40 + j * L.pillStep + L.pillH / 2; |
| 277 | +新增: const path = document.createElementNS(SVGNS, 'path'); |
| 278 | +新增: path.setAttribute('d', PORTRAIT |
| 279 | +新增: ? `M${L.colLeft + 524} ${py} C 1062 ${py}, 1078 ${ay}, 1024 ${ay}` |
| 280 | +新增: : `M${L.colLeft - 4} ${py} C 1220 ${py}, 1225 ${ay}, 1114 ${ay}`); |
| 281 | +新增: const dot = document.createElementNS(SVGNS, 'circle'); |
| 282 | +新增: dot.setAttribute('r', 8); |
| 283 | +新增: dot.setAttribute('fill', '#519489'); |
| 284 | +新增: wires.append(path, dot); |
| 285 | +新增: return { path, dot, len: path.getTotalLength() }; |
| 286 | +新增: }); |
| 287 | +新增: clicks = [[A.safetyOpen, shield], [A.clickDesktop, desk], [A.clickInput, input], [A.clickTermIcon, icon], [A.clickClaudeTerm, claudeItem], [A.clickAuthorize, go]]; |
| 231 | 288 | } |
| 232 | 289 | |
| 233 | 290 | // ---------- camera ---------- |
| 234 | 291 | // [time, zoom, focusX, focusY, anchorX, anchorY] |
| 235 | | −删除: const O = T.app.rise - 19.0; // camera and cursor keys below are authored for a 19.0 s start |
| 236 | | −删除: const BASE = [1.15, 640, 380, 960, 600]; |
| 292 | +新增: const BASE = [1.0, 720, 430, 960, 612]; |
| 293 | +新增: const A0 = T.app; |
| 237 | 294 | const CAM = [ |
| 238 | | −删除: [19.0, ...BASE], [21.75, ...BASE], |
| 239 | | −删除: [22.55, 1.42, 764, 322, 960, 616], [24.45, 1.42, 764, 322, 960, 616], |
| 240 | | −删除: [25.25, 1.8, 620, 742, 960, 880], [26.65, 1.8, 620, 742, 960, 880], |
| 241 | | −删除: [27.35, ...BASE], [30.15, ...BASE], |
| 242 | | −删除: [30.9, 1.4, 764, 410, 960, 612], [33.25, 1.4, 764, 410, 960, 612], |
| 243 | | −删除: [34.1, ...BASE], [36.4, ...BASE], |
| 244 | | −删除: [42.6, 1.34, 700, 330, 960, 612], |
| 245 | | −删除: ].map(([at, ...rest]) => [at + O, ...rest]); |
| 295 | +新增: [A0.rise, ...BASE], [A0.safetyOpen, ...BASE], |
| 296 | +新增: [A0.safetyOpen + 0.6, 1.18, 720, 520, 960, 760], [A0.allPass + 0.7, 1.18, 720, 520, 960, 760], |
| 297 | +新增: [A0.rings[0] - 0.2, 1.75, 505, 846, 960, 900], [A0.step2 - 0.7, 1.75, 505, 846, 960, 900], |
| 298 | +新增: [A0.step2, ...BASE], [A0.desktopBoot, ...BASE], |
| 299 | +新增: [A0.desktopBoot + 0.6, 1.1, 860, 440, 960, 630], [A0.step3, 1.1, 860, 440, 960, 630], |
| 300 | +新增: [A0.clickTermIcon - 0.1, 1.7, 170, 380, 720, 620], [A0.clickClaudeTerm + 0.1, 1.7, 170, 380, 720, 620], |
| 301 | +新增: [A0.termLines + 0.5, 1.08, 820, 430, 960, 630], [A0.browserOpen, 1.08, 820, 430, 960, 630], |
| 302 | +新增: [A0.browserOpen + 0.4, 1.12, 844, 450, 960, 630], [A0.backToTerm - 0.2, 1.12, 844, 450, 960, 630], |
| 303 | +新增: [A0.backToTerm + 0.3, 1.1, 820, 420, 960, 630], [A0.out, 1.22, 760, 330, 960, 620], |
| 304 | +新增: ]; |
| 305 | +新增: // The tall cut shows the narrow window at full width, cutting in only where a detail matters. |
| 306 | +新增: const PB = [1.32, 380, 550, 540, 1026]; |
| 307 | +新增: const CAM_P = [ |
| 308 | +新增: [A0.rise, ...PB], [A0.safetyOpen, ...PB], |
| 309 | +新增: [A0.safetyOpen + 0.6, 1.42, 380, 470, 540, 1010], [A0.allPass + 0.7, 1.42, 380, 470, 540, 1010], |
| 310 | +新增: [A0.rings[0] - 0.2, 2.6, 380, 1084, 540, 1400], [A0.step2 - 0.7, 2.6, 380, 1084, 540, 1400], |
| 311 | +新增: [A0.step2, ...PB], [A0.clickTermIcon - 0.6, ...PB], |
| 312 | +新增: [A0.clickTermIcon - 0.1, 2.0, 230, 330, 490, 980], [A0.clickClaudeTerm + 0.1, 2.0, 230, 330, 490, 980], |
| 313 | +新增: [A0.termLines + 0.5, ...PB], [A0.backToTerm + 0.3, ...PB], |
| 314 | +新增: [A0.out, 1.42, 380, 420, 540, 1000], |
| 315 | +新增: ]; |
| 246 | 316 | function camAt(t) { |
| 247 | | −删除: if (t <= CAM[0][0]) return CAM[0].slice(1); |
| 248 | | −删除: for (let i = 0; i < CAM.length - 1; i++) { |
| 249 | | −删除: const a = CAM[i], b = CAM[i + 1]; |
| 317 | +新增: const K = PORTRAIT ? CAM_P : CAM; |
| 318 | +新增: if (t <= K[0][0]) return K[0].slice(1); |
| 319 | +新增: for (let i = 0; i < K.length - 1; i++) { |
| 320 | +新增: const a = K[i], b = K[i + 1]; |
| 250 | 321 | if (t <= b[0]) { |
| 251 | 322 | const k = E.io(p(t, a[0], b[0])); |
| 252 | 323 | return a.slice(1).map((v, j) => lerp(v, b[j + 1], k)); |
| 253 | 324 | } |
| 254 | 325 | } |
| 255 | | −删除: return CAM[CAM.length - 1].slice(1); |
| 326 | +新增: return K[K.length - 1].slice(1); |
| 256 | 327 | } |
| 257 | 328 | function cursorAt(t) { |
| 258 | 329 | const K = cursorKeys; |
| @@ -283,7 +354,7 @@ |
| 283 | 354 | if (t >= P.end) return; |
| 284 | 355 | |
| 285 | 356 | // Hard cuts: every hit shakes the frame and flashes it for a few frames. |
| 286 | | −删除: const hits = [[P.slam, 1], [P.b2, 0.55], [P.b3, 0.55], [P.b4, 0.55], [P.vmMem, 0.45], ...P.losses.map(x => [x, 0.32]), [P.total, 0.3]]; |
| 357 | +新增: const hits = [[P.slam, 0.5], [P.holdShrink, 0.8], [P.b2, 0.55], [P.b3, 0.55], [P.b4, 0.55], [P.vmMem, 0.45], ...P.losses.map(x => [x, 0.32]), [P.total, 0.3]]; |
| 287 | 358 | let shake = 0, flash = 0; |
| 288 | 359 | hits.forEach(([h, k]) => { |
| 289 | 360 | const q = p(t, h, h + 0.35), f = p(t, h, h + 0.13); |
| @@ -300,7 +371,8 @@ |
| 300 | 371 | const k = E.out5(p(t, a, a + 0.4)); |
| 301 | 372 | css(b, { o: t >= a && t < z ? 1 : 0, tf: `translate(${sx.toFixed(2)}px, ${sy.toFixed(2)}px) scale(${(lerp(1.05, 1, k) + Math.max(0, t - a) * 0.006).toFixed(4)})` }); |
| 302 | 373 | const kick = b.querySelector('.kick'); |
| 303 | | −删除: if (kick) css(kick, { o: E.out(p(t, a + 0.05, a + 0.3)) }); |
| 374 | +新增: const ka = i === 0 ? P.holdShrink + 0.1 : a + 0.05; |
| 375 | +新增: if (kick) css(kick, { o: E.out(p(t, ka, ka + 0.25)) }); |
| 304 | 376 | const head = b.querySelector('.head'); |
| 305 | 377 | if (head) { |
| 306 | 378 | const at = i === 0 ? P.losses[2] + 0.2 : a + 0.12; |
| @@ -309,8 +381,20 @@ |
| 309 | 381 | } |
| 310 | 382 | }); |
| 311 | 383 | |
| 312 | | −删除: // 01 · banned |
| 313 | | −删除: slam($('#alarm'), t, P.slam, { from: 1.5, dur: 0.42 }); |
| 384 | +新增: // 01 · banned: the on-hold screen people recognise, then it shrinks into evidence. |
| 385 | +新增: const sc = E.io(p(t, P.holdScroll[0], P.holdScroll[1])); |
| 386 | +新增: const sk = E.io(p(t, P.holdShrink, P.holdShrink + 0.5)); |
| 387 | +新增: const hs = lerp(1 + Math.min(t, P.holdShrink) * 0.014, L.holdScale, sk); |
| 388 | +新增: const hold = $('#hold'); |
| 389 | +新增: css(hold, { tf: `translateY(${(L.holdLift * sk).toFixed(2)}px) scale(${hs.toFixed(4)}) rotate(${(-1.6 * sk).toFixed(3)}deg)` }); |
| 390 | +新增: hold.style.borderRadius = sk > 0 ? `${(16 / hs).toFixed(1)}px` : '0'; |
| 391 | +新增: hold.style.boxShadow = sk > 0 ? `0 0 0 ${(3 / hs).toFixed(1)}px rgba(255,106,69,${(0.7 * sk).toFixed(3)}), 0 ${(40 / hs).toFixed(0)}px ${(110 / hs).toFixed(0)}px rgba(0,0,0,${(0.6 * sk).toFixed(3)})` : 'none'; |
| 392 | +新增: $('#holdScroll').style.transform = `translateY(${(-L.holdScroll * sc * (1 - sk)).toFixed(2)}px)`; |
| 393 | +新增: css($('#holdTint'), { o: 0.14 * sk }); |
| 394 | +新增: const mk = E.out(p(t, P.holdMark, P.holdMark + 0.4)); |
| 395 | +新增: const mark = $('#holdMark'); |
| 396 | +新增: mark.style.backgroundSize = `${(mk * 100).toFixed(2)}% 100%`; |
| 397 | +新增: mark.style.color = mk > 0.2 ? '#b5452a' : '#8a877f'; |
| 314 | 398 | $$('#losses .loss').forEach((el, i) => slam(el, t, P.losses[i], { from: 1.4, rot: [-3, 2, -2][i], dur: 0.3 })); |
| 315 | 399 | |
| 316 | 400 | // 02 · bills |
| @@ -387,22 +471,42 @@ |
| 387 | 471 | ['#wordmark', '#roomPos', '#roomSub'].forEach(id => css($(id), { o: 1 - gone, tf: `translateY(${(-lift * 40).toFixed(2)}px)` })); |
| 388 | 472 | } |
| 389 | 473 | |
| 474 | +新增: // Which real-UI plate is on screen at time t. |
| 475 | +新增: function plateAt(t) { |
| 476 | +新增: const A = T.app; |
| 477 | +新增: if (t < A.safetyOpen + 0.05) return 'home'; |
| 478 | +新增: if (t < A.allPass) return 'safety-run'; |
| 479 | +新增: if (t < A.safetyClose) return 'safety-done'; |
| 480 | +新增: if (t < A.clickDesktop + 0.05) return 'home'; |
| 481 | +新增: if (t < A.clickTermIcon + 0.05) return 'desktop'; |
| 482 | +新增: if (t < A.clickClaudeTerm + 0.05) return 'menu'; |
| 483 | +新增: if (t < A.browserOpen) return 'term'; |
| 484 | +新增: if (t < A.backToTerm) return 'browser'; |
| 485 | +新增: return 'term'; |
| 486 | +新增: } |
| 487 | +新增: const typed = (t, text, [a, b]) => { |
| 488 | +新增: const chars = [...text]; |
| 489 | +新增: const n = t < a ? 0 : Math.min(chars.length, Math.floor(p(t, a, b) * chars.length) + 1); |
| 490 | +新增: return chars.slice(0, n).join(''); |
| 491 | +新增: }; |
| 492 | +新增: const DESK_MSG = '帮我把 hello-cage 的 README 改得更清楚'; |
| 493 | +新增: const TERM_MSG = '给 hello-cage 加一个健康检查接口'; |
| 494 | +新增: const TERM_FINAL = '已添加 GET /healthz,返回 200 和当前版本号。'; |
| 495 | +新增: |
| 390 | 496 | function app(t) { |
| 391 | 497 | const A = T.app; |
| 392 | | −删除: const layer = $('#app'); |
| 393 | 498 | const lo = E.out(p(t, A.rise - 0.3, A.rise + 0.4)) * (1 - E.io(p(t, A.out + 0.4, A.end))); |
| 394 | | −删除: css(layer, { o: lo }); |
| 499 | +新增: css($('#app'), { o: lo }); |
| 395 | 500 | if (lo <= 0) return; |
| 396 | 501 | |
| 397 | 502 | // captions + progress |
| 398 | | −删除: const capWin = [[A.step1, A.step2 - 0.2], [A.step2, A.step3 - 0.2], [A.step3, A.out]]; |
| 503 | +新增: const capWin = [[A.step1, A.step2 - 0.2], [A.step2, A.step3 - 0.2], [A.step3, A.step4 - 0.2], [A.step4, A.out]]; |
| 399 | 504 | els.caps.forEach((c, i) => { |
| 400 | 505 | const [a, b] = capWin[i]; |
| 401 | 506 | const kin = E.out(p(t, a, a + 0.7)), kout = E.io(p(t, b - 0.35, b)); |
| 402 | 507 | css(c, { o: kin * (1 - kout), tf: `translateY(${((1 - kin) * 22 - kout * 14).toFixed(2)}px)`, f: blur((1 - kin) * 8 + kout * 8) }); |
| 403 | | −删除: const [num, txt] = c.children; |
| 404 | 508 | const k2 = E.out(p(t, a + 0.12, a + 0.9)); |
| 405 | | −删除: css(txt.lastChild, { o: k2, tf: `translateY(${((1 - k2) * 10).toFixed(2)}px)` }); |
| 509 | +新增: css(c.children[1].lastChild, { o: k2, tf: `translateY(${((1 - k2) * 10).toFixed(2)}px)` }); |
| 406 | 510 | els.dots[i].style.transform = `scaleX(${E.io(p(t, a, b)).toFixed(4)})`; |
| 407 | 511 | }); |
| 408 | 512 | css($('#progressDots'), { o: win(t, A.step1, A.out, 0.6, 0.4) }); |
| @@ -414,135 +518,152 @@ |
| 414 | 518 | const zz = z * lerp(0.94, 1, rise) * lerp(1, 0.9, exit); |
| 415 | 519 | const tx = ax - fx * zz, ty = ay - fy * zz + (1 - rise) * 160 - exit * 20; |
| 416 | 520 | css($('#cam'), { o: clamp(rise * 1.6) * (1 - exit), tf: `translate(${tx.toFixed(2)}px, ${ty.toFixed(2)}px) scale(${zz.toFixed(5)})`, f: blur(exit * 10) }); |
| 417 | | −删除: css($('#appFloor'), { o: rise * (1 - exit) * clamp(1 - (z - 1.15) * 3) }); |
| 418 | | −删除: css($('#capShade'), { o: clamp((z - 1.15) * 4) }); |
| 419 | | −删除: |
| 420 | | −删除: // --- step 1 · proxy --- |
| 421 | | −删除: const shade = win(t, A.modalOpen, A.modalClose + 0.35, 0.35, 0.35); |
| 422 | | −删除: css($('#modalShade'), { o: shade }); |
| 423 | | −删除: const mo = E.out(p(t, A.modalOpen, A.modalOpen + 0.45)), mc = E.io(p(t, A.modalClose, A.modalClose + 0.3)); |
| 424 | | −删除: css($('#modal'), { o: mo * (1 - mc), tf: `translateY(${((1 - mo) * 18 + mc * 10).toFixed(2)}px) scale(${(lerp(0.965, 1, mo) - mc * 0.02).toFixed(4)})` }); |
| 425 | | −删除: const sel = E.out(p(t, A.clickNode, A.clickNode + 0.25)); |
| 426 | | −删除: css(els.nodes[0].querySelector('.sel'), { o: sel }); |
| 427 | | −删除: els.nodes[0].querySelector('.radio').style.borderColor = sel > 0.5 ? '#1d1b1a' : '#c9c3bc'; |
| 428 | | −删除: els.nodes[0].querySelector('.radio i').style.transform = `scale(${Math.max(0, E.back(p(t, A.clickNode, A.clickNode + 0.3), 2)).toFixed(4)})`; |
| 429 | | −删除: els.nodes.forEach((n, i) => { css(n, { o: E.out(p(t, A.modalOpen + 0.15 + i * 0.06, A.modalOpen + 0.55 + i * 0.06)) }); }); |
| 430 | | −删除: |
| 431 | | −删除: const press = (at) => 1 - Math.sin(Math.PI * p(t, at - 0.02, at + 0.16)) * 0.05; |
| 432 | | −删除: const ready = E.io(p(t, A.modalClose + 0.4, A.modalClose + 0.75)); |
| 433 | | −删除: const swap = E.io(p(t, A.modalClose + 0.6, A.modalClose + 0.95)); |
| 434 | | −删除: css($('#stateWait'), { o: 1 - ready, tf: `translateY(${(-ready * 8).toFixed(2)}px)` }); |
| 435 | | −删除: css($('#stateReady'), { o: ready, tf: `translateY(${((1 - ready) * 8).toFixed(2)}px)` }); |
| 436 | | −删除: css($('#btnProxy'), { o: 1 - swap, tf: `scale(${press(A.clickProxy).toFixed(4)})` }); |
| 437 | | −删除: css($('#btnLaunch'), { o: swap, tf: `scale(${press(A.clickLaunch).toFixed(4)})` }); |
| 438 | | −删除: const s1 = $('#st1 b'), s2 = $('#st2 b'); |
| 439 | | −删除: const done1 = t > A.modalClose + 0.5, on2 = t > A.modalClose + 0.7; |
| 440 | | −删除: s1.className = done1 ? 'done' : 'on'; |
| 441 | | −删除: s1.innerHTML = done1 ? '<svg class="i" viewBox="0 0 24 24"><path d="M5.5 12.5l4 4 9-9"/></svg>' : '1'; |
| 442 | | −删除: s1.style.transform = `scale(${(1 + Math.sin(Math.PI * p(t, A.modalClose + 0.5, A.modalClose + 0.8)) * 0.18).toFixed(4)})`; |
| 443 | | −删除: s2.className = on2 ? 'on' : ''; |
| 444 | | −删除: $('#st1 > span:last-child').className = done1 ? '' : 'strong'; |
| 445 | | −删除: $('#st2 > span:last-child').className = on2 ? 'strong' : ''; |
| 446 | | −删除: |
| 447 | | −删除: flip($('#proxyFlip'), t, [A.tzFlip - 0.3], 16); |
| 448 | | −删除: flip($('#tzFlip'), t, [A.tzFlip], 16); |
| 449 | | −删除: css($('#hlProxy'), { o: win(t, A.tzFlip - 0.35, A.tzFlip + 0.75, 0.3, 0.5) }); |
| 450 | | −删除: css($('#hlTz'), { o: win(t, A.tzFlip - 0.05, A.tzFlip + 0.95, 0.3, 0.5) }); |
| 451 | | −删除: |
| 452 | | −删除: // --- step 2 · launch --- |
| 453 | | −删除: const toLaunch = E.io(p(t, A.launch + 0.12, A.launch + 0.55)); |
| 454 | | −删除: const heroOut = E.io(p(t, A.launch, A.launch + 0.25)); |
| 455 | | −删除: const toTerm = E.io(p(t, A.terminal, A.terminal + 0.4)); |
| 456 | | −删除: css($('#viewHero'), { o: 1 - heroOut, tf: `translateY(${(-heroOut * 14).toFixed(2)}px)` }); |
| 457 | | −删除: css($('#viewLaunch'), { o: toLaunch * (1 - toTerm), tf: `translateY(${((1 - toLaunch) * 16 - toTerm * 10).toFixed(2)}px)` }); |
| 458 | | −删除: |
| 459 | | −删除: const spin = `rotate(${(t * 420) % 360}deg)`; |
| 460 | | −删除: const stage = (row, start, end, label) => { |
| 461 | | −删除: const [wait, sp, ok] = row.querySelector('.st').children; |
| 462 | | −删除: const k = p(t, start, end); |
| 463 | | −删除: css(wait, { o: t < start ? 1 : 0 }); |
| 464 | | −删除: css(sp, { o: t >= start && k < 1 ? 1 : 0, tf: spin }); |
| 465 | | −删除: css(ok, { o: k >= 1 ? 1 : 0, tf: `scale(${Math.max(0, E.back(p(t, end, end + 0.3), 2)).toFixed(4)})` }); |
| 466 | | −删除: return k; |
| 521 | +新增: css($('#appFloor'), { o: rise * (1 - exit) * clamp(1 - (z - L.zBase) * 3) }); |
| 522 | +新增: css($('#capShade'), { o: clamp((z - L.shadeFrom) * 4) }); |
| 523 | +新增: |
| 524 | +新增: const plate = plateAt(t); |
| 525 | +新增: // The safety dialog fades in, settles to "all passed", then fades away; other changes are cuts. |
| 526 | +新增: const fade = { |
| 527 | +新增: 'safety-run': t >= A.safetyOpen ? E.out(p(t, A.safetyOpen + 0.05, A.safetyOpen + 0.25)) : 0, |
| 528 | +新增: 'safety-done': t >= A.allPass && t < A.safetyClose + 0.3 ? E.io(p(t, A.allPass, A.allPass + 0.35)) * (1 - E.io(p(t, A.safetyClose, A.safetyClose + 0.25))) : 0, |
| 467 | 529 | }; |
| 468 | | −删除: els.prog.forEach((row, i) => { |
| 469 | | −删除: const [a, b] = i === 0 ? A.image : A.tools; |
| 470 | | −删除: const k = stage(row, a, b); |
| 471 | | −删除: const fill = i === 0 ? E.sine(k) : E.out(k); |
| 472 | | −删除: row.querySelector('.bar i').style.transform = `scaleX(${fill.toFixed(4)})`; |
| 473 | | −删除: row.querySelector('.pct').textContent = `${Math.round(fill * 100)}%`; |
| 530 | +新增: els.plates.forEach(el => { |
| 531 | +新增: const name = el.dataset.plate; |
| 532 | +新增: let o = name === plate ? 1 : 0; |
| 533 | +新增: if (name === 'home' && (plate === 'safety-run' || plate === 'safety-done')) o = 1; |
| 534 | +新增: if (name === 'safety-run') o = plate === 'safety-run' ? fade[name] : plate === 'safety-done' ? 1 : 0; |
| 535 | +新增: if (name === 'safety-done') o = fade[name]; |
| 536 | +新增: css(el, { o }); |
| 474 | 537 | }); |
| 538 | +新增: |
| 539 | +新增: // 01 · the eleven critical checks pass one by one |
| 540 | +新增: const inDialog = t >= A.safetyOpen && t < A.allPass + 0.4; |
| 475 | 541 | let passed = 0; |
| 476 | | −删除: els.checks.forEach((row, i) => { |
| 542 | +新增: els.checkRows.forEach(({ row, spin }, i) => { |
| 477 | 543 | const at = A.checks + 0.15 + i * A.checkStep; |
| 478 | | −删除: stage(row, A.checks, at); |
| 479 | 544 | if (t >= at) passed++; |
| 480 | | −删除: const [n, y] = row.querySelector('.res').children; |
| 545 | +新增: css(row, { o: inDialog ? E.out(p(t, at, at + 0.18)) * fade['safety-run'] : 0 }); |
| 546 | +新增: css(row.firstChild, { o: Math.sin(Math.PI * p(t, at, at + 0.5)) }); |
| 547 | +新增: css(spin, { o: inDialog && t >= A.checks && t < at ? fade['safety-run'] : 0, tf: `rotate(${((t * 420) % 360).toFixed(1)}deg)` }); |
| 548 | +新增: }); |
| 549 | +新增: $('#checkCount').textContent = `${passed} / 11 通过`; |
| 550 | +新增: css($('#checkCount'), { o: inDialog && t < A.allPass + 0.35 ? fade['safety-run'] : 0 }); |
| 551 | +新增: const press = at => 1 - Math.sin(Math.PI * p(t, at - 0.02, at + 0.16)) * 0.05; |
| 552 | +新增: |
| 553 | +新增: // 01 · ready: the status bar tells you where you exit from |
| 554 | +新增: els.rings.forEach((r, i) => css(r, { o: win(t, A.rings[i], A.step2 - 0.4, 0.3, 0.4) })); |
| 555 | +新增: |
| 556 | +新增: // 02 · Claude Desktop running inside the VM display |
| 557 | +新增: const desk = plate === 'desktop' || plate === 'menu'; |
| 558 | +新增: css($('#paneDesktop'), { o: desk ? E.out(p(t, A.desktopBoot, A.desktopBoot + 0.45)) : 0 }); |
| 559 | +新增: if (desk) { |
| 560 | +新增: const sent = t >= A.send; |
| 561 | +新增: const draft = sent ? '' : typed(t, DESK_MSG, A.typeMsg); |
| 562 | +新增: $('#cdTx').textContent = draft; |
| 563 | +新增: $('#cdPh').style.display = draft ? 'none' : ''; |
| 564 | +新增: const typing = t > A.typeMsg[0] && t < A.typeMsg[1] + 0.2; |
| 565 | +新增: css($('#cdCaret'), { o: t >= A.clickInput && (typing || Math.floor(t * 2.2) % 2 === 0) ? 1 : 0 }); |
| 566 | +新增: $('#cdSend').style.background = draft ? '#d97757' : '#e8b8a5'; |
| 567 | +新增: const mv = E.io(p(t, A.send, A.send + 0.45)); |
| 568 | +新增: css($('#cdHello'), { o: E.out(p(t, A.desktopBoot + 0.3, A.desktopBoot + 0.8)) * (1 - mv), tf: `translateY(${(-mv * 30).toFixed(2)}px)` }); |
| 569 | +新增: css($('#cdInput'), { tf: `translateY(${(mv * L.inputDrop).toFixed(2)}px)` }); |
| 570 | +新增: $('#cdUser').textContent = DESK_MSG; |
| 571 | +新增: const ck = E.out(p(t, A.send + 0.15, A.send + 0.5)); |
| 572 | +新增: css($('#cdChat'), { o: ck, tf: `translateY(${((1 - ck) * 12).toFixed(2)}px)` }); |
| 573 | +新增: els.cdReply.forEach((el, i) => { |
| 574 | +新增: const at = lerp(A.reply[0], A.reply[1], i / els.cdReply.length); |
| 575 | +新增: const k = E.out(p(t, at, at + 0.35)); |
| 576 | +新增: css(el, { o: k, tf: `translateY(${((1 - k) * 8).toFixed(2)}px)` }); |
| 577 | +新增: }); |
| 578 | +新增: } |
| 579 | +新增: |
| 580 | +新增: // 03 · Claude terminal: Claude Code starts and asks to sign in |
| 581 | +新增: css($('#paneTerm'), { o: plate === 'term' ? 1 : 0 }); |
| 582 | +新增: const back = t >= A.backToTerm; |
| 583 | +新增: css($('#termA'), { o: back ? 0 : 1 }); |
| 584 | +新增: css($('#termB'), { o: back ? 1 : 0 }); |
| 585 | +新增: els.termA.forEach((ln, i) => { |
| 586 | +新增: const at = i === els.termA.length - 1 ? A.opening : A.termLines + i * 0.1; |
| 481 | 587 | const k = E.out(p(t, at, at + 0.25)); |
| 482 | | −删除: css(n, { o: t < A.checks ? 0.5 : 1 - k }); |
| 483 | | −删除: css(y, { o: k, tf: `translateX(${((1 - k) * 6).toFixed(2)}px)` }); |
| 484 | | −删除: css(row.querySelector('.flash'), { o: Math.sin(Math.PI * p(t, at, at + 0.5)) }); |
| 588 | +新增: css(ln, { o: k, tf: `translateY(${((1 - k) * 6).toFixed(2)}px)` }); |
| 485 | 589 | }); |
| 486 | | −删除: const rel = E.out(p(t, A.released, A.released + 0.45)); |
| 487 | | −删除: $('#ckCount').textContent = passed === 11 ? '11 / 11 通过' : `${passed} / 11`; |
| 488 | | −删除: $('#ckCount').style.color = passed === 11 ? '#1f5f35' : '#6c6763'; |
| 489 | | −删除: css($('#phBusy'), { o: 1 - clamp(rel * 2.5), tf: `translateY(${(-rel * 16).toFixed(2)}px)`, f: blur(rel * 6) }); |
| 490 | | −删除: css($('#phDone'), { o: clamp(rel * 1.6 - 0.4), tf: `translateY(${((1 - rel) * 14).toFixed(2)}px)` }); |
| 491 | | −删除: css($('.ph .okb'), { o: rel, tf: `scale(${lerp(0.6, 1, Math.max(0, E.back(p(t, A.released, A.released + 0.45), 2))).toFixed(4)})` }); |
| 492 | | −删除: $('.ph').style.background = `rgba(47,138,76,${(0.07 * Math.sin(Math.PI * p(t, A.released, A.released + 1.2))).toFixed(4)})`; |
| 493 | | −删除: |
| 494 | | −删除: // sidebar + status bar follow the environment state |
| 495 | | −删除: flip($('#envFlip'), t, [A.launch, A.released], 18); |
| 496 | | −删除: $('#envDot').style.background = t > A.released ? '#2f8a4c' : t > A.launch ? '#d29a2e' : '#b7b1ab'; |
| 497 | | −删除: $('#envDot').style.boxShadow = t > A.released ? '0 0 0 3px rgba(47,138,76,.16)' : 'none'; |
| 498 | | −删除: flip($('#netFlip'), t, [A.released + 0.15], 16); |
| 499 | | −删除: flip($('#latFlip'), t, [A.released + 0.35], 16); |
| 500 | | −删除: const netOk = t > A.released + 0.15; |
| 501 | | −删除: $('#netIco').style.color = netOk ? '#2f8a4c' : '#4a4642'; |
| 502 | | −删除: $('#netTick').style.opacity = netOk ? 1 : 0; |
| 503 | | −删除: els.navEnable.forEach(n => { n.style.color = t > A.released ? '#2a2724' : '#b4aea8'; }); |
| 504 | | −删除: css($('#stopIt'), { o: t > A.launch ? 1 : 0.4 }); |
| 505 | | −删除: |
| 506 | | −删除: // --- step 3 · terminal --- |
| 507 | | −删除: css($('#viewTerm'), { o: toTerm }); |
| 508 | | −删除: const term = E.out(p(t, A.clickTerminal, A.clickTerminal + 0.3)); |
| 509 | | −删除: css($('#childHint'), { o: 1 - term }); |
| 510 | | −删除: css($('#childTerm'), { o: term }); |
| 511 | | −删除: $('#navHome').className = term > 0.5 ? '' : 'on'; |
| 512 | | −删除: css($('#crumbLeaf'), { o: toTerm }); |
| 513 | | −删除: css($('#syncIt'), { o: toTerm }); |
| 514 | | −删除: els.termLines.forEach((ln, i) => { |
| 515 | | −删除: const k = E.out(p(t, A.terminal + 0.1 + i * 0.05, A.terminal + 0.45 + i * 0.05)); |
| 590 | +新增: if (t >= A.opening) $('#termOpening').style.opacity = String(0.55 + 0.45 * Math.abs(Math.sin((t - A.opening) * 5))); |
| 591 | +新增: |
| 592 | +新增: // 04 · authorise in the Cage browser, then back to work |
| 593 | +新增: css($('#paneBrowser'), { o: plate === 'browser' ? E.out(p(t, A.browserOpen, A.browserOpen + 0.3)) : 0 }); |
| 594 | +新增: const dn = E.out(p(t, A.authDone, A.authDone + 0.35)); |
| 595 | +新增: css($('#authAsk'), { o: 1 - dn }); |
| 596 | +新增: css($('#authDone'), { o: dn, tf: `scale(${lerp(0.96, 1, dn).toFixed(4)})` }); |
| 597 | +新增: $('#authGo').style.transform = `scale(${press(A.clickAuthorize).toFixed(4)})`; |
| 598 | +新增: els.termB.forEach((ln, i) => { |
| 599 | +新增: if (ln.dataset.r !== undefined) return; |
| 600 | +新增: const at = A.backToTerm + 0.1 + i * 0.25; |
| 601 | +新增: const k = E.out(p(t, at, at + 0.3)); |
| 516 | 602 | css(ln, { o: k, tf: `translateY(${((1 - k) * 6).toFixed(2)}px)` }); |
| 517 | 603 | }); |
| 518 | | −删除: const typed = (s, at, per) => s.slice(0, Math.max(0, Math.floor((t - at) / per) + 1) * (t >= at ? 1 : 0)); |
| 519 | | −删除: $('#cmdText').textContent = typed('claude', A.typeClaude, 0.1); |
| 604 | +新增: $('#termPrompt').textContent = typed(t, TERM_MSG, A.typePrompt); |
| 520 | 605 | const blinkOn = Math.floor(t * 2.2) % 2 === 0; |
| 521 | | −删除: css($('#caret1'), { o: t < A.enterClaude ? (t > A.typeClaude && t < A.typeClaude + 0.7 ? 1 : blinkOn ? 1 : 0) : 0 }); |
| 522 | | −删除: const cc = E.out(p(t, A.welcome, A.welcome + 0.5)); |
| 523 | | −删除: css($('#ccBlock'), { o: cc, tf: `translateY(${((1 - cc) * 10).toFixed(2)}px)` }); |
| 524 | | −删除: const prompt = '帮我给 hello-cage 写一份 README'; |
| 525 | | −删除: $('#promptText').textContent = typed(prompt, A.typePrompt, (A.enterPrompt - 0.2 - A.typePrompt) / prompt.length); |
| 526 | | −删除: css($('#caret2'), { o: t < A.enterPrompt ? (t > A.typePrompt ? 1 : blinkOn ? 1 : 0) : 0 }); |
| 527 | | −删除: els.replies.forEach((r, i) => { |
| 528 | | −删除: const k = E.out(p(t, A.reply[i], A.reply[i] + 0.35)); |
| 606 | +新增: css($('#termCaret'), { o: t < A.enterPrompt && (t > A.typePrompt[0] || blinkOn) ? 1 : 0 }); |
| 607 | +新增: els.reply2.forEach((r, i) => { |
| 608 | +新增: const k = E.out(p(t, A.reply2[i], A.reply2[i] + 0.35)); |
| 529 | 609 | css(r, { o: k, tf: `translateY(${((1 - k) * 6).toFixed(2)}px)` }); |
| 530 | 610 | }); |
| 531 | | −删除: const final = 'README 写好了:简介、安装方式和本地运行步骤都在里面。'; |
| 532 | | −删除: els.lastReply.textContent = ' ' + final.slice(0, Math.floor(p(t, A.reply[3], A.reply[3] + 1.1) * final.length)); |
| 611 | +新增: $('#termFinal').textContent = TERM_FINAL.slice(0, Math.floor(p(t, A.reply2[3], A.reply2[3] + 1.0) * TERM_FINAL.length)); |
| 533 | 612 | |
| 534 | 613 | // cursor + clicks |
| 535 | 614 | const [cx, cy, co] = cursorAt(t); |
| 536 | 615 | const pressK = clicks.reduce((m, [at]) => Math.max(m, Math.sin(Math.PI * p(t, at - 0.04, at + 0.14))), 0); |
| 537 | | −删除: css($('#cursor'), { o: co, tf: `translate(${(cx - 248 - 5).toFixed(2)}px, ${(cy - 3).toFixed(2)}px) scale(${(1 - pressK * 0.16).toFixed(4)})` }); |
| 616 | +新增: css($('#cursor'), { o: co, tf: `translate(${(cx - 5).toFixed(2)}px, ${(cy - 3).toFixed(2)}px) scale(${(1 - pressK * 0.16).toFixed(4)})` }); |
| 538 | 617 | let rip = null; |
| 539 | 618 | clicks.forEach(([at, pos]) => { if (t >= at && t < at + 0.55) rip = [p(t, at, at + 0.55), pos]; }); |
| 540 | 619 | if (rip) { |
| 541 | 620 | const [k, [x, y]] = rip; |
| 542 | | −删除: css($('#ripple'), { o: (1 - k) * 0.9, tf: `translate(${(x - 248).toFixed(2)}px, ${y.toFixed(2)}px) scale(${lerp(0.3, 1.5, E.out(k)).toFixed(4)})` }); |
| 621 | +新增: css($('#ripple'), { o: (1 - k) * 0.9, tf: `translate(${x.toFixed(2)}px, ${y.toFixed(2)}px) scale(${lerp(0.3, 1.5, E.out(k)).toFixed(4)})` }); |
| 543 | 622 | } else css($('#ripple'), { o: 0 }); |
| 544 | 623 | } |
| 545 | 624 | |
| 625 | +新增: // Terminal j goes to account ACCT_ASSIGN[j]: fewest terminals first, then the most quota left. |
| 626 | +新增: const ACCT_ASSIGN = [0, 1, 0]; |
| 627 | +新增: function accounts(t) { |
| 628 | +新增: const C = T.accounts; |
| 629 | +新增: const o = E.io(p(t, C.start, C.start + 0.5)) * (1 - E.io(p(t, C.out, C.end))); |
| 630 | +新增: css($('#accts'), { o }); |
| 631 | +新增: if (o <= 0) return; |
| 632 | +新增: const kc = E.out(p(t, C.start + 0.1, C.start + 0.8)); |
| 633 | +新增: css($('#accts .cap'), { o: kc, tf: `translateY(${((1 - kc) * 22).toFixed(2)}px)`, f: blur((1 - kc) * 8) }); |
| 634 | +新增: $$('#accts .dots b').forEach((b, i) => { b.style.transform = `scaleX(${i < 4 ? 1 : E.io(p(t, C.start, C.out)).toFixed(4)})`; }); |
| 635 | +新增: const pk = E.out5(p(t, C.panel, C.panel + 0.6)); |
| 636 | +新增: css($('#acctPanel'), { o: clamp(pk * 1.5), tf: `translateY(${((1 - pk) * 50).toFixed(2)}px)` }); |
| 637 | +新增: els.accts.forEach((r, i) => { |
| 638 | +新增: const k = E.out5(p(t, C.rows[i], C.rows[i] + 0.5)); |
| 639 | +新增: css(r, { o: k, tf: `translateY(${((1 - k) * 20).toFixed(2)}px)` }); |
| 640 | +新增: const mine = ACCT_ASSIGN.map((a, j) => (a === i ? C.terms[j] + 0.45 : null)).filter(x => x !== null); |
| 641 | +新增: const em = r.querySelector('.load em'); |
| 642 | +新增: if (em) em.textContent = String(mine.filter(x => t >= x).length); |
| 643 | +新增: css(r.querySelector('.ring'), { o: mine.reduce((m, x) => Math.max(m, Math.sin(Math.PI * p(t, x - 0.1, x + 0.7))), 0) }); |
| 644 | +新增: const skip = r.querySelector('.skip'); |
| 645 | +新增: if (skip) css(skip, { o: E.out(p(t, C.terms[0] + 0.2, C.terms[0] + 0.5)), tf: `translateX(${(Math.sin(t * 60) * 3 * Math.sin(Math.PI * p(t, C.terms[0] + 0.2, C.terms[0] + 0.6))).toFixed(2)}px)` }); |
| 646 | +新增: }); |
| 647 | +新增: els.acctBars.forEach(({ el, v }, n) => { |
| 648 | +新增: const row = Math.floor(n / 2); |
| 649 | +新增: el.style.transform = `scaleX(${(v * E.out(p(t, C.rows[row] + 0.25, C.rows[row] + 1.0))).toFixed(4)})`; |
| 650 | +新增: }); |
| 651 | +新增: css($('#termCol .tlabel'), { o: E.out(p(t, C.terms[0] - 0.4, C.terms[0])) }); |
| 652 | +新增: els.pills.forEach((pl, j) => { |
| 653 | +新增: const at = C.terms[j]; |
| 654 | +新增: const k = E.out5(p(t, at, at + 0.45)); |
| 655 | +新增: css(pl, { o: clamp(k * 2), tf: `translateX(${((1 - k) * 90).toFixed(2)}px)` }); |
| 656 | +新增: css(pl.querySelector('.to'), { o: E.out(p(t, at + 0.5, at + 0.7)), tf: `scale(${Math.max(0, E.back(p(t, at + 0.5, at + 0.8), 2)).toFixed(4)})` }); |
| 657 | +新增: const w = els.acctWires[j]; |
| 658 | +新增: const d = E.io(p(t, at + 0.1, at + 0.5)); |
| 659 | +新增: w.path.style.opacity = (d > 0 ? lerp(0.9, 0.35, p(t, at + 0.6, at + 1.4)) : 0).toFixed(3); |
| 660 | +新增: const pt = w.path.getPointAtLength(d * w.len); |
| 661 | +新增: w.dot.setAttribute('cx', pt.x.toFixed(2)); |
| 662 | +新增: w.dot.setAttribute('cy', pt.y.toFixed(2)); |
| 663 | +新增: w.dot.style.opacity = d > 0 && d < 1 ? 1 : 0; |
| 664 | +新增: }); |
| 665 | +新增: } |
| 666 | +新增: |
| 546 | 667 | function perks(t) { |
| 547 | 668 | const P = T.perks; |
| 548 | 669 | const o = E.io(p(t, P.start, P.start + 0.6)) * (1 - E.io(p(t, P.out, P.end))); |
| @@ -592,16 +713,16 @@ |
| 592 | 713 | css($('#endLogo'), { tf: `translateY(${(barImpact(t, [a + 0.85, a + 1.0]) * 4).toFixed(2)}px)` }); |
| 593 | 714 | const k = (d, dur = 0.8) => E.out(p(t, a + d, a + d + dur)); |
| 594 | 715 | const rise = (el, d) => { const v = k(d); css(el, { o: v, tf: `translateY(${((1 - v) * 16).toFixed(2)}px)`, f: blur((1 - v) * 6) }); }; |
| 595 | | −删除: rise($('#endWord'), 1.2); |
| 596 | | −删除: rise($('#endSub'), 1.55); |
| 597 | | −删除: $$('#endPlat span').forEach((s, i) => rise(s, 1.95 + i * 0.12)); |
| 598 | | −删除: rise($('#endUrl'), 2.5); |
| 599 | | −删除: rise($('#endGit'), 2.75); |
| 600 | | −删除: rise($('#endNote'), 3.1); |
| 716 | +新增: rise($('#endWord'), 0.9); |
| 717 | +新增: rise($('#endSub'), 1.15); |
| 718 | +新增: $$('#endPlat span').forEach((s, i) => rise(s, 1.45 + i * 0.1)); |
| 719 | +新增: rise($('#endUrl'), 1.85); |
| 720 | +新增: rise($('#endGit'), 2.05); |
| 721 | +新增: rise($('#endNote'), 2.3); |
| 601 | 722 | } |
| 602 | 723 | |
| 603 | 724 | function chrome(t, frame) { |
| 604 | | −删除: const dark = t < T.room.start + 0.4 || (t > T.letter.start + 0.4 && t < T.letter.out + 0.4); |
| 725 | +新增: const dark = (t > T.pain.holdShrink && t < T.room.start + 0.4) || (t > T.letter.start + 0.4 && t < T.letter.out + 0.4); |
| 605 | 726 | const g = $('#grain'); |
| 606 | 727 | g.style.opacity = dark ? 0.55 : 0.3; |
| 607 | 728 | g.style.transform = `translate(${Math.floor(hash(frame) * 200) - 100}px, ${Math.floor(hash(frame + 0.5) * 200) - 100}px)`; |
| @@ -613,6 +734,7 @@ |
| 613 | 734 | pain(t); |
| 614 | 735 | room(t); |
| 615 | 736 | app(t); |
| 737 | +新增: accounts(t); |
| 616 | 738 | perks(t); |
| 617 | 739 | letter(t); |
| 618 | 740 | end(t); |