mini-player: implemented
This commit is contained in:
parent
a741d256be
commit
979ac108a7
10 changed files with 81 additions and 23 deletions
|
|
@ -12,11 +12,30 @@
|
|||
|
||||
<body hx-boost="true" hx-target="#content">
|
||||
{% include "partials/header.html" %}
|
||||
<!-- <div hx-get="/miniplayer" hx-trigger="load" hx-swap="outerHtml"></div> -->
|
||||
<div id="miniplayer-container" hx-get="/miniplayer" hx-trigger="load" hx-swap="innerHTML"
|
||||
hx-target="#miniplayer-container">
|
||||
<miniplayer>
|
||||
<h1>Chargement...</h1>
|
||||
</miniplayer>
|
||||
</div>
|
||||
|
||||
<main id="content">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<script>
|
||||
function updateMiniplayerVisibility() {
|
||||
const isMusicPage = window.location.pathname === '/music';
|
||||
const miniplayer = document.getElementById('miniplayer-container');
|
||||
if (miniplayer) {
|
||||
miniplayer.style.display = isMusicPage ? 'none' : '';
|
||||
}
|
||||
}
|
||||
|
||||
updateMiniplayerVisibility();
|
||||
|
||||
document.body.addEventListener('htmx:afterSwap', updateMiniplayerVisibility);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue