Files

151 lines
6.4 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<title>__SEO_TITLE__</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#e82517" />
<meta name="application-name" content="Toothless' TSS Bot" />
<style>
html { background: #130d08; }
html[data-theme="dark"] { background: #130d08; color-scheme: dark; }
html[data-theme="dark"] body,
html[data-theme="dark"] #root { background: #130d08; }
html[data-theme="light"] { background: #fefde7; color-scheme: light; }
html[data-theme="light"] body,
html[data-theme="light"] #root { background: #fefde7; }
</style>
<script>
(() => {
const cookies = Object.fromEntries(
document.cookie.split('; ').filter(Boolean).map((item) => {
const separator = item.indexOf('=')
const key = separator === -1 ? item : item.slice(0, separator)
const value = separator === -1 ? '' : item.slice(separator + 1)
try {
return [decodeURIComponent(key), decodeURIComponent(value)]
} catch {
return [key, value]
}
}),
)
let theme = cookies['tssbot_theme']
if (!theme) {
try {
theme = localStorage.getItem('tssbot.theme')
} catch {}
}
theme = theme === 'light' ? 'light' : 'dark'
const bg = theme === 'dark' ? '#130d08' : '#fefde7'
document.documentElement.dataset.theme = theme
document.documentElement.style.backgroundColor = bg
document.documentElement.style.colorScheme = theme
const customColor = cookies['tssbot_custom_color'] || localStorage.getItem('tssbot.customColor')
if (customColor && /^#[0-9a-fA-F]{6}$/.test(customColor)) {
document.documentElement.style.setProperty('--color-fury-cyan', customColor)
document.documentElement.style.setProperty('--color-ring', customColor)
const bigint = parseInt(customColor.replace('#', ''), 16)
const r = (bigint >> 16) & 255
const g = (bigint >> 8) & 255
const b = bigint & 255
document.documentElement.style.setProperty('--color-shadow', 'rgba(' + r + ', ' + g + ', ' + b + ', ' + (theme === 'dark' ? '0.18' : '0.12') + ')')
const adjust = (val, percent) => percent > 0
? Math.max(0, Math.min(255, Math.round(val + (255 - val) * percent)))
: Math.max(0, Math.min(255, Math.round(val * (1 + percent))))
const formatHex = (nr, ng, nb) => '#' + ((1 << 24) + (nr << 16) + (ng << 8) + nb).toString(16).slice(1)
const aquaColor = formatHex(adjust(r, 0.2), adjust(g, 0.2), adjust(b, 0.2))
const violetColor = formatHex(adjust(r, -0.2), adjust(g, -0.2), adjust(b, -0.2))
document.documentElement.style.setProperty('--color-fury-aqua', aquaColor)
document.documentElement.style.setProperty('--color-fury-violet', violetColor)
}
document.querySelector('meta[name="theme-color"]')?.setAttribute(
'content',
customColor && /^#[0-9a-fA-F]{6}$/.test(customColor)
? customColor
: (theme === 'dark' ? '#101211' : '#e82517')
)
try {
const rawColors = cookies['tssbot_custom_colors'] || localStorage.getItem('tssbot.customColors')
if (rawColors) {
const colors = JSON.parse(rawColors)
const cssVarMap = { bg: '--color-bg', surface: '--color-surface', text: '--color-text', border: '--color-border', textSoft: '--color-text-soft', textMuted: '--color-text-muted' }
for (const [field, cssVar] of Object.entries(cssVarMap)) {
if (colors[field] && /^#[0-9a-fA-F]{6}$/.test(colors[field])) {
document.documentElement.style.setProperty(cssVar, colors[field])
if (field === 'bg') document.documentElement.style.backgroundColor = colors[field]
}
}
}
} catch {}
let analyticsPreferences = null
const serializedPreferences = cookies['tssbot_analytics_preferences']
try {
analyticsPreferences = JSON.parse(
serializedPreferences || localStorage.getItem('tssbot.analyticsPreferences') || 'null',
)
} catch {}
window.__TSS_BOOT_PREFERENCES__ = { analyticsPreferences, theme }
})()
</script>
<meta name="tss-turnstile-session" content="__TURNSTILE_SESSION__" />
<meta
name="description"
content="__SEO_DESCRIPTION__"
/>
<meta
name="keywords"
content="War Thunder TSS, Tournament Service, TSS leaderboard, TSS teams, TSS battle logs, War Thunder tournaments, Toothless TSS Bot"
/>
<meta name="author" content="Toothless' TSS Bot" />
<meta name="robots" content="__SEO_ROBOTS__" />
<link rel="canonical" href="__SEO_CANONICAL__" />
<meta property="og:site_name" content="Toothless' TSS Bot" />
<meta property="og:locale" content="en_GB" />
<meta property="og:type" content="__SEO_OG_TYPE__" />
<meta property="og:url" content="__SEO_CANONICAL__" />
<meta property="og:title" content="__SEO_TITLE__" />
<meta
property="og:description"
content="__SEO_DESCRIPTION__"
/>
<meta property="og:image" content="__SEO_IMAGE__" />
<meta property="og:image:secure_url" content="__SEO_IMAGE__" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="Toothless' TSS Bot War Thunder TSS dashboard" />
<meta property="article:author" content="__SEO_AUTHOR__" />
<meta property="article:published_time" content="__SEO_PUBLISHED_TIME__" />
<meta property="article:modified_time" content="__SEO_MODIFIED_TIME__" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="__SEO_TITLE__" />
<meta
name="twitter:description"
content="__SEO_DESCRIPTION__"
/>
<meta name="twitter:image" content="__SEO_IMAGE__" />
<link rel="icon" type="image/svg+xml" href="/embed-icon.svg" />
<link rel="apple-touch-icon" href="/embed-icon.svg" />
<script type="application/ld+json" id="site-structured-data">
__SEO_JSON_LD__
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>