diff --git a/.gitignore b/.gitignore index b4385cf..0b3aa71 100644 --- a/.gitignore +++ b/.gitignore @@ -248,3 +248,5 @@ $RECYCLE.BIN/ *.lnk # End of https://www.toptal.com/developers/gitignore/api/python,windows,macos,linux + +*.mp3 diff --git a/0.mp3 b/0.mp3 deleted file mode 100644 index 938823f..0000000 Binary files a/0.mp3 and /dev/null differ diff --git a/1.mp3 b/1.mp3 deleted file mode 100644 index 4bb0697..0000000 Binary files a/1.mp3 and /dev/null differ diff --git a/2.mp3 b/2.mp3 deleted file mode 100644 index f525653..0000000 Binary files a/2.mp3 and /dev/null differ diff --git a/3.mp3 b/3.mp3 deleted file mode 100644 index 7104183..0000000 Binary files a/3.mp3 and /dev/null differ diff --git a/4.mp3 b/4.mp3 deleted file mode 100644 index a372db7..0000000 Binary files a/4.mp3 and /dev/null differ diff --git a/5.mp3 b/5.mp3 deleted file mode 100644 index e69de29..0000000 diff --git a/6.mp3 b/6.mp3 deleted file mode 100644 index e38c388..0000000 Binary files a/6.mp3 and /dev/null differ diff --git a/7.mp3 b/7.mp3 deleted file mode 100644 index 6ca129d..0000000 Binary files a/7.mp3 and /dev/null differ diff --git a/8.mp3 b/8.mp3 deleted file mode 100644 index 8b57d42..0000000 Binary files a/8.mp3 and /dev/null differ diff --git a/9.mp3 b/9.mp3 deleted file mode 100644 index a86868a..0000000 Binary files a/9.mp3 and /dev/null differ diff --git a/start-server.sh b/start-server.sh new file mode 100644 index 0000000..b80c616 --- /dev/null +++ b/start-server.sh @@ -0,0 +1,2 @@ +#!/bin/sh +uvicorn server:app --host 0.0.0.0 --port 443 --ssl-keyfile private.key.pem --ssl-certfile domain.cert.pem > server.log 2> server.err < /dev/null diff --git a/web/index.html b/web/index.html index b3ff4d3..8d341a4 100644 --- a/web/index.html +++ b/web/index.html @@ -2,11 +2,9 @@ - - infinifi - + @@ -14,6 +12,14 @@ + + + + + + + +
diff --git a/web/script.js b/web/script.js index a29a03c..5f87f5b 100644 --- a/web/script.js +++ b/web/script.js @@ -97,6 +97,30 @@ function animateCat() { }, 500); } +/** + * Allow audio to be played/paused using the space bar + */ +function enableSpaceBarControl() { + document.addEventListener("keydown", (event) => { + if (event.code === "Space") { + playBtn.classList.add("button-active"); + playBtn.dispatchEvent(new MouseEvent("mousedown")); + clickAudio.play(); + } + }); + document.addEventListener("keyup", (event) => { + if (event.code === "Space") { + playBtn.classList.remove("button-active"); + clickReleaseAudio.play(); + } + }); + document.addEventListener("keypress", (event) => { + if (event.code === "Space") { + playBtn.click(); + } + }); +} + playBtn.onmousedown = () => { clickAudio.play(); document.addEventListener( @@ -127,3 +151,4 @@ volumeSlider.oninput = () => { volumeSlider.value = 100; animateCat(); +enableSpaceBarControl(); diff --git a/web/style.css b/web/style.css index b28debd..a17e453 100644 --- a/web/style.css +++ b/web/style.css @@ -36,6 +36,13 @@ body { background-color: var(--base); overflow: hidden; } +@media (min-width: 768px) { + body { + width: calc(100% - 8rem - 2px); + height: calc(100vh - 10rem - 2px); + padding: 4rem; + } +} h1, h2, @@ -66,6 +73,11 @@ footer { align-items: center; justify-content: center; } +@media (min-width: 768px) { + footer { + padding: 2rem 0; + } +} footer > span { color: var(--text); @@ -245,12 +257,14 @@ input[type="range"]::-ms-fill-upper { } } +.button.button-active, .button:active { background: var(--text) !important; color: var(--base); transform: translate(4px, 4px); } +.button.button-active::after, .button:active::after { content: none; }