Karan Adhikari commited on
Refactor base.html to use theme variables
Browse files- Backend/fastapi/templates/base.html +82 -135
Backend/fastapi/templates/base.html
CHANGED
|
@@ -17,21 +17,10 @@
|
|
| 17 |
primary: '{{ theme.colors.primary }}',
|
| 18 |
secondary: '{{ theme.colors.secondary }}',
|
| 19 |
accent: '{{ theme.colors.accent }}',
|
| 20 |
-
background: '
|
| 21 |
-
card: '
|
| 22 |
-
text: '
|
| 23 |
-
'text-secondary': '
|
| 24 |
-
},
|
| 25 |
-
animation: {
|
| 26 |
-
'blob': 'blob 7s infinite',
|
| 27 |
-
},
|
| 28 |
-
keyframes: {
|
| 29 |
-
blob: {
|
| 30 |
-
'0%': { transform: 'translate(0px, 0px) scale(1)' },
|
| 31 |
-
'33%': { transform: 'translate(30px, -50px) scale(1.1)' },
|
| 32 |
-
'66%': { transform: 'translate(-20px, 20px) scale(0.9)' },
|
| 33 |
-
'100%': { transform: 'translate(0px, 0px) scale(1)' },
|
| 34 |
-
}
|
| 35 |
}
|
| 36 |
}
|
| 37 |
}
|
|
@@ -40,98 +29,65 @@
|
|
| 40 |
|
| 41 |
<style>
|
| 42 |
body {
|
| 43 |
-
background-color: theme
|
| 44 |
-
color: theme
|
| 45 |
-
/* Smooth dark gradient base */
|
| 46 |
-
background-image: radial-gradient(at 0% 0%, rgba(30, 27, 75, 0.8) 0px, transparent 50%),
|
| 47 |
-
radial-gradient(at 100% 0%, rgba(15, 23, 42, 0.8) 0px, transparent 50%);
|
| 48 |
-
background-attachment: fixed;
|
| 49 |
}
|
| 50 |
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
background: rgba(255, 255, 255, 0.03);
|
| 54 |
-
backdrop-filter: blur(16px);
|
| 55 |
-
-webkit-backdrop-filter: blur(16px);
|
| 56 |
-
border: 1px solid rgba(255, 255, 255, 0.05);
|
| 57 |
-
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
|
| 58 |
-
}
|
| 59 |
-
|
| 60 |
-
.glass-input {
|
| 61 |
-
background: rgba(0, 0, 0, 0.2);
|
| 62 |
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
| 63 |
-
color: white;
|
| 64 |
-
transition: all 0.3s ease;
|
| 65 |
-
}
|
| 66 |
-
|
| 67 |
-
.glass-input:focus {
|
| 68 |
-
background: rgba(0, 0, 0, 0.3);
|
| 69 |
-
border-color: rgba(139, 92, 246, 0.5); /* Purple focus */
|
| 70 |
-
outline: none;
|
| 71 |
-
box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
|
| 72 |
}
|
| 73 |
|
| 74 |
.active-link {
|
| 75 |
-
background:
|
| 76 |
-
|
| 77 |
-
color: white;
|
| 78 |
}
|
| 79 |
-
|
| 80 |
-
/* Custom Scrollbar */
|
| 81 |
-
::-webkit-scrollbar { width: 8px; height: 8px; }
|
| 82 |
-
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
|
| 83 |
-
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
|
| 84 |
-
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
|
| 85 |
</style>
|
| 86 |
</head>
|
| 87 |
|
| 88 |
-
<body class="min-h-screen flex flex-col
|
| 89 |
-
|
| 90 |
-
<div class="fixed inset-0 w-full h-full pointer-events-none z-[-1] overflow-hidden">
|
| 91 |
-
<div class="absolute top-0 -left-4 w-72 h-72 bg-purple-500 rounded-full mix-blend-multiply filter blur-[128px] opacity-20 animate-blob"></div>
|
| 92 |
-
<div class="absolute top-0 -right-4 w-72 h-72 bg-blue-500 rounded-full mix-blend-multiply filter blur-[128px] opacity-20 animate-blob animation-delay-2000"></div>
|
| 93 |
-
<div class="absolute -bottom-8 left-20 w-72 h-72 bg-indigo-500 rounded-full mix-blend-multiply filter blur-[128px] opacity-20 animate-blob animation-delay-4000"></div>
|
| 94 |
-
</div>
|
| 95 |
|
| 96 |
-
<
|
|
|
|
| 97 |
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 98 |
-
<div class="flex justify-between items-center h-
|
| 99 |
|
| 100 |
-
<
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
TG Stremio
|
| 106 |
</h1>
|
| 107 |
|
| 108 |
{% if current_user %}
|
| 109 |
-
<div class="hidden
|
| 110 |
<a href="/" class="nav-link {% if request.url.path == '/' %}active-link{% endif %}">
|
| 111 |
-
<i class="fas fa-home
|
| 112 |
</a>
|
| 113 |
<a href="/media/manage" class="nav-link {% if '/media' in request.url.path %}active-link{% endif %}">
|
| 114 |
-
<i class="fas fa-photo-film
|
| 115 |
</a>
|
| 116 |
<a href="/admin/dashboard" class="nav-link {% if '/admin/dashboard' in request.url.path %}active-link{% endif %}">
|
| 117 |
-
<i class="fas fa-chart-line
|
| 118 |
</a>
|
| 119 |
<a href="/admin/subscriptions" class="nav-link {% if '/subscriptions' in request.url.path %}active-link{% endif %}">
|
| 120 |
-
<i class="fas fa-credit-card
|
| 121 |
</a>
|
| 122 |
<a href="/admin/access" class="nav-link {% if '/access' in request.url.path %}active-link{% endif %}">
|
| 123 |
-
<i class="fas fa-user-shield
|
| 124 |
</a>
|
| 125 |
</div>
|
| 126 |
{% endif %}
|
| 127 |
</div>
|
| 128 |
|
| 129 |
-
<
|
| 130 |
-
|
|
|
|
|
|
|
|
|
|
| 131 |
<select name="theme" onchange="this.form.submit()"
|
| 132 |
-
class="
|
| 133 |
{% for theme_key, theme_data in themes.items() %}
|
| 134 |
-
<option value="{{ theme_key }}" {% if current_theme==theme_key %}selected{% endif %}
|
| 135 |
{{ theme_data.name }}
|
| 136 |
</option>
|
| 137 |
{% endfor %}
|
|
@@ -139,124 +95,114 @@
|
|
| 139 |
</form>
|
| 140 |
|
| 141 |
{% if current_user %}
|
|
|
|
| 142 |
<div class="relative">
|
| 143 |
-
<button id="profile-btn" class="flex items-center gap-
|
| 144 |
-
<
|
| 145 |
-
|
| 146 |
-
</
|
| 147 |
-
<span class="hidden sm:block font-medium text-gray-200">{{ current_user }}</span>
|
| 148 |
-
<i class="fas fa-chevron-down text-xs text-gray-400"></i>
|
| 149 |
</button>
|
| 150 |
|
| 151 |
-
<div id="profile-menu" class="hidden absolute right-0 mt-
|
| 152 |
-
<
|
| 153 |
-
<p class="text-xs text-gray-400">Logged in as</p>
|
| 154 |
-
<p class="text-sm font-semibold truncate">{{ current_user }}</p>
|
| 155 |
-
</div>
|
| 156 |
-
<a href="/logout" class="dropdown-link text-red-400 hover:text-red-300 hover:bg-red-500/10 flex items-center gap-2">
|
| 157 |
-
<i class="fas fa-sign-out-alt"></i> Logout
|
| 158 |
-
</a>
|
| 159 |
</div>
|
| 160 |
</div>
|
| 161 |
{% else %}
|
| 162 |
<a href="/login"
|
| 163 |
-
class="bg-
|
| 164 |
Login
|
| 165 |
</a>
|
| 166 |
{% endif %}
|
| 167 |
|
| 168 |
-
<
|
|
|
|
| 169 |
<i class="fas fa-bars"></i>
|
| 170 |
</button>
|
| 171 |
</div>
|
| 172 |
</div>
|
| 173 |
</div>
|
| 174 |
|
|
|
|
| 175 |
{% if current_user %}
|
| 176 |
-
<div id="mobile-menu" class="hidden
|
| 177 |
-
<div class="flex flex-col gap-
|
| 178 |
-
<a href="/" class="mobile-link">
|
| 179 |
-
<a href="/media/manage" class="mobile-link">
|
| 180 |
-
<a href="/admin/dashboard" class="mobile-link">
|
| 181 |
-
<a href="/admin/subscriptions" class="mobile-link">
|
| 182 |
-
<a href="/admin/access" class="mobile-link">
|
| 183 |
</div>
|
| 184 |
</div>
|
| 185 |
{% endif %}
|
| 186 |
</nav>
|
| 187 |
|
| 188 |
-
<
|
|
|
|
| 189 |
{% block content %}{% endblock %}
|
| 190 |
</main>
|
| 191 |
|
| 192 |
-
<
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
</
|
| 199 |
-
<p class="text-gray-400 text-sm font-medium">© 2026 Telegram Stremio. All rights reserved.</p>
|
| 200 |
-
</div>
|
| 201 |
-
<div class="flex gap-6">
|
| 202 |
-
<a href="/status" class="footer-link">System Status</a>
|
| 203 |
<a href="/stremio" class="footer-link">Stremio Guide</a>
|
| 204 |
</div>
|
| 205 |
</div>
|
| 206 |
</div>
|
| 207 |
</footer>
|
| 208 |
|
|
|
|
| 209 |
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
.nav-link {
|
| 211 |
display: flex;
|
| 212 |
align-items: center;
|
| 213 |
-
gap:
|
| 214 |
-
padding:
|
| 215 |
-
border-radius:
|
| 216 |
font-size: 14px;
|
| 217 |
-
|
| 218 |
-
color: #94a3b8;
|
| 219 |
-
transition: all 0.2s ease;
|
| 220 |
}
|
| 221 |
|
| 222 |
.nav-link:hover {
|
| 223 |
-
color: white;
|
| 224 |
background-color: rgba(255,255,255,0.05);
|
|
|
|
| 225 |
}
|
| 226 |
|
| 227 |
.mobile-link {
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
border-radius: 12px;
|
| 232 |
-
font-size: 15px;
|
| 233 |
-
font-weight: 500;
|
| 234 |
-
color: #e2e8f0;
|
| 235 |
-
transition: 0.2s;
|
| 236 |
}
|
| 237 |
|
| 238 |
.mobile-link:hover {
|
| 239 |
-
background-color: rgba(255,255,255,0.
|
| 240 |
-
color: white;
|
| 241 |
}
|
| 242 |
|
| 243 |
.dropdown-link {
|
| 244 |
display: block;
|
| 245 |
-
padding:
|
| 246 |
font-size: 14px;
|
| 247 |
-
|
| 248 |
-
|
|
|
|
|
|
|
| 249 |
}
|
| 250 |
|
| 251 |
.footer-link {
|
| 252 |
font-size: 14px;
|
| 253 |
-
color: #94a3b8;
|
| 254 |
-
font-weight: 500;
|
| 255 |
transition: 0.2s;
|
| 256 |
}
|
| 257 |
|
| 258 |
.footer-link:hover {
|
| 259 |
-
color:
|
| 260 |
}
|
| 261 |
|
| 262 |
@keyframes slideDown {
|
|
@@ -265,10 +211,11 @@
|
|
| 265 |
}
|
| 266 |
|
| 267 |
.animate-slideDown {
|
| 268 |
-
animation: slideDown 0.
|
| 269 |
}
|
| 270 |
</style>
|
| 271 |
|
|
|
|
| 272 |
<script>
|
| 273 |
const btn = document.getElementById('menu-btn');
|
| 274 |
const menu = document.getElementById('mobile-menu');
|
|
|
|
| 17 |
primary: '{{ theme.colors.primary }}',
|
| 18 |
secondary: '{{ theme.colors.secondary }}',
|
| 19 |
accent: '{{ theme.colors.accent }}',
|
| 20 |
+
background: '{{ theme.colors.background }}',
|
| 21 |
+
card: '{{ theme.colors.card }}',
|
| 22 |
+
text: '{{ theme.colors.text }}',
|
| 23 |
+
'text-secondary': '{{ theme.colors.text_secondary }}'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
}
|
| 25 |
}
|
| 26 |
}
|
|
|
|
| 29 |
|
| 30 |
<style>
|
| 31 |
body {
|
| 32 |
+
background-color: {{ theme.colors.background }};
|
| 33 |
+
color: {{ theme.colors.text }};
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
}
|
| 35 |
|
| 36 |
+
.theme-card {
|
| 37 |
+
background-color: {{ theme.colors.card }};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
}
|
| 39 |
|
| 40 |
.active-link {
|
| 41 |
+
background-color: rgba(255,255,255,0.08);
|
| 42 |
+
color: var(--tw-color-primary);
|
|
|
|
| 43 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
</style>
|
| 45 |
</head>
|
| 46 |
|
| 47 |
+
<body class="min-h-screen flex flex-col">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
<!-- NAVBAR -->
|
| 50 |
+
<nav class="theme-card border-b shadow-sm sticky top-0 z-50 backdrop-blur">
|
| 51 |
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 52 |
+
<div class="flex justify-between items-center h-16">
|
| 53 |
|
| 54 |
+
<!-- LEFT -->
|
| 55 |
+
<div class="flex items-center gap-6">
|
| 56 |
+
<h1 class="text-xl md:text-2xl font-bold text-primary flex items-center gap-2">
|
| 57 |
+
<i class="fas fa-paper-plane"></i>
|
| 58 |
+
Telegram Stremio
|
|
|
|
| 59 |
</h1>
|
| 60 |
|
| 61 |
{% if current_user %}
|
| 62 |
+
<div class="hidden md:flex items-center gap-2">
|
| 63 |
<a href="/" class="nav-link {% if request.url.path == '/' %}active-link{% endif %}">
|
| 64 |
+
<i class="fas fa-home"></i> Dashboard
|
| 65 |
</a>
|
| 66 |
<a href="/media/manage" class="nav-link {% if '/media' in request.url.path %}active-link{% endif %}">
|
| 67 |
+
<i class="fas fa-photo-film"></i> Media
|
| 68 |
</a>
|
| 69 |
<a href="/admin/dashboard" class="nav-link {% if '/admin/dashboard' in request.url.path %}active-link{% endif %}">
|
| 70 |
+
<i class="fas fa-chart-line"></i> Admin
|
| 71 |
</a>
|
| 72 |
<a href="/admin/subscriptions" class="nav-link {% if '/subscriptions' in request.url.path %}active-link{% endif %}">
|
| 73 |
+
<i class="fas fa-credit-card"></i> Subscriptions
|
| 74 |
</a>
|
| 75 |
<a href="/admin/access" class="nav-link {% if '/access' in request.url.path %}active-link{% endif %}">
|
| 76 |
+
<i class="fas fa-user-shield"></i> Access
|
| 77 |
</a>
|
| 78 |
</div>
|
| 79 |
{% endif %}
|
| 80 |
</div>
|
| 81 |
|
| 82 |
+
<!-- RIGHT -->
|
| 83 |
+
<div class="flex items-center gap-3 relative">
|
| 84 |
+
|
| 85 |
+
<!-- THEME -->
|
| 86 |
+
<form method="post" action="/set-theme" id="theme-form">
|
| 87 |
<select name="theme" onchange="this.form.submit()"
|
| 88 |
+
class="theme-card border rounded-md px-2 py-1 text-sm">
|
| 89 |
{% for theme_key, theme_data in themes.items() %}
|
| 90 |
+
<option value="{{ theme_key }}" {% if current_theme==theme_key %}selected{% endif %}>
|
| 91 |
{{ theme_data.name }}
|
| 92 |
</option>
|
| 93 |
{% endfor %}
|
|
|
|
| 95 |
</form>
|
| 96 |
|
| 97 |
{% if current_user %}
|
| 98 |
+
<!-- PROFILE DROPDOWN -->
|
| 99 |
<div class="relative">
|
| 100 |
+
<button id="profile-btn" class="flex items-center gap-2 text-sm">
|
| 101 |
+
<i class="fas fa-user-circle text-lg"></i>
|
| 102 |
+
<span class="hidden sm:block">{{ current_user }}</span>
|
| 103 |
+
<i class="fas fa-chevron-down text-xs"></i>
|
|
|
|
|
|
|
| 104 |
</button>
|
| 105 |
|
| 106 |
+
<div id="profile-menu" class="hidden absolute right-0 mt-2 w-40 theme-card border rounded-lg shadow-lg py-2">
|
| 107 |
+
<a href="/logout" class="dropdown-link text-red-500">Logout</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
</div>
|
| 109 |
</div>
|
| 110 |
{% else %}
|
| 111 |
<a href="/login"
|
| 112 |
+
class="bg-blue-600 text-white px-3 py-1.5 rounded-md hover:bg-blue-700 text-sm transition">
|
| 113 |
Login
|
| 114 |
</a>
|
| 115 |
{% endif %}
|
| 116 |
|
| 117 |
+
<!-- MOBILE BUTTON -->
|
| 118 |
+
<button id="menu-btn" class="md:hidden text-xl">
|
| 119 |
<i class="fas fa-bars"></i>
|
| 120 |
</button>
|
| 121 |
</div>
|
| 122 |
</div>
|
| 123 |
</div>
|
| 124 |
|
| 125 |
+
<!-- MOBILE MENU -->
|
| 126 |
{% if current_user %}
|
| 127 |
+
<div id="mobile-menu" class="hidden md:hidden px-4 pb-4 animate-slideDown">
|
| 128 |
+
<div class="flex flex-col gap-2">
|
| 129 |
+
<a href="/" class="mobile-link">Dashboard</a>
|
| 130 |
+
<a href="/media/manage" class="mobile-link">Media</a>
|
| 131 |
+
<a href="/admin/dashboard" class="mobile-link">Admin</a>
|
| 132 |
+
<a href="/admin/subscriptions" class="mobile-link">Subscriptions</a>
|
| 133 |
+
<a href="/admin/access" class="mobile-link">Access</a>
|
| 134 |
</div>
|
| 135 |
</div>
|
| 136 |
{% endif %}
|
| 137 |
</nav>
|
| 138 |
|
| 139 |
+
<!-- MAIN -->
|
| 140 |
+
<main class="flex-1">
|
| 141 |
{% block content %}{% endblock %}
|
| 142 |
</main>
|
| 143 |
|
| 144 |
+
<!-- FOOTER -->
|
| 145 |
+
<footer class="theme-card border-t mt-auto text-text">
|
| 146 |
+
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
|
| 147 |
+
<div class="flex flex-col md:flex-row justify-between items-center gap-3">
|
| 148 |
+
<p class="theme-text-secondary text-sm">© 2026 Telegram Stremio. All rights reserved.</p>
|
| 149 |
+
<div class="flex gap-4">
|
| 150 |
+
<a href="/status" class="footer-link">Status</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
<a href="/stremio" class="footer-link">Stremio Guide</a>
|
| 152 |
</div>
|
| 153 |
</div>
|
| 154 |
</div>
|
| 155 |
</footer>
|
| 156 |
|
| 157 |
+
<!-- STYLES -->
|
| 158 |
<style>
|
| 159 |
+
.theme-primary { background-color: {{ theme.colors.primary }}; }
|
| 160 |
+
.theme-secondary { background-color: {{ theme.colors.secondary }}; }
|
| 161 |
+
.theme-accent { background-color: {{ theme.colors.accent }}; }
|
| 162 |
+
.theme-text-secondary { color: {{ theme.colors.text_secondary }}; }
|
| 163 |
+
|
| 164 |
.nav-link {
|
| 165 |
display: flex;
|
| 166 |
align-items: center;
|
| 167 |
+
gap: 6px;
|
| 168 |
+
padding: 6px 10px;
|
| 169 |
+
border-radius: 6px;
|
| 170 |
font-size: 14px;
|
| 171 |
+
transition: 0.2s;
|
|
|
|
|
|
|
| 172 |
}
|
| 173 |
|
| 174 |
.nav-link:hover {
|
|
|
|
| 175 |
background-color: rgba(255,255,255,0.05);
|
| 176 |
+
color: var(--tw-color-primary);
|
| 177 |
}
|
| 178 |
|
| 179 |
.mobile-link {
|
| 180 |
+
padding: 10px;
|
| 181 |
+
border-radius: 6px;
|
| 182 |
+
font-size: 14px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
}
|
| 184 |
|
| 185 |
.mobile-link:hover {
|
| 186 |
+
background-color: rgba(255,255,255,0.05);
|
|
|
|
| 187 |
}
|
| 188 |
|
| 189 |
.dropdown-link {
|
| 190 |
display: block;
|
| 191 |
+
padding: 8px 12px;
|
| 192 |
font-size: 14px;
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
.dropdown-link:hover {
|
| 196 |
+
background-color: rgba(255,255,255,0.05);
|
| 197 |
}
|
| 198 |
|
| 199 |
.footer-link {
|
| 200 |
font-size: 14px;
|
|
|
|
|
|
|
| 201 |
transition: 0.2s;
|
| 202 |
}
|
| 203 |
|
| 204 |
.footer-link:hover {
|
| 205 |
+
color: var(--tw-color-primary);
|
| 206 |
}
|
| 207 |
|
| 208 |
@keyframes slideDown {
|
|
|
|
| 211 |
}
|
| 212 |
|
| 213 |
.animate-slideDown {
|
| 214 |
+
animation: slideDown 0.25s ease;
|
| 215 |
}
|
| 216 |
</style>
|
| 217 |
|
| 218 |
+
<!-- SCRIPT -->
|
| 219 |
<script>
|
| 220 |
const btn = document.getElementById('menu-btn');
|
| 221 |
const menu = document.getElementById('mobile-menu');
|