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