Compare commits

...

2 Commits

Author SHA1 Message Date
f5b220b3e0 cleared up warnings, added comments 2025-11-17 13:11:43 -05:00
2f093109d5 manually reindent 2025-11-17 13:06:31 -05:00

View File

@ -1,4 +1,10 @@
<!DOCTYPE> <!--
bookmark this with ?audio=file.wav&time=1h32m21s&style=font-color:green; on the end
to default the audio to file.wav, the time to 1h21m21s, and the style to font-color:green. get it? 0 or more of those 3.
hopefully your browser allows autoplay.
default finish sound is secret-area.wav
-->
<!DOCTYPE html>
<html> <html>
<head> <head>
<style type="text/css"> <style type="text/css">
@ -183,33 +189,33 @@
return decodeURIComponent(match[1]); return decodeURIComponent(match[1]);
} }
function dropHandler(ev){ function dropHandler(ev){
console.log("Drop handler"); console.log("Drop handler");
ev.preventDefault(); ev.preventDefault();
const files = [...ev.dataTransfer.items] const files = [...ev.dataTransfer.items]
.map((item) => item.getAsFile()) .map((item) => item.getAsFile())
.filter((file) => file); .filter((file) => file);
console.log(files); console.log(files);
finishSound.querySelector("source").src=files[0].name; finishSound.querySelector("source").src=files[0].name;
finishSound.load(); finishSound.load();
} }
window.onload = () => { window.onload = () => {
let onloadTime = getGET("time"); let onloadTime = getGET("time");
if(onloadTime !== null){ if(onloadTime !== null){
timeinput.value = onloadTime; timeinput.value = onloadTime;
finishTime = Temporal.Now.instant().add(Temporal.Duration.from("PT" + timeinput.value)); finishTime = Temporal.Now.instant().add(Temporal.Duration.from("PT" + timeinput.value));
hz(); hz();
} }
let onloadFile = getGET("audio"); let onloadFile = getGET("audio");
if(onloadFile !== null){ if(onloadFile !== null){
finishSound.querySelector("source").src=onloadFile ; finishSound.querySelector("source").src=onloadFile ;
finishSound.load(); finishSound.load();
} }
let onloadStyle = getGET("style"); let onloadStyle = getGET("style");
if(onloadStyle !== null){ if(onloadStyle !== null){
styling.value = onloadStyle; styling.value = onloadStyle;
timeroutput.style = styling.value; timeroutput.style = styling.value;
} }
dropZone.addEventListener("drop", dropHandler); dropZone.addEventListener("drop", dropHandler);
@ -219,7 +225,7 @@
finishSound.load(); finishSound.load();
} }
}); });
} }
</script> </script>
</body> </body>