frontend redesign
This commit is contained in:
@ -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 };
|
||||
|
Reference in New Issue
Block a user