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) {
|
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();
|
audio.play();
|
||||||
const div = document.createElement("div");
|
const div = document.createElement("div");
|
||||||
div.classList.add("blastin-roulette");
|
div.classList.add("blastin-roulette");
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ const volume = 1;
|
|||||||
export default async function execute(
|
export default async function execute(
|
||||||
alert: grenadeExplosionAlert,
|
alert: grenadeExplosionAlert,
|
||||||
): Promise<AlertRunner> {
|
): 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);
|
const audio = new Audio(audioPath);
|
||||||
audio.volume = volume;
|
audio.volume = volume;
|
||||||
|
|
||||||
const parentDiv = document.createElement("div");
|
const parentDiv = document.createElement("div");
|
||||||
parentDiv.className = "grenadeExplosionAlert";
|
parentDiv.className = "grenadeExplosionAlert";
|
||||||
parentDiv.innerHTML = `
|
parentDiv.innerHTML = `
|
||||||
<img src="/alerts/public/getrekt.jpg">
|
<img src="/alerts/assets/getrekt.jpg">
|
||||||
<span class="thrower">
|
<span class="thrower">
|
||||||
${alert.user}
|
${alert.user}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import type { soundAlert } from "web/alerts/types";
|
|||||||
import type { AlertRunner } from "./index";
|
import type { AlertRunner } from "./index";
|
||||||
|
|
||||||
export default async function execute(alert: soundAlert): Promise<AlertRunner> {
|
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();
|
audio.play();
|
||||||
return {
|
return {
|
||||||
blocking: false,
|
blocking: false,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default async function execute(
|
|||||||
const video = document.createElement("video");
|
const video = document.createElement("video");
|
||||||
|
|
||||||
video.volume = volume;
|
video.volume = volume;
|
||||||
video.src = "/alerts/public/tnt.mp4";
|
video.src = "/alerts/assets/tnt.mp4";
|
||||||
video.autoplay = true;
|
video.autoplay = true;
|
||||||
video.height = 800;
|
video.height = 800;
|
||||||
video.width = 450;
|
video.width = 450;
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ const volume = 1;
|
|||||||
export default async function execute(
|
export default async function execute(
|
||||||
alert: userBlastAlert,
|
alert: userBlastAlert,
|
||||||
): Promise<AlertRunner> {
|
): 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);
|
const audio = new Audio(audioPath);
|
||||||
audio.volume = volume;
|
audio.volume = volume;
|
||||||
|
|
||||||
const parentDiv = document.createElement("div");
|
const parentDiv = document.createElement("div");
|
||||||
parentDiv.className = "userBlastAlert";
|
parentDiv.className = "userBlastAlert";
|
||||||
parentDiv.innerHTML = `
|
parentDiv.innerHTML = `
|
||||||
<img src="/alerts/public/getrekt.jpg">
|
<img src="/alerts/assets/getrekt.jpg">
|
||||||
<span class="shooter">
|
<span class="shooter">
|
||||||
${alert.user}
|
${alert.user}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default async function execute(
|
|||||||
const parentDiv = document.createElement("div");
|
const parentDiv = document.createElement("div");
|
||||||
parentDiv.className = "userExecutionAlert";
|
parentDiv.className = "userExecutionAlert";
|
||||||
parentDiv.innerHTML = `
|
parentDiv.innerHTML = `
|
||||||
<img src="/alerts/public/getrekt.jpg">
|
<img src="/alerts/assets/getrekt.jpg">
|
||||||
<span class="shooter">
|
<span class="shooter">
|
||||||
${alert.user}
|
${alert.user}
|
||||||
</span>
|
</span>
|
||||||
@@ -57,12 +57,12 @@ export default async function execute(
|
|||||||
const randomY = Math.floor(Math.random() * (window.innerHeight - 800));
|
const randomY = Math.floor(Math.random() * (window.innerHeight - 800));
|
||||||
|
|
||||||
const audio1 = new Audio(
|
const audio1 = new Audio(
|
||||||
"/alerts/public/explosions/factoriolargeexplosion1.ogg",
|
"/alerts/assets/explosions/factoriolargeexplosion1.ogg",
|
||||||
);
|
);
|
||||||
const audio2 = new Audio(
|
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;
|
audio1.volume = volume;
|
||||||
audio2.volume = volume;
|
audio2.volume = volume;
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ export default Bun.serve({
|
|||||||
"/chat/getEmotes": getExternalEmotes,
|
"/chat/getEmotes": getExternalEmotes,
|
||||||
|
|
||||||
"/alerts": alerts,
|
"/alerts": alerts,
|
||||||
"/alerts/public/*": async (req) => {
|
"/alerts/assets/*": async (req) => {
|
||||||
const url = new URL(req.url);
|
const url = new URL(req.url);
|
||||||
const path = url.pathname.slice("/alerts/public/".length);
|
const path = url.pathname.slice("/alerts/assets/".length);
|
||||||
const file = Bun.file(`${import.meta.dir}/alerts/www/public/${path}`);
|
const file = Bun.file(`${import.meta.dir}/alerts/www/assets/${path}`);
|
||||||
if (!(await file.exists()))
|
if (!(await file.exists()))
|
||||||
return new Response(`404: ${url.pathname} not found`, {
|
return new Response(`404: ${url.pathname} not found`, {
|
||||||
status: 404,
|
status: 404,
|
||||||
|
|||||||
Reference in New Issue
Block a user