implemented audio fix for neocities
This commit is contained in:
parent
e14118f864
commit
8d1e1de894
5 changed files with 10 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
||||||
|
import { audioPath } from './path.js'
|
||||||
let bob = document.getElementById("bob");
|
let bob = document.getElementById("bob");
|
||||||
let help = document.createElement("audio");
|
let help = document.createElement("audio");
|
||||||
help.src = "/assets/audio/bob.ogg";
|
help.src = `${audioPath}bob.ogg`;
|
||||||
help.loop = true;
|
help.loop = true;
|
||||||
bob.appendChild(help);
|
bob.appendChild(help);
|
||||||
window.addEventListener("load", function () {
|
window.addEventListener("load", function () {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { audioPath } from './path.js'
|
||||||
let pipe = document.getElementById("meow");
|
let pipe = document.getElementById("meow");
|
||||||
let preload = new Image();
|
let preload = new Image();
|
||||||
preload.src = "/assets/img/button/braixdragon-cat2.gif";
|
preload.src = "/assets/img/button/braixdragon-cat2.gif";
|
||||||
|
@ -9,7 +10,7 @@ function func() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let audio = document.createElement("audio");
|
let audio = document.createElement("audio");
|
||||||
audio.src = "/assets/audio/anvil_land_low.ogg";
|
audio.src = `${audioPath}anvil_land_low.ogg`;
|
||||||
pipe.appendChild(audio);
|
pipe.appendChild(audio);
|
||||||
|
|
||||||
pipe.addEventListener(
|
pipe.addEventListener(
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
import { audioPath } from './path.js'
|
||||||
let fox = document.getElementById("fox");
|
let fox = document.getElementById("fox");
|
||||||
let music = document.createElement("audio");
|
let music = document.createElement("audio");
|
||||||
music.src = "/assets/audio/fox.ogg";
|
music.src = `${audioPath}fox.ogg`;
|
||||||
music.loop = true;
|
music.loop = true;
|
||||||
fox.appendChild(music);
|
fox.appendChild(music);
|
||||||
window.addEventListener("load", function () {
|
window.addEventListener("load", function () {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { audioPath } from './path.js'
|
||||||
let secret = document.getElementById("piss");
|
let secret = document.getElementById("piss");
|
||||||
let baby = new Image();
|
let baby = new Image();
|
||||||
baby.src = "/assets/img/button/piss-baby2.gif";
|
baby.src = "/assets/img/button/piss-baby2.gif";
|
||||||
|
@ -9,7 +10,7 @@ function func() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let flashlight = document.createElement("audio");
|
let flashlight = document.createElement("audio");
|
||||||
flashlight.src = "/assets/audio/flashlight.ogg";
|
flashlight.src = `${audioPath}flashlight.ogg`;
|
||||||
secret.appendChild(flashlight);
|
secret.appendChild(flashlight);
|
||||||
|
|
||||||
secret.addEventListener("mouseover", () => flashlight.play(), { once: true });
|
secret.addEventListener("mouseover", () => flashlight.play(), { once: true });
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { audioPath } from './path.js'
|
||||||
const imgBasePath = "/assets/img/pkmn/";
|
const imgBasePath = "/assets/img/pkmn/";
|
||||||
let favorites = [
|
let favorites = [
|
||||||
{ img: `${imgBasePath}1.png`, title: "Bulbasaur"},
|
{ img: `${imgBasePath}1.png`, title: "Bulbasaur"},
|
||||||
|
@ -364,7 +365,7 @@ party.forEach(pkmnData => {
|
||||||
document.getElementById("pkmn").appendChild(critter);
|
document.getElementById("pkmn").appendChild(critter);
|
||||||
critter.addEventListener("mouseover", () => {
|
critter.addEventListener("mouseover", () => {
|
||||||
const select = document.createElement("audio");
|
const select = document.createElement("audio");
|
||||||
select.src = "/assets/audio/select.ogg";
|
select.src = `${audioPath}select.ogg`;
|
||||||
select.play();
|
select.play();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue