Files
tic-tac-toe-ui/src/tictactoe/utils/haikus.ts
Vishesh 'ironeagle' Bangotra c4b44e872a feat(ui): implement timed haiku rotation with staggered line reveal and group fade-out
- Added haiku display block under board with Framer Motion animations
- Implement sequential line-by-line fade-in (staggered 2.4s per line)
- Implement full-haiku fade-out using AnimatePresence keyed by haikuIndex
- Added timed rotation logic using total animation duration (~14.4s)
- Integrated getHaiku() random selector for new haiku each cycle
- Ensured smooth transitions by updating haikuIndex on cycle end
- Added no-winner condition wrapper to show haikus during gameplay
2025-11-29 03:42:33 +05:30

92 lines
2.1 KiB
TypeScript

export const HAIKUS: string[][] = [
// HAIKU STORY SET 1 — The Only Winning Move Is No Move
[
"Silence fills the board.",
"Two minds waiting, both flawless.",
"No move is the win.",
],
[
"Perfect strategies",
"Cancel out in quiet draws.",
"Stillness holds the key.",
],
[
"Victory fades out,",
"When both players see the truth:",
"Equilibrium.",
],
// // HAIKU STORY SET 2 — AI & Game Theory
// [
// "Grids bend under thought.",
// "Algorithms watch patterns.",
// "The future decides.",
// ],
// [
// "Zeroes read the board.",
// "Minimax breathes in the dark.",
// "Loss is calculated.",
// ],
// [
// "Two perfect AIs",
// "Stare across a tiny world.",
// "Neither one can win.",
// ],
//
// // HAIKU STORY SET 3 — Players Becoming Machines
// [
// "Hands learn old rhythms.",
// "Humans imitate the code.",
// "We evolve to think.",
// ],
// [
// "Soft neon whispers,",
// "The grid calls for your next move.",
// "Time waits for no one.",
// ],
// [
// "Your choices echo.",
// "Small decisions shape the board.",
// "You shape the story.",
// ],
//
// // HAIKU STORY SET 4 — Solving the Game
// [
// "Every path explored,",
// "Every outcome known too well.",
// "Beauty in the bones.",
// ],
// [
// "Corners dream of acts,",
// "Center knows its destiny.",
// "Balance is the law.",
// ],
// [
// "Three lines cross in fate.",
// "Nine spaces hold nine futures.",
// "All end in a draw.",
// ],
//
// // HAIKU STORY SET 5 — Existential Tic-Tac-Toe
// [
// "The board is a mirror.",
// "It reflects your quiet mind.",
// "Win by understanding.",
// ],
// [
// "Nothing left to prove.",
// "The shape of thought is perfect.",
// "The game simply is.",
// ],
// [
// "A small universe,",
// "Filled with silent decisions.",
// "Meaning in the moves.",
// ],
];
export default function getHaiku() {
const idx = Math.floor(Math.random() * HAIKUS.length);
return HAIKUS[idx];
}