some changes

design
serr 2025-06-08 00:00:32 +03:00
parent 185ac4bf71
commit 2cea7c8bb4
1 changed files with 15 additions and 5 deletions

View File

@ -6,11 +6,7 @@
</div> </div>
<div class="pulse-container"> <div class="pulse-container">
<p class="pulse-text"> <p class="pulse-text">
<code>🎵&nbsp;last played track: </code><code id="lastfm" <code>🎵&nbsp;last played track: </code><code id="lastfm">waiting for a response from server... (JavaScript is required)</code><code>&nbsp;🎵</code>
hx-get="/api/lastfm"
hx-trigger="load, every 30s"
hx-target="#lastfm"
hx-swap="innerHTML">waiting for a response from server... (JavaScript is required)</code><code>&nbsp;🎵</code>
</p> </p>
</div> </div>
<div> <div>
@ -43,5 +39,19 @@
and also you can subscribe to my <a href="https://t.me/lolistack" target="_blank">telegram channel</a> with pictures! and also you can subscribe to my <a href="https://t.me/lolistack" target="_blank">telegram channel</a> with pictures!
</p> </p>
</div> </div>
<script>
function updateLastfm() {
fetch('/api/lastfm')
.then(response => response.text())
.then(text => {
document.getElementById('lastfm').textContent = text;
})
.catch(error => {
console.error('Error fetching lastfm:', error);
});
}
updateLastfm();
setInterval(updateLastfm, 30000);
</script>
</header> </header>
{{ end }} {{ end }}