enh: her
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
<script>
|
||||
import { io } from 'socket.io-client';
|
||||
import { spring } from 'svelte/motion';
|
||||
|
||||
let loadingProgress = spring(0);
|
||||
|
||||
import { onMount, tick, setContext } from 'svelte';
|
||||
import {
|
||||
@@ -116,8 +119,31 @@
|
||||
|
||||
await tick();
|
||||
|
||||
document.getElementById('splash-screen')?.remove();
|
||||
loaded = true;
|
||||
if (
|
||||
document.documentElement.classList.contains('her') &&
|
||||
document.getElementById('progress-bar')
|
||||
) {
|
||||
loadingProgress.subscribe((value) => {
|
||||
document.getElementById('progress-bar').style.width = `${value * 0.24}rem`;
|
||||
});
|
||||
|
||||
await loadingProgress.set(100);
|
||||
|
||||
document.getElementById('splash-screen')?.remove();
|
||||
|
||||
const audio = new Audio(`/audio/greeting.mp3`);
|
||||
const playAudio = () => {
|
||||
audio.play();
|
||||
document.removeEventListener('click', playAudio);
|
||||
};
|
||||
|
||||
document.addEventListener('click', playAudio);
|
||||
|
||||
loaded = true;
|
||||
} else {
|
||||
document.getElementById('splash-screen')?.remove();
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
return () => {
|
||||
window.removeEventListener('resize', onResize);
|
||||
|
||||
Reference in New Issue
Block a user