diff --git a/app/special/[name]/page.tsx b/app/special/[name]/page.tsx index 6ecd405..3a62938 100644 --- a/app/special/[name]/page.tsx +++ b/app/special/[name]/page.tsx @@ -62,6 +62,7 @@ export default async function SpecialPage({ params }: PageProps) { diff --git a/components/Game.tsx b/components/Game.tsx index d4bc826..48c00ea 100644 --- a/components/Game.tsx +++ b/components/Game.tsx @@ -17,13 +17,14 @@ interface GameProps { coverImage: string | null; } | null; genre?: string | null; + isSpecial?: boolean; maxAttempts?: number; unlockSteps?: number[]; } const DEFAULT_UNLOCK_STEPS = [2, 4, 7, 11, 16, 30, 60]; -export default function Game({ dailyPuzzle, genre = null, maxAttempts = 7, unlockSteps = DEFAULT_UNLOCK_STEPS }: GameProps) { +export default function Game({ dailyPuzzle, genre = null, isSpecial = false, maxAttempts = 7, unlockSteps = DEFAULT_UNLOCK_STEPS }: GameProps) { const { gameState, statistics, addGuess } = useGameState(genre, maxAttempts); const [hasWon, setHasWon] = useState(false); const [hasLost, setHasLost] = useState(false); @@ -104,7 +105,18 @@ export default function Game({ dailyPuzzle, genre = null, maxAttempts = 7, unloc const speaker = hasWon ? '🔉' : '🔇'; const genreText = genre ? `Genre: ${genre}\n` : ''; - const text = `Hördle #${dailyPuzzle.id}\n${genreText}\n${speaker}${emojiGrid}\n\n#Hördle #Music\n\nhttps://hoerdle.elpatron.me`; + + // Generate URL with genre/special path + let shareUrl = 'https://hoerdle.elpatron.me'; + if (genre) { + if (isSpecial) { + shareUrl += `/special/${encodeURIComponent(genre)}`; + } else { + shareUrl += `/${encodeURIComponent(genre)}`; + } + } + + const text = `Hördle #${dailyPuzzle.id}\n${genreText}\n${speaker}${emojiGrid}\n\n#Hördle #Music\n\n${shareUrl}`; // Fallback method for copying to clipboard const textarea = document.createElement('textarea');