funny sentences christmas

zrób śmieszne zdania i przetłumacz na polski

import React, { useState, useEffect } from ‘react’; import { Dices, Save, Trash2, BookOpen, Star, RefreshCw, Sparkles, Snowflake } from ‘lucide-react’; const SentenceBuilder = () => { // Dane z obrazka const sentenceData = { starts: [ { id: 1, text: “There are” }, { id: 2, text: “I have” }, { id: 3, text: “I can see” }, { id: 4, text: “My friends are” }, { id: 5, text: “I’m eating” }, { id: 6, text: “I love” } ], adjectives: [ { id: 1, text: “tiny” }, { id: 2, text: “colourful” }, { id: 3, text: “delicious” }, { id: 4, text: “magical” }, { id: 5, text: “glowing” }, { id: 6, text: “frozen” } ], nouns: [ { id: 1, text: “dumplings” }, { id: 2, text: “stockings” }, { id: 3, text: “elves” }, { id: 4, text: “reindeer” }, { id: 5, text: “gingerbread cookies” }, { id: 6, text: “Santas” } ], places: [ { id: 1, text: “on the roof” }, { id: 2, text: “by the fireplace” }, { id: 3, text: “under the Christmas tree” }, { id: 4, text: “inside the box” }, { id: 5, text: “in the snow” }, { id: 6, text: “on the sleigh” } ] }; const [mode, setMode] = useState(‘manual’); // ‘manual’ or ‘dice’ const [currentSentence, setCurrentSentence] = useState({ start: null, adjective: null, noun: null, place: null }); const [savedSentences, setSavedSentences] = useState([]); const [diceRolling, setDiceRolling] = useState(null); // ‘start’, ‘adjective’, ‘noun’, ‘place’ or null const [diceResult, setDiceResult] = useState(1); // Funkcja do wyboru elementu const selectPart = (partType, item) => { setCurrentSentence(prev => ({ …prev, [partType]: item })); }; // Funkcja rzutu kostką const rollDice = (partType) => { setDiceRolling(partType); let counter = 0; const interval = setInterval(() => { setDiceResult(Math.ceil(Math.random() * 6)); counter++; if (counter > 10) { clearInterval(interval); const finalRoll = Math.ceil(Math.random() * 6); setDiceResult(finalRoll); setDiceRolling(null); // Znajdź odpowiednie słowo dla wyniku rzutu let collection; switch(partType) { case ‘start’: collection = sentenceData.starts; break; case ‘adjective’: collection = sentenceData.adjectives; break; case ‘noun’: collection = sentenceData.nouns; break; case ‘place’: collection = sentenceData.places; break; default: collection = []; } const selectedItem = collection.find(item => item.id === finalRoll); selectPart(partType, selectedItem); } }, 100); }; const saveSentence = () => { if (isSentenceComplete()) { setSavedSentences([currentSentence, …savedSentences]); setCurrentSentence({ start: null, adjective: null, noun: null, place: null }); } }; const isSentenceComplete = () => { return currentSentence.start && currentSentence.adjective && currentSentence.noun && currentSentence.place; }; const getFullSentenceText = (s) => { if (!s.start) return “”; return `${s.start.text} ${s.adjective.text} ${s.noun.text} ${s.place.text}.`; }; const clearHistory = () => { setSavedSentences([]); }; return (
{/* Header */}

Christmas Sentence Builder

Ułóż świąteczne zdanie po angielsku!

{/* Mode Switcher */}
{/* Active Sentence Display */}
Twoje Zdanie
{currentSentence.start ? currentSentence.start.text : “Start…”} {currentSentence.adjective ? currentSentence.adjective.text : “Adjective…”} {currentSentence.noun ? currentSentence.noun.text : “Noun…”} {currentSentence.place ? currentSentence.place.text : “Place…”}
{/* Builder Area */}
{/* Column 1: Start */} selectPart(‘start’, item)} mode={mode} onRoll={() => rollDice(‘start’)} isRolling={diceRolling === ‘start’} diceResult={diceResult} /> {/* Column 2: Adjective */} selectPart(‘adjective’, item)} mode={mode} onRoll={() => rollDice(‘adjective’)} isRolling={diceRolling === ‘adjective’} diceResult={diceResult} /> {/* Column 3: Noun */} selectPart(‘noun’, item)} mode={mode} onRoll={() => rollDice(‘noun’)} isRolling={diceRolling === ‘noun’} diceResult={diceResult} /> {/* Column 4: Place */} selectPart(‘place’, item)} mode={mode} onRoll={() => rollDice(‘place’)} isRolling={diceRolling === ‘place’} diceResult={diceResult} />
{/* Saved Sentences */} {savedSentences.length > 0 && (

Moje Świąteczne Opowieści ({savedSentences.length})

{savedSentences.map((s, idx) => (
{savedSentences.length – idx}

{getFullSentenceText(s)}

))}
)}
); }; // Helper Component for Columns const Column = ({ title, color, items, selectedId, onSelect, mode, onRoll, isRolling, diceResult }) => { const colorClasses = { blue: “bg-blue-50 border-blue-200 text-blue-800 hover:bg-blue-100 ring-blue-300”, purple: “bg-purple-50 border-purple-200 text-purple-800 hover:bg-purple-100 ring-purple-300”, orange: “bg-orange-50 border-orange-200 text-orange-800 hover:bg-orange-100 ring-orange-300”, green: “bg-green-50 border-green-200 text-green-800 hover:bg-green-100 ring-green-300”, }; const headerColors = { blue: “bg-blue-500”, purple: “bg-purple-500”, orange: “bg-orange-500”, green: “bg-green-500”, }; return (
{title} {mode === ‘dice’ && (
)}
{mode === ‘dice’ && (
{isRolling && (
{diceResult}
)}
)} {items.map((item) => { const isSelected = selectedId === item.id; const isDiceMatch = mode === ‘dice’ && isRolling && diceResult === item.id; return ( ) })}
); }; export default SentenceBuilder;