Files
scrapyard-cogworks/ttstoy/webui/templates/base.html
T
2026-06-05 16:41:55 -05:00

248 lines
16 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}TtsToy{% endblock %}</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #060d1a; color: #c8daf0; font-family: 'Segoe UI', Tahoma, Geneva, sans-serif; min-height: 100vh; }
canvas#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.rain-layer { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.rain-layer.far { filter: blur(10px); opacity: 0.45; }
.rain-layer.mid { filter: blur(4px); opacity: 0.65; }
.rain-layer.near { filter: blur(1px); opacity: 0.85; }
.spark-layer { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.frost-pane { position: fixed; inset: 0; z-index: 2; background: rgba(6,13,26,0.25); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); pointer-events: none; }
nav, .container { position: relative; z-index: 3; }
a { color: rgba(80,160,255,0.7); text-decoration: none; }
a:hover { color: rgba(120,190,255,0.9); text-decoration: underline; }
.glass {
background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 45%, rgba(0,0,0,0.03) 55%, rgba(0,0,0,0.08) 100%);
border: 1px solid rgba(255,255,255,0.15);
box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.10);
backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
border-radius: 6px;
}
nav {
background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 45%, rgba(0,0,0,0.03) 55%, rgba(0,0,0,0.08) 100%);
border-bottom: 1px solid rgba(255,255,255,0.10);
backdrop-filter: blur(14px);
padding: 0 1.5rem;
display: flex; align-items: center; gap: 0.25rem; height: 48px;
box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
}
nav .brand { font-weight: 200; font-size: 1rem; color: #e0ecff; margin-right: auto; letter-spacing: 3px; text-shadow: 0 0 16px rgba(80,150,255,0.2); }
nav a.nav-link { color: rgba(200,220,255,0.5); padding: 0.3rem 0.75rem; border-radius: 3px; font-size: 0.85rem; border: 1px solid transparent; transition: all 0.12s; font-weight: 400; }
nav a.nav-link:hover { background: rgba(255,255,255,0.06); color: rgba(200,220,255,0.8); text-decoration: none; border-color: rgba(255,255,255,0.08); }
nav a.nav-link.active { background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 45%, rgba(0,0,0,0.03) 55%, rgba(0,0,0,0.06) 100%); color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.15); }
nav .user-chip { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: rgba(140,180,230,0.5); margin-left: 0.5rem; }
nav .user-chip img { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); }
nav .user-chip a { color: rgba(140,180,230,0.4); font-size: 0.75rem; }
nav .user-chip a:hover { color: rgba(255,140,140,0.8); }
.container { max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem; }
.card {
background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 45%, rgba(0,0,0,0.03) 55%, rgba(0,0,0,0.08) 100%);
border: 1px solid rgba(255,255,255,0.15);
box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.10);
backdrop-filter: blur(14px); border-radius: 6px; padding: 1.25rem; margin-bottom: 1.25rem;
}
.card h2 { font-size: 0.85rem; font-weight: 300; color: #e0ecff; margin-bottom: 0.9rem; text-shadow: 0 0 16px rgba(80,150,255,0.2); text-transform: uppercase; letter-spacing: 2px; }
label { display: block; font-size: 0.8rem; color: rgba(200,220,255,0.6); margin-bottom: 0.3rem; font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=file], textarea, select {
width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); color: #c8daf0;
padding: 0.45rem 0.7rem; border-radius: 3px; font-size: 0.85rem; outline: none;
box-shadow: inset 0 1px 3px rgba(0,0,0,0.3); font-family: inherit;
}
input:focus, textarea:focus, select:focus { border-color: rgba(255,255,255,0.25); box-shadow: inset 0 1px 3px rgba(0,0,0,0.3), 0 0 6px rgba(80,150,240,0.2); }
input[type=range] { background: none; border: none; box-shadow: none; padding: 0; accent-color: rgba(80,160,255,0.7); }
textarea { resize: vertical; min-height: 72px; }
.form-group { margin-bottom: 0.9rem; }
select option { background: #0a1220; }
.btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 1rem; border-radius: 3px; cursor: pointer; font-size: 0.85rem; font-weight: 500; letter-spacing: 0.5px; transition: background 0.2s, border-color 0.2s, box-shadow 0.2s; border: none; }
.btn-primary { background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.06) 45%, rgba(0,0,0,0.04) 55%, rgba(0,0,0,0.10) 100%); color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.15); backdrop-filter: blur(14px); box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.10); }
.btn-primary:hover { background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.10) 45%, rgba(0,0,0,0.02) 55%, rgba(0,0,0,0.08) 100%); border-color: rgba(255,255,255,0.25); box-shadow: 0 3px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.15); }
.btn-secondary { background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 45%, rgba(0,0,0,0.03) 55%, rgba(0,0,0,0.06) 100%); color: rgba(200,220,255,0.6); border: 1px solid rgba(255,255,255,0.10); }
.btn-secondary:hover { background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.06) 45%, rgba(0,0,0,0.02) 55%, rgba(0,0,0,0.05) 100%); color: rgba(200,220,255,0.8); border-color: rgba(255,255,255,0.15); }
.btn-danger { background: linear-gradient(180deg, rgba(255,100,100,0.20) 0%, rgba(200,60,60,0.10) 45%, rgba(140,30,30,0.08) 55%, rgba(100,20,20,0.12) 100%); color: rgba(255,200,200,0.8); border: 1px solid rgba(255,100,100,0.20); }
.btn-danger:hover { background: linear-gradient(180deg, rgba(255,100,100,0.30) 0%, rgba(200,60,60,0.15) 45%, rgba(140,30,30,0.10) 55%, rgba(100,20,20,0.15) 100%); border-color: rgba(255,100,100,0.30); }
.btn-sm { padding: 0.28rem 0.65rem; font-size: 0.78rem; }
.alert { padding: 0.65rem 0.9rem; border-radius: 4px; margin-bottom: 0.9rem; font-size: 0.85rem; }
.alert-error { background: rgba(255,80,80,0.08); border: 1px solid rgba(255,80,80,0.15); color: #ff8888; }
.alert-success { background: rgba(80,200,100,0.08); border: 1px solid rgba(80,200,100,0.15); color: #5ab87a; }
.alert-info { background: rgba(80,160,255,0.06); border: 1px solid rgba(80,160,255,0.12); color: rgba(140,200,255,0.8); }
.muted { color: rgba(140,180,230,0.4); font-size: 0.8rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.col { flex: 1; min-width: 180px; }
audio { width: 100%; margin-top: 0.5rem; filter: invert(0.8) hue-rotate(180deg); }
.badge { display: inline-block; padding: 0.15rem 0.45rem; border-radius: 3px; font-size: 0.72rem; font-weight: 500; }
.badge-mode { background: rgba(80,160,255,0.08); color: rgba(140,200,255,0.8); border: 1px solid rgba(80,160,255,0.15); }
.badge-active { background: rgba(80,200,100,0.08); color: #5ab87a; border: 1px solid rgba(80,200,100,0.15); }
.voice-list { list-style: none; }
.voice-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.voice-list li:last-child { border-bottom: none; }
.voice-list .name { flex: 1; font-size: 0.85rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(80,160,255,0.15); border-top-color: rgba(80,160,255,0.7); border-radius: 50%; animation: spin 0.6s linear infinite; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { color: rgba(140,180,230,0.5); text-align: left; padding: 0.35rem 0.5rem; font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
td { padding: 0.4rem 0.5rem; border-top: 1px solid rgba(255,255,255,0.06); color: #c8daf0; }
code { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.10); border-radius: 3px; padding: 0.1rem 0.4rem; font-size: 0.82rem; color: rgba(140,200,255,0.8); }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 2px; }
</style>
{% block head %}{% endblock %}
</head>
<body>
<canvas class="rain-layer far" id="rainFar"></canvas>
<canvas class="rain-layer mid" id="rainMid"></canvas>
<canvas class="rain-layer near" id="rainNear"></canvas>
<canvas class="spark-layer" id="sparkCanvas"></canvas>
<div class="frost-pane"></div>
{% if session.get('user_id') %}
<nav>
<span class="brand">TTSTOY</span>
<a href="{{ url_for('dashboard') }}" class="nav-link {% if request.endpoint == 'dashboard' %}active{% endif %}">Dashboard</a>
<a href="{{ url_for('page_chatterbox') }}" class="nav-link {% if request.endpoint == 'page_chatterbox' %}active{% endif %}">Chatterbox</a>
<a href="{{ url_for('page_minimax') }}" class="nav-link {% if request.endpoint == 'page_minimax' %}active{% endif %}">MiniMax</a>
<a href="{{ url_for('page_dectalk') }}" class="nav-link {% if request.endpoint == 'page_dectalk' %}active{% endif %}">DECTalk</a>
<a href="{{ url_for('page_vox') }}" class="nav-link {% if request.endpoint == 'page_vox' %}active{% endif %}">VOX</a>
{% if session.get('is_owner') %}
<a href="{{ url_for('page_sfx') }}" class="nav-link {% if request.endpoint == 'page_sfx' %}active{% endif %}">SFX</a>
{% endif %}
<a href="{{ url_for('page_profile') }}" class="nav-link {% if request.endpoint == 'page_profile' %}active{% endif %}">Profile</a>
<div class="user-chip">
{% if session.get('avatar_url') %}<img src="{{ session.avatar_url }}" alt="">{% endif %}
<span>{{ session.get('discord_name', '') }}</span>
<a href="{{ url_for('logout') }}">logout</a>
</div>
</nav>
{% endif %}
<div class="container">
{% with messages = get_flashed_messages(with_categories=true) %}
{% for cat, msg in messages %}
<div class="alert alert-{{ cat }}">{{ msg }}</div>
{% endfor %}
{% endwith %}
{% block content %}{% endblock %}
</div>
<script>
/* Rain effect — depth layers behind the frost pane */
(function() {
const layerConfigs = [
{ id: 'rainFar', count: 70, sMin: 2, sMax: 4, lMin: 25, lMax: 50, wMin: 1.5, wMax: 3.0, aMin: 0.25, aMax: 0.50, wind: 0.2 },
{ id: 'rainMid', count: 50, sMin: 4, sMax: 8, lMin: 18, lMax: 40, wMin: 1.2, wMax: 2.5, aMin: 0.30, aMax: 0.55, wind: 0.5 },
{ id: 'rainNear', count: 35, sMin: 8, sMax: 14, lMin: 14, lMax: 35, wMin: 1.0, wMax: 2.0, aMin: 0.35, aMax: 0.60, wind: 0.8 },
];
const depthLayers = layerConfigs.map(cfg => {
const c = document.getElementById(cfg.id);
const ctx = c.getContext('2d');
return { c, ctx, cfg, drops: [] };
});
let W, H;
function makeDepthDrop(cfg, startTop) {
return {
x: Math.random() * (W + 80) - 40,
y: startTop ? -(Math.random() * H * 0.5 + 20) : Math.random() * H,
speed: cfg.sMin + Math.random() * (cfg.sMax - cfg.sMin),
len: cfg.lMin + Math.random() * (cfg.lMax - cfg.lMin),
width: cfg.wMin + Math.random() * (cfg.wMax - cfg.wMin),
alpha: cfg.aMin + Math.random() * (cfg.aMax - cfg.aMin),
wind: cfg.wind + (Math.random() - 0.5) * 0.25,
};
}
function resize() {
W = window.innerWidth; H = window.innerHeight;
for (const layer of depthLayers) {
layer.c.width = W; layer.c.height = H;
layer.drops = [];
for (let i = 0; i < layer.cfg.count; i++) layer.drops.push(makeDepthDrop(layer.cfg, false));
}
}
function drawDepthLayers() {
for (const layer of depthLayers) {
const { ctx, cfg, drops } = layer;
ctx.clearRect(0, 0, W, H);
for (let i = 0; i < drops.length; i++) {
const d = drops[i];
d.y += d.speed; d.x += d.wind;
if (d.y > H + d.len || d.x > W + 60) { drops[i] = makeDepthDrop(cfg, true); continue; }
const x2 = d.x + d.wind * (d.len / d.speed) * 0.3;
const grad = ctx.createLinearGradient(d.x, d.y - d.len, x2, d.y);
grad.addColorStop(0, 'rgba(160,200,240,0)');
grad.addColorStop(0.5, 'rgba(160,200,240,' + (d.alpha * 0.4) + ')');
grad.addColorStop(1, 'rgba(160,200,240,' + d.alpha + ')');
ctx.beginPath(); ctx.moveTo(d.x, d.y - d.len); ctx.lineTo(x2, d.y);
ctx.strokeStyle = grad; ctx.lineWidth = d.width; ctx.lineCap = 'round'; ctx.stroke();
}
}
}
resize(); window.addEventListener('resize', resize);
(function frame() { drawDepthLayers(); requestAnimationFrame(frame); })();
})();
/* PS2-style sparks — 4 persistent, orbit in/out of view */
(function() {
const canvas = document.getElementById('sparkCanvas');
const ctx = canvas.getContext('2d');
let W, H;
const COLORS = [
{ r: 255, g: 60, b: 60 },
{ r: 60, g: 255, b: 100 },
{ r: 80, g: 140, b: 255 },
{ r: 255, g: 220, b: 60 },
];
function resize() { W = canvas.width = window.innerWidth; H = canvas.height = window.innerHeight; }
resize(); window.addEventListener('resize', resize);
const sparks = COLORS.map((color, i) => {
const phase = i * Math.PI * 0.5;
return { color, cx:0, cy:0, rx:0, ry:0,
speedX: 0.12 + Math.random() * 0.08, speedY: 0.07 + Math.random() * 0.06,
phaseX: phase + Math.random() * 2, phaseY: phase * 1.3 + Math.random() * 2,
trail: [], maxTrail: 35, size: 2.5 + Math.random() * 1.5 };
});
function updateOrbits() {
sparks.forEach((s, i) => { s.cx = W*0.5; s.cy = H*0.5; s.rx = W*(1.2+i*0.15); s.ry = H*(1.0+i*0.12); });
}
updateOrbits(); window.addEventListener('resize', updateOrbits);
function draw() {
ctx.clearRect(0, 0, W, H);
const now = performance.now() / 1000;
for (const s of sparks) {
const x = s.cx + Math.sin(now * s.speedX + s.phaseX) * s.rx;
const y = s.cy + Math.cos(now * s.speedY + s.phaseY) * s.ry;
s.trail.push({ x, y }); if (s.trail.length > s.maxTrail) s.trail.shift();
const margin = 60;
if (!s.trail.some(p => p.x > -margin && p.x < W+margin && p.y > -margin && p.y < H+margin)) continue;
const { r, g, b } = s.color;
if (s.trail.length > 1) {
for (let t = 1; t < s.trail.length; t++) {
const frac = t / s.trail.length;
ctx.beginPath(); ctx.moveTo(s.trail[t-1].x, s.trail[t-1].y); ctx.lineTo(s.trail[t].x, s.trail[t].y);
ctx.strokeStyle = 'rgba('+r+','+g+','+b+','+(frac*0.55)+')';
ctx.lineWidth = s.size * frac; ctx.lineCap = 'round'; ctx.stroke();
}
}
ctx.beginPath(); ctx.arc(x, y, s.size, 0, Math.PI*2);
ctx.fillStyle = 'rgba('+r+','+g+','+b+',0.9)'; ctx.fill();
const glow = ctx.createRadialGradient(x, y, 0, x, y, s.size*6);
glow.addColorStop(0, 'rgba('+r+','+g+','+b+',0.25)');
glow.addColorStop(1, 'rgba('+r+','+g+','+b+',0)');
ctx.beginPath(); ctx.arc(x, y, s.size*6, 0, Math.PI*2);
ctx.fillStyle = glow; ctx.fill();
}
requestAnimationFrame(draw);
}
draw();
})();
</script>
<script>
function apiFetch(url, opts={}) {
return fetch(url, {headers: {'Content-Type': 'application/json'}, ...opts});
}
</script>
{% block scripts %}{% endblock %}
</body>
</html>