mirror of
https://github.com/qwerinope/qweribot.git
synced 2025-12-19 08:41:39 +01:00
rename alerts/public to alerts/assets
This commit is contained in:
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
@@ -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");
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user