initial commit

This commit is contained in:
Cory Dransfeldt 2024-11-16 16:43:07 -08:00
commit c70fc72952
No known key found for this signature in database
143 changed files with 13594 additions and 0 deletions

View file

@ -0,0 +1,24 @@
---
import { fetchNowPlaying } from '../../utils/data/nowPlaying.js';
const isProduction = import.meta.env.MODE === 'production';
const nowPlayingData = await fetchNowPlaying();
---
<span class="loading client-side" id="now-playing-content" set:html={nowPlayingData.content}></span>
<noscript>
<p>{nowPlayingData.content}</p>
</noscript>
{isProduction && (<script type="module">
async function updateNowPlaying() {
const response = await fetch('/api/now-playing');
if (response.ok) {
const data = await response.json();
document.getElementById('now-playing-content').innerHTML = data.content;
}
}
setInterval(updateNowPlaying, 180000);
updateNowPlaying();
</script>)}