diff --git a/assets/css/player.css b/assets/css/player.css index 6155d91..7d59357 100644 --- a/assets/css/player.css +++ b/assets/css/player.css @@ -9,15 +9,28 @@ body { #player { position: absolute; +} + +body.credits #player { bottom: var(--padding); } +body.art { + display: flex; + justify-content: center; + align-items: center; +} + #player pre, #player p { font-size: 16px; color: rgb(var(--color-accent)); } +body.art #player pre { + font-size: clamp(0px,3vw,3vh); +} + #player p { margin: 0; height: 23px; diff --git a/assets/js/modules/PlayerManager.mjs b/assets/js/modules/PlayerManager.mjs index ed07b96..2af9e03 100644 --- a/assets/js/modules/PlayerManager.mjs +++ b/assets/js/modules/PlayerManager.mjs @@ -107,7 +107,6 @@ export default class WindowManager { message(event) { const type = event.data[0]; const data = event.data[1]; - console.log(event); switch(type) { case "PLAY": console.log("PLAY",event); break; diff --git a/assets/js/modules/StillAlivePlayer.mjs b/assets/js/modules/StillAlivePlayer.mjs index 7a177a7..124fb55 100644 --- a/assets/js/modules/StillAlivePlayer.mjs +++ b/assets/js/modules/StillAlivePlayer.mjs @@ -51,7 +51,6 @@ export default class StillAlivePlayer { message(event) { const type = event.data[0]; const data = event.data[1]; - console.log(event); switch(type) { case "LINE_FEED": this.lineFeed(); break; diff --git a/assets/js/player.mjs b/assets/js/player.mjs index d75aed8..2462732 100644 --- a/assets/js/player.mjs +++ b/assets/js/player.mjs @@ -1,4 +1,18 @@ import { default as Player } from "./modules/StillAlivePlayer.mjs"; +// Go to start page if location.hash is omitted +if(!window.location.hash) { + // Close this window, if we can + window.close(); + + // Otherwise redirect to main page + const page = window.location.pathname.split("/"); + const url = window.location.href.replace(page[page.length - 1],""); + window.location.replace(url); +} + +// Add location.hash to body classList +document.body.classList.add(window.location.hash.substring(1)); + const element = document.getElementById("player"); const player = new Player(element); \ No newline at end of file diff --git a/index.html b/index.html index ec8dc93..d5d17c5 100755 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ +