77 lines
No EOL
2.3 KiB
HTML
77 lines
No EOL
2.3 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<meta name="viewport" content="width=device-width, interactive-widget=resizes-content" />
|
||
<link rel="icon" type="image/gif" href="/static/assets/gifs/pcgif.gif">
|
||
<!-- <title>Agahnim</title> -->
|
||
<title>Agahnim proto</title>
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=DotGothic16&family=VT323&display=swap">
|
||
<link rel="stylesheet" href="/static/style.css" />
|
||
<script src="/static/vendor/htmx.min.js"></script>
|
||
<script>
|
||
htmx.config.scrollIntoViewOnBoost = false;
|
||
</script>
|
||
</head>
|
||
|
||
<body hx-boost="true" hx-target="#content">
|
||
<crt>
|
||
<persistent-ui>
|
||
{% include "partials/header.html" %}
|
||
<miniplayer-container id="miniplayer-container">
|
||
{% block miniplayer %}{% endblock %}
|
||
</miniplayer-container>
|
||
</persistent-ui>
|
||
|
||
<main id="content">
|
||
{% block content %}{% endblock %}
|
||
</main>
|
||
</crt>
|
||
|
||
<script src="/static/miniplayer.js"></script>
|
||
<script>
|
||
function updateMiniplayerVisibility() {
|
||
const isMusicPage = window.location.pathname === '/music';
|
||
const miniplayer = document.getElementById('miniplayer-container');
|
||
if (miniplayer) {
|
||
miniplayer.style.display = isMusicPage ? 'none' : '';
|
||
}
|
||
if (isMusicPage) {
|
||
const audio = document.querySelector('mini-player audio');
|
||
if (audio) audio.pause();
|
||
}
|
||
}
|
||
|
||
function updateNavState() {
|
||
const path = window.location.pathname;
|
||
document.querySelectorAll('navbar input[type="radio"]').forEach(radio => {
|
||
radio.checked = false;
|
||
});
|
||
if (path === '/') {
|
||
const homeRadio = document.getElementById('nav-home');
|
||
if (homeRadio) homeRadio.checked = true;
|
||
} else if (path === '/music') {
|
||
const musicRadio = document.getElementById('nav-music');
|
||
if (musicRadio) musicRadio.checked = true;
|
||
}
|
||
}
|
||
|
||
function closeMobileMenu() {
|
||
const checkbox = document.getElementById('nav-toggle-checkbox');
|
||
if (checkbox) checkbox.checked = false;
|
||
}
|
||
|
||
updateMiniplayerVisibility();
|
||
updateNavState();
|
||
|
||
document.body.addEventListener('htmx:afterSwap', () => {
|
||
updateMiniplayerVisibility();
|
||
updateNavState();
|
||
closeMobileMenu();
|
||
window.scrollTo(0, 0);
|
||
});
|
||
</script>
|
||
</body>
|
||
|
||
</html> |