eerrrrrr
All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 1m57s

This commit is contained in:
2025-11-27 23:42:17 +00:00
parent 054e970df9
commit 1c98a634c3
50 changed files with 1666 additions and 593 deletions

View File

@@ -1,10 +1,36 @@
{% set accent_cookie = app.request.cookies.get('accentColor') %}
{% set accent_color = (accent_cookie is defined and accent_cookie and accent_cookie matches '/^#[0-9a-fA-F]{6}$/') ? accent_cookie : '#6750a4' %}
<!doctype html>
<html lang="en" data-bs-theme="{{ app.request.cookies.get('theme') ?? 'light' }}">
<html lang="en" data-bs-theme="{{ app.request.cookies.get('theme') ?? 'light' }}" style="--accent-color: {{ accent_color }};">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{% block title %}Music Ratings{% endblock %}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="{{ app.request.basePath }}/css/app.css">
<script>
(function() {
const root = document.documentElement;
const defaultAccent = '{{ accent_color|e('js') }}';
const match = document.cookie.match(/(?:^|; )accentColor=([^;]+)/);
const accent = match ? decodeURIComponent(match[1]) : defaultAccent;
function contrast(hex) {
const normalized = hex.replace('#', '');
if (normalized.length !== 6) {
return '#ffffff';
}
const r = parseInt(normalized.substring(0, 2), 16);
const g = parseInt(normalized.substring(2, 4), 16);
const b = parseInt(normalized.substring(4, 6), 16);
const luminance = (0.299 * r) + (0.587 * g) + (0.114 * b);
return luminance > 180 ? '#1c1b20' : '#ffffff';
}
root.style.setProperty('--accent-color', accent);
root.style.setProperty('--accent-on-color', contrast(accent));
})();
</script>
</head>
<body>
{% include '_partials/navbar.html.twig' %}