SAE_RIOT_2024/index.html
2024-06-29 00:04:13 +02:00

50 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Riot App</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-neutral-50">
<onzer></onzer>
<script src="https://unpkg.com/animore/animore.js"></script>
<script src="https://unpkg.com/riot@9/riot+compiler.min.js"></script>
<script type="riot" src="./onzer.riot"></script>
<script type="riot" src="./playlists.riot"></script>
<script type="text/javascript">
async function fetch_data() {
return fetch("https://dwarves.iut-fbleau.fr/~fauvet/api/albums").then(response => {
return response.json();
});
}
function mountComponent(component) {
const app = document.getElementById('app');
app.innerHTML = '';
riot.mount(app, component);
}
riot.compile().then(async () => {
const data = await fetch_data();
route('/', () => {
riot.mount('onzer', { items: data });
});
route('/playlists', () => {
riot.mount('playlists');
});
router.start();
router.exec();
});
</script>
</body>
</html>