mirror of
https://github.com/zyqunix/tools.git
synced 2025-07-06 06:20:30 +02:00
/guestbook, /autist, font changes and a new /projects entry
This commit is contained in:
parent
edc8589d1d
commit
8fc3faf8bb
41 changed files with 400 additions and 101 deletions
35
autist/index.js
Normal file
35
autist/index.js
Normal 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;
|
||||
}
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue