still-alive/assets/js/player.mjs
Victor Westerlund cf3eecb27f Style changes and log removal
Fixed the scroll direction for lyrics, made the art window's font clamp (and centered) and also removed some loggers.

player.html will redirect to the main page if opened without a hash and will no longer be caught by crawlers that care about robots.txt
2021-10-31 12:35:03 +01:00

18 lines
No EOL
576 B
JavaScript

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);