Files
cruciverb/frontend/src/embed.tsx
T
2026-01-17 01:32:31 +02:00

19 lines
660 B
TypeScript

import { createRoot } from 'react-dom/client'
import './index.css'
import EmbedPlayer from './components/EmbedPlayer'
const root = document.getElementById('root')
if (root) {
const puzzleId = root.dataset.puzzleId || ''
const theme = root.dataset.theme || ''
const showTimer = root.dataset.timer !== 'false'
const showHints = root.dataset.hints !== 'false'
if (theme === 'dark') document.documentElement.setAttribute('data-theme', 'dark')
else if (theme === 'light') document.documentElement.setAttribute('data-theme', 'light')
createRoot(root).render(
<EmbedPlayer puzzleId={puzzleId} showTimer={showTimer} showHints={showHints} />
)
}