202 lines
12 KiB
HTML
202 lines
12 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 %}Dune Awakening Server Dashboard{% endblock %}</title>
|
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='themes.css') }}">
|
|
<script>
|
|
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
|
async function csrfFetch(url, options = {}) {
|
|
options.headers = options.headers || {};
|
|
options.headers['X-CSRFToken'] = csrfToken;
|
|
return fetch(url, options);
|
|
}
|
|
</script>
|
|
{% block head_extra %}{% endblock %}
|
|
</head>
|
|
<body>
|
|
<button class="nav-toggle" id="navToggle" title="Toggle nav layout" onclick="toggleNavLayout()">☰</button>
|
|
<nav>
|
|
<div class="brand">DUNE DASHBOARD</div>
|
|
<!-- Horizontal: use grouped nav -->
|
|
<div class="nav-links-h">
|
|
{% for item in nav_groups %}
|
|
{% if item|length == 2 and item[1] is string %}
|
|
{# Simple link #}
|
|
<a href="{{ item[0] }}" class="{% if current_path == item[0] %}active{% endif %}">{{ item[1] }}</a>
|
|
{% else %}
|
|
{# Dropdown group: item[0] is label, item[1] is list of (href, label) #}
|
|
<div class="nav-dropdown">
|
|
<a class="nav-dropdown-toggle {% for ih, il in item[1] %}{% if current_path == ih %}active{% endif %}{% endfor %}">{{ item[0] }} ▾</a>
|
|
<div class="nav-dropdown-content">
|
|
{% for ih, il in item[1] %}
|
|
<a href="{{ ih }}" class="{% if current_path == ih %}active{% endif %}">{{ il }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
<!-- Vertical nav links (flat list) -->
|
|
<div class="nav-links-v">
|
|
{% for href, label in nav_pages %}
|
|
<a href="{{ href }}" class="{% if current_path == href %}active{% endif %}">{{ label }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
<div class="spacer"></div>
|
|
<div class="theme-dropdown">
|
|
<button class="theme-btn" title="Theme">🎨</button>
|
|
<div class="theme-dropdown-content">
|
|
<div class="theme-grid">
|
|
<div class="theme-row" data-family="default">
|
|
<span class="theme-row-label">Classic Dune</span>
|
|
<span class="theme-swatch default" data-theme="default" onclick="setTheme('default')" title="Classic Dune Light"></span>
|
|
<span class="theme-swatch default-dark active-theme" data-theme="default-dark" onclick="setTheme('default-dark')" title="Classic Dune Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="atreides">
|
|
<span class="theme-row-label">House Atreides</span>
|
|
<span class="theme-swatch atreides" data-theme="atreides" onclick="setTheme('atreides')" title="House Atreides Light"></span>
|
|
<span class="theme-swatch atreides-dark" data-theme="atreides-dark" onclick="setTheme('atreides-dark')" title="House Atreides Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="harkonnen">
|
|
<span class="theme-row-label">House Harkonnen</span>
|
|
<span class="theme-swatch harkonnen-light" data-theme="harkonnen-light" onclick="setTheme('harkonnen-light')" title="House Harkonnen Light"></span>
|
|
<span class="theme-swatch harkonnen" data-theme="harkonnen" onclick="setTheme('harkonnen')" title="House Harkonnen Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="fremen">
|
|
<span class="theme-row-label">Fremen</span>
|
|
<span class="theme-swatch fremen" data-theme="fremen" onclick="setTheme('fremen')" title="Fremen Light"></span>
|
|
<span class="theme-swatch fremen-dark" data-theme="fremen-dark" onclick="setTheme('fremen-dark')" title="Fremen Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="bene-gesserit">
|
|
<span class="theme-row-label">Bene Gesserit</span>
|
|
<span class="theme-swatch bene-gesserit" data-theme="bene-gesserit" onclick="setTheme('bene-gesserit')" title="Bene Gesserit Light"></span>
|
|
<span class="theme-swatch bene-gesserit-dark" data-theme="bene-gesserit-dark" onclick="setTheme('bene-gesserit-dark')" title="Bene Gesserit Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="spacing-guild">
|
|
<span class="theme-row-label">Spacing Guild</span>
|
|
<span class="theme-swatch spacing-guild-light" data-theme="spacing-guild-light" onclick="setTheme('spacing-guild-light')" title="Spacing Guild Light"></span>
|
|
<span class="theme-swatch spacing-guild" data-theme="spacing-guild" onclick="setTheme('spacing-guild')" title="Spacing Guild Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="emperor">
|
|
<span class="theme-row-label">Emperor</span>
|
|
<span class="theme-swatch emperor-light" data-theme="emperor-light" onclick="setTheme('emperor-light')" title="Emperor Light"></span>
|
|
<span class="theme-swatch emperor" data-theme="emperor" onclick="setTheme('emperor')" title="Emperor Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="corrino">
|
|
<span class="theme-row-label">House Corrino</span>
|
|
<span class="theme-swatch corrino" data-theme="corrino" onclick="setTheme('corrino')" title="House Corrino Light"></span>
|
|
<span class="theme-swatch corrino-dark" data-theme="corrino-dark" onclick="setTheme('corrino-dark')" title="House Corrino Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="mentat">
|
|
<span class="theme-row-label">Mentat</span>
|
|
<span class="theme-swatch mentat" data-theme="mentat" onclick="setTheme('mentat')" title="Mentat Light"></span>
|
|
<span class="theme-swatch mentat-dark" data-theme="mentat-dark" onclick="setTheme('mentat-dark')" title="Mentat Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="sardaukar">
|
|
<span class="theme-row-label">Sardaukar</span>
|
|
<span class="theme-swatch sardaukar" data-theme="sardaukar" onclick="setTheme('sardaukar')" title="Sardaukar Light"></span>
|
|
<span class="theme-swatch sardaukar-dark" data-theme="sardaukar-dark" onclick="setTheme('sardaukar-dark')" title="Sardaukar Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="tleilax">
|
|
<span class="theme-row-label">Bene Tleilax</span>
|
|
<span class="theme-swatch tleilax-light" data-theme="tleilax-light" onclick="setTheme('tleilax-light')" title="Bene Tleilax Light"></span>
|
|
<span class="theme-swatch tleilax" data-theme="tleilax" onclick="setTheme('tleilax')" title="Bene Tleilax Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="ordos">
|
|
<span class="theme-row-label">House Ordos</span>
|
|
<span class="theme-swatch ordos" data-theme="ordos" onclick="setTheme('ordos')" title="House Ordos Light"></span>
|
|
<span class="theme-swatch ordos-dark" data-theme="ordos-dark" onclick="setTheme('ordos-dark')" title="House Ordos Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="ix">
|
|
<span class="theme-row-label">Ix</span>
|
|
<span class="theme-swatch ix" data-theme="ix" onclick="setTheme('ix')" title="Ix Light"></span>
|
|
<span class="theme-swatch ix-dark" data-theme="ix-dark" onclick="setTheme('ix-dark')" title="Ix Dark"></span>
|
|
</div>
|
|
<div class="theme-row" data-family="choam">
|
|
<span class="theme-row-label">CHOAM</span>
|
|
<span class="theme-swatch choam" data-theme="choam" onclick="setTheme('choam')" title="CHOAM Light"></span>
|
|
<span class="theme-swatch choam-dark" data-theme="choam-dark" onclick="setTheme('choam-dark')" title="CHOAM Dark"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<span class="nav-conn">
|
|
<span class="conn-dot {% if conn_ok %}online{% else %}offline{% endif %}"></span>
|
|
{{ 'Connected' if conn_ok else 'Disconnected' }}
|
|
</span>
|
|
{% if current_user and current_user.is_authenticated %}
|
|
<a href="/logout" class="nav-logout">Logout</a>
|
|
{% endif %}
|
|
</nav>
|
|
<main class="container">
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
<footer class="site-footer">
|
|
<span>This is a fan-made project and is not affiliated with, endorsed by, or connected to Funcom, Legendary Entertainment, or any official Dune rights holders. All game assets, trademarks, and intellectual property belong to their respective owners.</span>
|
|
</footer>
|
|
<script>
|
|
// Theme System
|
|
function setTheme(themeName) {
|
|
document.documentElement.setAttribute('data-theme', themeName);
|
|
localStorage.setItem('dune-theme', themeName);
|
|
updateThemeUI(themeName);
|
|
}
|
|
|
|
function updateThemeUI(themeName) {
|
|
document.querySelectorAll('.theme-row .theme-swatch').forEach(sw => {
|
|
sw.classList.toggle('active-theme', sw.getAttribute('data-theme') === themeName);
|
|
});
|
|
}
|
|
|
|
function initTheme() {
|
|
const savedTheme = localStorage.getItem('dune-theme') || 'default-dark';
|
|
document.documentElement.setAttribute('data-theme', savedTheme);
|
|
updateThemeUI(savedTheme);
|
|
}
|
|
|
|
// Nav Layout System (experimental vertical toggle)
|
|
function toggleNavLayout() {
|
|
const body = document.body;
|
|
const isMobile = window.innerWidth <= 768;
|
|
if (isMobile) {
|
|
document.querySelector('nav').classList.toggle('nav-open');
|
|
return;
|
|
}
|
|
const current = body.getAttribute('data-nav-layout') || 'horizontal';
|
|
const next = current === 'horizontal' ? 'vertical' : 'horizontal';
|
|
body.setAttribute('data-nav-layout', next);
|
|
localStorage.setItem('dune-nav-layout', next);
|
|
}
|
|
|
|
function initNavLayout() {
|
|
const isMobile = window.innerWidth <= 768;
|
|
if (isMobile) {
|
|
document.body.setAttribute('data-nav-layout', 'vertical');
|
|
localStorage.removeItem('dune-nav-layout');
|
|
} else {
|
|
const saved = localStorage.getItem('dune-nav-layout') || 'horizontal';
|
|
document.body.setAttribute('data-nav-layout', saved);
|
|
}
|
|
}
|
|
|
|
window.addEventListener('resize', function() {
|
|
const isMobile = window.innerWidth <= 768;
|
|
const current = document.body.getAttribute('data-nav-layout');
|
|
if (isMobile && current !== 'vertical') {
|
|
document.body.setAttribute('data-nav-layout', 'vertical');
|
|
}
|
|
});
|
|
|
|
initTheme();
|
|
initNavLayout();
|
|
</script>
|
|
{% block scripts %}{% endblock %}
|
|
<style>
|
|
.site-footer { text-align: center; padding: 16px 20px; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border); margin-top: 24px; }
|
|
</style>
|
|
</body>
|
|
</html> |