The words under the opening's logo fade in 150 ms, before it reaches the centre

This commit is contained in:
German Khokhlov committed 2026-11-23 15:57:04 +04:00
1 parent 72f3d0f4a7
commit 6785a12581
2 files changed
+6 -2

No files matched your search

+4 -2
View File
@@ -12,7 +12,9 @@ import { cameraOf } from '../render/rendererOf.js';
* Everything is timed from one clock, in ms.
*/
export const OPENING = Object.freeze({
/** The words fade and the logo moves to the centre. */
/** The words under the logo fade. */
textMs: 150,
/** The logo moves to the centre. */
centreMs: 450,
// The rest is timed from the end of the move.
/** The eye grows past the screen's edges. */
@@ -71,7 +73,7 @@ export function openingStage(t, timing = OPENING) {
const flight = clamp01((after - timing.flightStartMs) / timing.flightMs);
return {
/** The words' opacity. */
text: 1 - move,
text: 1 - clamp01(t / timing.textMs),
/** How far the logo has moved to the centre, 0–1. */
centre: easeInOutCubic(move),
/** Whether the screen is shut except inside the eye. */
+2
View File
@@ -24,6 +24,8 @@ test('the words fade, then the eye opens past the screen before the globe arrive
assert.equal(start.shut, false);
assert.equal(start.pupilOpacity, 1);
assert.equal(start.flight, 0);
assert.equal(openingStage(OPENING.textMs).text, 0, 'the words go first');
assert.ok(openingStage(OPENING.textMs).centre < 0.5);
const centred = openingStage(OPENING.centreMs);
assert.equal(centred.text, 0);
assert.equal(centred.centre, 1);