rename alerts/public to alerts/assets

This commit is contained in:
2025-12-02 12:10:31 +01:00
parent a86ea710cb
commit 5ddbad1212
25 changed files with 14 additions and 14 deletions

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -5,7 +5,7 @@ function easeOutQuad(t: number) {
}
export default async function execute(alert: blastinRoulette) {
const audio = new Audio("/alerts/public/mariokartbox.ogg");
const audio = new Audio("/alerts/assets/mariokartbox.ogg");
audio.play();
const div = document.createElement("div");
div.classList.add("blastin-roulette");

View File

@@ -7,14 +7,14 @@ const volume = 1;
export default async function execute(
alert: grenadeExplosionAlert,
): Promise<AlertRunner> {
const audioPath = `/alerts/public/explosions/factorioexplosion${Math.ceil(Math.random() * 5)}.ogg`;
const audioPath = `/alerts/assets/explosions/factorioexplosion${Math.ceil(Math.random() * 5)}.ogg`;
const audio = new Audio(audioPath);
audio.volume = volume;
const parentDiv = document.createElement("div");
parentDiv.className = "grenadeExplosionAlert";
parentDiv.innerHTML = `
<img src="/alerts/public/getrekt.jpg">
<img src="/alerts/assets/getrekt.jpg">
<span class="thrower">
${alert.user}
</span>

View File

@@ -2,7 +2,7 @@ import type { soundAlert } from "web/alerts/types";
import type { AlertRunner } from "./index";
export default async function execute(alert: soundAlert): Promise<AlertRunner> {
const audio = new Audio(`/alerts/public/${alert.sound}.ogg`);
const audio = new Audio(`/alerts/assets/${alert.sound}.ogg`);
audio.play();
return {
blocking: false,

View File

@@ -24,7 +24,7 @@ export default async function execute(
const video = document.createElement("video");
video.volume = volume;
video.src = "/alerts/public/tnt.mp4";
video.src = "/alerts/assets/tnt.mp4";
video.autoplay = true;
video.height = 800;
video.width = 450;

View File

@@ -7,14 +7,14 @@ const volume = 1;
export default async function execute(
alert: userBlastAlert,
): Promise<AlertRunner> {
const audioPath = `/alerts/public/explosions/factorioexplosion${Math.ceil(Math.random() * 5)}.ogg`;
const audioPath = `/alerts/assets/explosions/factorioexplosion${Math.ceil(Math.random() * 5)}.ogg`;
const audio = new Audio(audioPath);
audio.volume = volume;
const parentDiv = document.createElement("div");
parentDiv.className = "userBlastAlert";
parentDiv.innerHTML = `
<img src="/alerts/public/getrekt.jpg">
<img src="/alerts/assets/getrekt.jpg">
<span class="shooter">
${alert.user}
</span>

View File

@@ -10,7 +10,7 @@ export default async function execute(
const parentDiv = document.createElement("div");
parentDiv.className = "userExecutionAlert";
parentDiv.innerHTML = `
<img src="/alerts/public/getrekt.jpg">
<img src="/alerts/assets/getrekt.jpg">
<span class="shooter">
${alert.user}
</span>
@@ -57,12 +57,12 @@ export default async function execute(
const randomY = Math.floor(Math.random() * (window.innerHeight - 800));
const audio1 = new Audio(
"/alerts/public/explosions/factoriolargeexplosion1.ogg",
"/alerts/assets/explosions/factoriolargeexplosion1.ogg",
);
const audio2 = new Audio(
"/alerts/public/explosions/factoriolargeexplosion1.ogg",
"/alerts/assets/explosions/factoriolargeexplosion1.ogg",
);
const audio3 = new Audio("/alerts/public/explosions/factorionuke.ogg");
const audio3 = new Audio("/alerts/assets/explosions/factorionuke.ogg");
audio1.volume = volume;
audio2.volume = volume;

View File

@@ -26,10 +26,10 @@ export default Bun.serve({
"/chat/getEmotes": getExternalEmotes,
"/alerts": alerts,
"/alerts/public/*": async (req) => {
"/alerts/assets/*": async (req) => {
const url = new URL(req.url);
const path = url.pathname.slice("/alerts/public/".length);
const file = Bun.file(`${import.meta.dir}/alerts/www/public/${path}`);
const path = url.pathname.slice("/alerts/assets/".length);
const file = Bun.file(`${import.meta.dir}/alerts/www/assets/${path}`);
if (!(await file.exists()))
return new Response(`404: ${url.pathname} not found`, {
status: 404,