All files / web/src/components/toys/number-line/constants/demos tauDemoNarration.ts

0% Statements 0/114
0% Branches 0/1
0% Functions 0/1
0% Lines 0/114

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115                                                                                                                                                                                                                                     
/**
 * Tau Demo Narration Segments
 *
 * Matches the tauDemo.ts animation: a circle with radius 1 (diameter 2)
 * is constructed on the number line, then rolls one full turn.
 * The distance it rolls is tau (2*pi ~ 6.283).
 *
 * Progress ranges from tauDemo.ts:
 *   CONSTRUCTION (0.00–0.30):
 *     Highlight  0.00–0.06  "1 to edge" glows on axis
 *     Pivot      0.06–0.15  segment swings to vertical
 *     Sweep      0.15–0.255 arc traces full circle (with compass arm)
 *     Treads     0.255–0.30 tire marks sprout
 *   ROLLING (0.30–0.92):
 *     Circle rolls rightward; pi halfway mark appears at t >= 0.5
 *   LABELS (0.92–1.00):
 *     "tau", "full turn", "C = tau*r" fade in
 */

import type { DemoNarrationSegment } from './useConstantDemoNarration'

/** Shared voice direction for the tau demo narrator. */
export const TAU_DEMO_TONE =
  'You are an excited, warm science teacher for a really smart 5-year-old. ' +
  'Use everyday objects like bicycle wheels, hula hoops, and merry-go-rounds. Be full of wonder.'

export const TAU_DEMO_SEGMENTS: DemoNarrationSegment[] = [
  // ── Construction ──────────────────────────────────────────────
  {
    // Seg 0: Highlight — the red "1 to edge" stick appears
    ttsText:
      'See that red stick? It goes from the very center of a wheel all the way to the edge. ' +
      "That's called the radius — one unit from center to edge.",
    startProgress: 0.0,
    endProgress: 0.06,
    animationDurationMs: 5000,
    scrubberLabel: 'The radius',
  },
  {
    // Seg 1: Pivot — stick swings up to vertical
    ttsText: "Let's stand it up — whoosh! " + "Now let's build a circle around it.",
    startProgress: 0.06,
    endProgress: 0.15,
    animationDurationMs: 3500,
    scrubberLabel: 'Stand it up',
  },
  {
    // Seg 2: Sweep — teal arc traces with compass arm
    ttsText:
      'See the compass spinning around? ' +
      "It's drawing a big circle — like tracing around a hula hoop! " +
      'The radius is the whole stick, so this is going to be a nice big wheel.',
    startProgress: 0.15,
    endProgress: 0.255,
    animationDurationMs: 5000,
    scrubberLabel: 'Draw the circle',
  },
  {
    // Seg 3: Treads appear — transition naturally from circle to wheel
    ttsText:
      "Now let's turn it into a real wheel! " +
      'See those little bumps popping up? Those are the tire treads.',
    startProgress: 0.255,
    endProgress: 0.3,
    animationDurationMs: 3000,
    scrubberLabel: 'Tire treads',
  },

  // ── Rolling ───────────────────────────────────────────────────
  {
    // Seg 4: First stretch of rolling, before pi mark
    ttsText:
      'And off it goes! Our big wheel is rolling along the number line. ' +
      "Let's see how far one full turn takes it!",
    startProgress: 0.3,
    endProgress: 0.55,
    animationDurationMs: 5500,
    scrubberLabel: 'Rolling!',
  },
  {
    // Seg 5: Passing the pi halfway mark
    ttsText:
      "Look! We just passed pi — but we're only halfway around! " +
      'The wheel has so much more spinning to do.',
    startProgress: 0.55,
    endProgress: 0.72,
    animationDurationMs: 5000,
    scrubberLabel: 'Passing pi',
  },
  {
    // Seg 6: Final stretch of rolling
    ttsText:
      'Keep going, keep going... almost one full turn... ' + 'past four, past five, past six...',
    startProgress: 0.72,
    endProgress: 0.92,
    animationDurationMs: 5000,
    scrubberLabel: 'Keep going',
  },

  // ── Labels ────────────────────────────────────────────────────
  {
    // Seg 7: Final reveal
    ttsText:
      'There it is! That number is called tau. ' +
      "It's about six point two eight — exactly twice pi! " +
      'Tau is the distance a wheel rolls in one full turn, ' +
      'measured from its center to its edge. ' +
      'One full spin, one tau — easy to remember!',
    startProgress: 0.92,
    endProgress: 1.0,
    animationDurationMs: 8000,
    scrubberLabel: "It's tau!",
  },
]