import { useState, useEffect } from 'react'; import { Check, X, RefreshCw, Award } from 'lucide-react'; export default function QuoteGame() { const [quotes] = useState([ { text: "We are not fighting against blood and flesh, but against those who want to enslave us.", author: "Zelensky", context: "From a speech addressing the Ukrainian people in March 2022" }, { text: "Whoever tries to hinder us, and even more so, to create threats to our country, to our people, should know that Russia's response will be immediate and will lead you to such consequences that you have never experienced in your history.", author: "Putin", context: "From Putin's speech announcing the 'special military operation' in Ukraine, February 2022" }, { text: "We don't want to divide the world into parts. We don't want to divide people into sorts. We want to live, and we want everyone to be able to live.", author: "Zelensky", context: "From Zelensky's address to the U.S. Congress, March 2022" }, { text: "The problem is that in many countries the ruling elites say one thing, but do something completely different.", author: "Putin", context: "From Putin's speech at the Valdai Discussion Club, October 2021" }, { text: "We are fighting for our freedom, for our victory, for our people, for our values.", author: "Zelensky", context: "From a video address in April 2022" }, { text: "The collapse of the Soviet Union was the greatest geopolitical catastrophe of the century.", author: "Putin", context: "From Putin's annual address to the Federal Assembly, April 2005" }, { text: "I need ammunition, not a ride.", author: "Zelensky", context: "Reported response when the U.S. offered to evacuate him from Kyiv, February 2022" }, { text: "Sometimes it is necessary to fight against the so-called fifth column, those people who make money here but live over there.", author: "Putin", context: "From a speech in March 2022" }, { text: "We are all mortal, but we are creating something that will live for centuries.", author: "Putin", context: "From a speech on the annexation of Crimea, March 2014" }, { text: "Light will win over darkness, and death will lose to life. Ukraine will win.", author: "Zelensky", context: "From a video address in March 2022" } ]); const [currentQuoteIndex, setCurrentQuoteIndex] = useState(0); const [score, setScore] = useState(0); const [gameState, setGameState] = useState('playing'); // playing, feedback, finished const [selectedAnswer, setSelectedAnswer] = useState(null); const [shuffledQuotes, setShuffledQuotes] = useState([]); useEffect(() => { // Shuffle quotes at the beginning setShuffledQuotes([...quotes].sort(() => Math.random() - 0.5)); }, [quotes]); const handleAnswer = (answer) => { setSelectedAnswer(answer); if (answer === shuffledQuotes[currentQuoteIndex].author) { setScore(score + 1); } setGameState('feedback'); }; const nextQuote = () => { if (currentQuoteIndex < shuffledQuotes.length - 1) { setCurrentQuoteIndex(currentQuoteIndex + 1); setSelectedAnswer(null); setGameState('playing'); } else { setGameState('finished'); } }; const restartGame = () => { setShuffledQuotes([...quotes].sort(() => Math.random() - 0.5)); setCurrentQuoteIndex(0); setScore(0); setSelectedAnswer(null); setGameState('playing'); }; if (shuffledQuotes.length === 0) { return
Loading...
; } const currentQuote = shuffledQuotes[currentQuoteIndex]; const progress = ((currentQuoteIndex + 1) / shuffledQuotes.length) * 100; return (

Who Said It: Putin or Zelensky?

{gameState !== 'finished' && (
Score: {score}/{shuffledQuotes.length}
)}
{gameState === 'playing' && (

"{currentQuote.text}"

)} {gameState === 'feedback' && (

"{currentQuote.text}"

{selectedAnswer === currentQuote.author ? (
Correct!
) : (
Incorrect!
)}

This was said by: {currentQuote.author}

{currentQuote.context}

)} {gameState === 'finished' && (

Game Complete!

Your score: {score} out of {shuffledQuotes.length}

{score === shuffledQuotes.length && (

Perfect score! You're a political quote expert!

)} {score >= shuffledQuotes.length * 0.7 && score < shuffledQuotes.length && (

Great job! You know your political statements well!

)} {score >= shuffledQuotes.length * 0.4 && score < shuffledQuotes.length * 0.7 && (

Not bad! You have a decent knowledge of political rhetoric.

)} {score < shuffledQuotes.length * 0.4 && (

You might want to brush up on your political knowledge!

)}
)}
); }