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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | export interface HighlightPhase { /** ms after dwell start to activate this phase */ delayMs: number /** values to ADD to the highlight set */ values: number[] /** arc pairs to ADD (p1 < p2) */ arcs?: [number, number][] } export interface NarrationSegment { /** TTS text for this segment */ ttsText: string /** TTS tone override (falls back to stop.ttsTone) */ ttsTone?: string /** Virtual time this animation phase occupies (ms) */ animationDurationMs: number } export interface PrimeTourStop { id: string viewport: { center: number; pixelsPerUnit: number } blurb: string ttsText: string ttsTone: string hoverValue?: number highlightValues?: number[] /** * When present, drives the highlight set with time-based phases. * Each phase accumulates onto the previous ones. * When absent, highlightValues applies immediately (legacy mode). */ highlightPhases?: HighlightPhase[] /** * When present, TTS is split into sequential segments. Each segment's * animation phase only starts after the previous segment's TTS **and** * animation have both finished. The stop's ttsText is kept as full * concatenated script for display/fallback. */ narrationSegments?: NarrationSegment[] dimOthers?: number minDwellMs: number autoAdvance: boolean } /** Shared narration voice direction for the tour. */ export const TOUR_TONE = 'You are a warm, amazed science show host explaining primes to a really smart 5-year-old. ' + 'Ground everything in cookies, dinosaurs, and building blocks. Be full of wonder.' export const PRIME_TOUR_STOPS: PrimeTourStop[] = [ { id: 'rainbow', viewport: { center: 15, pixelsPerUnit: 60 }, blurb: 'Every number has a secret color inside! The color comes from its smallest building block.', ttsText: "Whoa, look at all these colors! It's like a rainbow made of numbers. " + 'Every single number has its own secret color, and that color tells you what its most important ingredient is. ' + 'You know how a cookie might taste most like chocolate? ' + "A number's color comes from its first, smallest building block.", ttsTone: 'Bright, excited whisper. Like opening a secret box and explaining the magic inside.', hoverValue: 6, highlightValues: [6], dimOthers: 0.35, minDwellMs: 2000, autoAdvance: true, }, { id: 'cant-split', viewport: { center: 7, pixelsPerUnit: 120 }, blurb: "Some numbers are like super-strong LEGOs. You can't break them into smaller equal piles!", ttsText: "Now, look at number 7. See how it's one solid color? That's because it is a building block! " + "Try to split 7 LEGOs into two equal piles... you can't! Or three equal piles... nope! " + "Numbers like this, that can't be split up, are called prime numbers. " + "They're the super-special ingredients for every other number in the universe.", ttsTone: 'Playful challenge, then a eureka moment. Like daring them to try a fun puzzle, then revealing the answer.', hoverValue: 7, highlightValues: [7], dimOthers: 0.4, minDwellMs: 2000, autoAdvance: true, }, { id: 'ancient-trick', viewport: { center: 13, pixelsPerUnit: 50 }, blurb: 'Skip counting shakes the non-primes right off the number line!', ttsText: "Okay, here's a super clever trick from a long, long time ago. " + 'You know skip counting? See those little arcs above the numbers? ' + "That's our hopping path! Our number hopper is going to bounce along it " + 'and knock out every number it lands on. Ready? Here we go! ' + 'Starting at two — two, four, six, eight, ten — see them shaking off? ' + "Bye bye! They can all be split into twos, so they're not prime. " + 'Now starting at three — six? Already gone! The twos got it! Nine — shake it off! ' + 'Twelve? Gone too! See how some are already knocked out? ' + 'Faster! Fives — ten? Gone! Fifteen? Gone! Twenty-five — there it goes! ' + "And sevens — forty-nine, that's seven times seven — shake it off! " + "Elevens — they're almost all gone already! " + 'One-twenty-one, eleven times eleven — there it goes! ' + "Now look what's left standing. Those are our primes! " + "The numbers that couldn't be shaken out, no matter how hard we tried. " + 'A man named Eratosthenes invented this game thousands of years ago, ' + 'and we still use it today! ' + 'But wait — do you see what just happened? ' + "Two's path landed on twelve: two, four, six, eight, ten, twelve! " + "And three's path landed on it too: three, six, nine, twelve! " + 'That means twelve is made of twos and threes. ' + 'Two times two times three equals twelve! ' + 'Every single number that fell off is a secret recipe made from primes.', ttsTone: 'Excited game-show energy building to wonder. Start playful and familiar with skip counting, ' + 'build momentum as the sieve speeds up, then awe at the primes left standing. ' + 'When noting already-gone numbers, use a quick playful "oh!" like spotting an empty seat.', narrationSegments: [ { // Seg 0: intro — no sieve animation yet, but the path arcs are fading in. // Introduces the hopping path as a visual element, then builds anticipation. ttsText: "Okay, here's a super clever trick from a long, long time ago. " + 'You know skip counting? See those little arcs above the numbers? ' + "That's our hopping path! Our number hopper is going to bounce along it " + 'and knock out every number it lands on. Ready? Here we go!', animationDurationMs: 4000, }, { // Seg 1: factor 2 sweep (5000ms) + 600ms tail for last composites to fall. // Names "two" right at the start so it coincides with the factor 2 spotlight. // All multiples of 2 are new — no already-gone composites. ttsText: 'Starting at two — two, four, six, eight, ten — see them shaking off? ' + "Bye bye! They can all be split into twos, so they're not prime.", animationDurationMs: 6200, }, { // Seg 2: factor 3 sweep (3000ms) + 600ms tail. // Acknowledges already-gone composites (6, 12 were eliminated by factor 2). // Celebrates new eliminations (9, 15, 21). ttsText: 'Now starting at three — six? Already gone! The twos got it! ' + 'Nine — shake it off! Twelve? Gone too! ' + 'See how some are already knocked out?', animationDurationMs: 4200, }, { // Seg 3: factors 5+7+11 sweeps. Most multiples are already gone. // Calls out the key new eliminations (25 for factor 5, 49 for factor 7, 121 for factor 11). ttsText: 'Faster! Fives — ten? Gone! Fifteen? Gone! ' + 'Twenty-five — there it goes! ' + "And sevens — forty-nine, that's seven times seven — shake it off! " + "Elevens — they're almost all gone already! " + 'One-twenty-one, eleven times eleven — there it goes!', animationDurationMs: 5900, }, { // Seg 4: celebration ttsText: "Now look what's left standing. Those are our primes! " + "The numbers that couldn't be shaken out, no matter how hard we tried. " + 'A man named Eratosthenes invented this game thousands of years ago, ' + 'and we still use it today!', animationDurationMs: 5000, }, { // Seg 5: composition reveal — shows how skip counting reveals factorization. // Zooms into 12 and draws the skip-counting paths from 2 and 3. ttsText: 'But wait — do you see what just happened? ' + "Two's path landed on twelve: two, four, six, eight, ten, twelve! " + "And three's path landed on it too: three, six, nine, twelve! " + 'That means twelve is made of twos and threes. ' + 'Two times two times three equals twelve! ' + 'Every single number that fell off is a secret recipe made from primes.', animationDurationMs: 8000, }, ], minDwellMs: 35000, autoAdvance: true, }, { id: 'prime-twins', viewport: { center: 12, pixelsPerUnit: 70 }, blurb: "Some primes are best friends — they're called twins because they're only two steps apart.", ttsText: 'Hey, do you see that? Look at 11 and 13. See that little arc connecting them? ' + "It's like they're holding hands! They're only two steps away from each other. " + 'We call them twin primes. And look — 5 and 7? Twins too! ' + 'And 17 and 19! Our special building blocks love to travel with a buddy.', ttsTone: 'Delighted discovery. Like spotting something rare on a nature walk and pointing it out with glee.', hoverValue: 11, highlightValues: [5, 7, 11, 13, 17, 19], highlightPhases: [ { delayMs: 0, values: [11, 13], arcs: [[11, 13]] }, // "Look at 11 and 13. See that arc?" { delayMs: 14000, values: [5, 7], arcs: [[5, 7]] }, // "And look — 5 and 7? Twins too!" { delayMs: 17000, values: [17, 19], arcs: [[17, 19]] }, // "And 17 and 19!" ], dimOthers: 0.35, minDwellMs: 2000, autoAdvance: true, }, { id: 'mirror-numbers', viewport: { center: 131, pixelsPerUnit: 5 }, blurb: 'This prime is a palindrome — it looks the same in a mirror!', ttsText: "Let's be number detectives for a second. Look at this prime: one-three-one. " + "Now, what happens if you read it backwards? One-three-one! It's the exact same! " + 'A number that looks the same in a mirror. ' + 'These are called palindrome primes, and finding them is one of the most fun treasure hunts in all of math.', ttsTone: 'Mischievous and amazed. Like revealing a magic trick the listener can try themselves.', hoverValue: 131, highlightValues: [131], dimOthers: 0.4, minDwellMs: 2000, autoAdvance: true, }, { id: 'thinning-out', viewport: { center: 500, pixelsPerUnit: 0.8 }, blurb: 'As we fly farther out, the primes get lonelier. But they never, ever disappear completely.', ttsText: "Okay, hold on tight... let's fly way, way out and look at a huge piece of the number line. " + 'See how the primes are spreading apart? There are big dark spaces between them now. ' + 'They get rarer and lonelier the farther you go. ' + 'But here is the most incredible secret: they never stop. ' + 'No matter how far you fly, you will always find another one waiting to be discovered.', ttsTone: 'Hushed, floating awe. Like drifting through deep space, pointing out distant beautiful stars.', minDwellMs: 3000, autoAdvance: true, }, { id: 'the-giants', viewport: { center: 8191, pixelsPerUnit: 0.06 }, blurb: 'This is a Mersenne prime — a true giant, made from a special recipe using only the number 2.', ttsText: "Whoa. Look at the glow on this one! This isn't just a prime; it's a Mersenne prime — a number superhero. " + 'You make it with a special recipe: take one cookie, double it, double it again, ' + 'and keep doubling 13 times... then take one cookie away. ' + 'People use giant computers to search for even bigger ones. ' + 'The biggest one ever found, if you wrote it down, would be taller than a mountain!', ttsTone: "Breathless excitement. Like describing a T-Rex skeleton or the world's tallest roller coaster.", hoverValue: 8191, highlightValues: [8191], dimOthers: 0.4, minDwellMs: 3000, autoAdvance: true, }, { id: 'the-mystery', viewport: { center: 30, pixelsPerUnit: 30 }, blurb: "Nobody knows if twin primes go on forever. Maybe you'll find the answer!", ttsText: 'Okay, lean in close. I want to tell you a secret that no grown-up has solved. ' + 'Remember our twin primes? The ones holding hands? ' + "Here's the mystery: do they go on forever? " + 'We keep finding more and more pairs, farther and farther out... ' + 'but nobody in the whole history of the world has been able to prove they never stop. ' + 'Maybe the answer is out there, waiting for a number explorer just like you.', ttsTone: 'Conspiratorial whisper, building to warm genuine encouragement. Like entrusting them with a precious secret map.', hoverValue: 29, highlightValues: [29, 31], highlightPhases: [ { delayMs: 0, values: [29, 31], arcs: [[29, 31]] }, // "Remember our twin primes?" ], dimOthers: 0.3, minDwellMs: 3000, autoAdvance: false, }, ] |