diff --git a/src/app/openingIntro.js b/src/app/openingIntro.js index 939cbec5fc..2ad0a83be0 100644 --- a/src/app/openingIntro.js +++ b/src/app/openingIntro.js @@ -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. */ diff --git a/src/app/openingIntro.test.mjs b/src/app/openingIntro.test.mjs index b92b2c542f..b3491cc0e3 100644 --- a/src/app/openingIntro.test.mjs +++ b/src/app/openingIntro.test.mjs @@ -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);