mirror of
https://codeberg.org/vlw/still-alive.git
synced 2025-09-14 00:13:41 +02:00
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
This commit is contained in:
parent
ecdde3201a
commit
cf3eecb27f
6 changed files with 33 additions and 2 deletions
|
@ -9,15 +9,28 @@ body {
|
||||||
|
|
||||||
#player {
|
#player {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.credits #player {
|
||||||
bottom: var(--padding);
|
bottom: var(--padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.art {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
#player pre,
|
#player pre,
|
||||||
#player p {
|
#player p {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: rgb(var(--color-accent));
|
color: rgb(var(--color-accent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.art #player pre {
|
||||||
|
font-size: clamp(0px,3vw,3vh);
|
||||||
|
}
|
||||||
|
|
||||||
#player p {
|
#player p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: 23px;
|
height: 23px;
|
||||||
|
|
|
@ -107,7 +107,6 @@ export default class WindowManager {
|
||||||
message(event) {
|
message(event) {
|
||||||
const type = event.data[0];
|
const type = event.data[0];
|
||||||
const data = event.data[1];
|
const data = event.data[1];
|
||||||
console.log(event);
|
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case "PLAY": console.log("PLAY",event); break;
|
case "PLAY": console.log("PLAY",event); break;
|
||||||
|
|
|
@ -51,7 +51,6 @@ export default class StillAlivePlayer {
|
||||||
message(event) {
|
message(event) {
|
||||||
const type = event.data[0];
|
const type = event.data[0];
|
||||||
const data = event.data[1];
|
const data = event.data[1];
|
||||||
console.log(event);
|
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case "LINE_FEED": this.lineFeed(); break;
|
case "LINE_FEED": this.lineFeed(); break;
|
||||||
|
|
|
@ -1,4 +1,18 @@
|
||||||
import { default as Player } from "./modules/StillAlivePlayer.mjs";
|
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 element = document.getElementById("player");
|
||||||
const player = new Player(element);
|
const player = new Player(element);
|
|
@ -4,6 +4,7 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta name="description" content="End credits from 'Portal' - the video game, recreated with JS and browser windows.">
|
||||||
<title>Still Alive</title>
|
<title>Still Alive</title>
|
||||||
<link rel="stylesheet" href="assets/css/style.css">
|
<link rel="stylesheet" href="assets/css/style.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
5
robots.txt
Normal file
5
robots.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
User-Agent: *
|
||||||
|
|
||||||
|
Allow: /
|
||||||
|
|
||||||
|
Disallow: /player
|
Loading…
Add table
Reference in a new issue