frontend redesign

This commit is contained in:
ngn
2025-01-07 00:13:11 +03:00
parent 337e56de78
commit fc11748e57
37 changed files with 1545 additions and 900 deletions

View File

@ -1,10 +1,15 @@
function click() {
let audio = new Audio("/click.wav");
audio.play();
}
import { join } from "$lib/api.js";
const colors = [
"yellow",
"cyan",
"green",
"pinkish",
"red",
// "blue" (looks kinda ass)
];
let colors_pos = -1;
const colors = ["yellow", "cyan", "green", "pinkish", "red", "blue"];
let api_url = join;
function color() {
if (colors_pos < 0) colors_pos = Math.floor(Math.random() * colors.length);
@ -13,4 +18,18 @@ function color() {
return colors[colors_pos];
}
export { click, color };
function click() {
let audio = new Audio("/click.wav");
audio.play();
}
function frontend_url(path) {
if (null !== path && path !== "") return new URL(path, import.meta.env.VITE_FRONTEND_URL).href;
else return new URL(import.meta.env.VITE_FRONTEND_URL).href;
}
function time_from_ts(ts) {
return new Date(ts * 1000).toLocaleTimeString();
}
export { api_url, frontend_url, click, color, time_from_ts };