some changes
parent
185ac4bf71
commit
2cea7c8bb4
|
@ -6,11 +6,7 @@
|
|||
</div>
|
||||
<div class="pulse-container">
|
||||
<p class="pulse-text">
|
||||
<code>🎵 last played track: </code><code id="lastfm"
|
||||
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> 🎵</code>
|
||||
<code>🎵 last played track: </code><code id="lastfm">waiting for a response from server... (JavaScript is required)</code><code> 🎵</code>
|
||||
</p>
|
||||
</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!
|
||||
</p>
|
||||
</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>
|
||||
{{ end }}
|
Loading…
Reference in New Issue