/guestbook, /autist, font changes and a new /projects entry

This commit is contained in:
zyqunix 2024-12-02 19:57:07 +01:00
parent edc8589d1d
commit 8fc3faf8bb
41 changed files with 400 additions and 101 deletions

35
autist/index.js Normal file
View file

@ -0,0 +1,35 @@
const sounds = {
autist: 'wav/sound1.wav',
downie: 'wav/sound2.wav',
retard: 'wav/sound3.wav',
'retarded autistic downie': 'wav/sound4.wav'
};
const button = document.getElementById('playButton');
const header = document.getElementById('played');
const toggle = document.getElementById('toggle');
const ad = document.getElementById('ad');
let isHidden = false;
button.addEventListener('click', function() {
const audio = document.getElementById('audio');
const keys = Object.keys(sounds);
let randKey = keys[Math.floor(Math.random() * keys.length)];
let randSound = sounds[randKey];
audio.src = randSound;
audio.play();
header.innerHTML = randKey;
});
toggle.addEventListener('click', function() {
if (!isHidden) {
ad.style.display = 'none';
isHidden = true;
} else {
ad.style.display = 'flex';
isHidden = false;
}
})