feat: Enhance win effects and animations in OfflineView component

This commit is contained in:
2026-01-06 12:07:08 +01:00
parent 8aa07388ac
commit db5c70d02a
5 changed files with 16 additions and 12 deletions

View File

@@ -7,8 +7,9 @@ TARGET_PATH="/usr/share/nginx/html/env.js"
if [ -f "$TEMPLATE_PATH" ]; then if [ -f "$TEMPLATE_PATH" ]; then
echo "Rendering runtime config from $TEMPLATE_PATH" echo "Rendering runtime config from $TEMPLATE_PATH"
# export all variables for envsubst to access echo "Using environment variables:"
# only substitute variables present in the template printenv
echo "----"
envsubst < "$TEMPLATE_PATH" > "$TARGET_PATH" envsubst < "$TEMPLATE_PATH" > "$TARGET_PATH"
else else
echo "No runtime template found at $TEMPLATE_PATH, skipping" echo "No runtime template found at $TEMPLATE_PATH, skipping"

View File

@@ -1,5 +1,5 @@
window.__RUNTIME_CONFIG__ = { window.__RUNTIME_CONFIG__ = {
API_URL: "http://localhost:9000", API_URL: "http://localhost:9000",
WEBSOCKET_API_URL: "ws://localhost:9000/websocket" WEBSOCKET_URL: "ws://localhost:9000/websocket"
}; };

View File

@@ -1,5 +1,5 @@
window.__RUNTIME_CONFIG__ = { window.__RUNTIME_CONFIG__ = {
API_URL: "${API_URL}", API_URL: "${API_URL}",
WEBSOCKET_API_URL: "${WEBSOCKET_API_URL}" WEBSOCKET_URL: "${WEBSOCKET_URL}"
}; };

View File

@@ -172,6 +172,9 @@ function setupSocketHandlers(socket: WebSocket) {
} }
export function connectWebSocket(url?: string): Promise<void> { export function connectWebSocket(url?: string): Promise<void> {
if (!url) {
url = window.__RUNTIME_CONFIG__?.WEBSOCKET_URL
}
if (!url) { if (!url) {
const loc = window.location; const loc = window.location;
const protocol = loc.protocol === "https:" ? "wss:" : "ws:"; const protocol = loc.protocol === "https:" ? "wss:" : "ws:";

View File

@@ -47,28 +47,28 @@ const spin = (): void => {
const base1 = base0 + gap; const base1 = base0 + gap;
const base2 = base1 + gap; const base2 = base1 + gap;
setTimeout(() => { setTimeout(() => {
reelStates.value[0].isSpinning = false; reelStates.value[0]!!.isSpinning = false;
}, base0); }, base0);
setTimeout(() => { setTimeout(() => {
reelStates.value[1].isSpinning = false; reelStates.value[1]!!.isSpinning = false;
}, base1); }, base1);
setTimeout(() => { setTimeout(() => {
const firstTwoMatch = reelStates.value[0].value === reelStates.value[1].value && const firstTwoMatch = reelStates.value[0]!!.value === reelStates!!.value[1]!!.value &&
reelStates.value[0].value !== '❓'; reelStates.value[0]!!.value !== '❓';
const extraDelay = firstTwoMatch ? 1000 : 0; const extraDelay = firstTwoMatch ? 1000 : 0;
glowThird.value = firstTwoMatch; glowThird.value = firstTwoMatch;
setTimeout(() => { setTimeout(() => {
reelStates.value[2].isSpinning = false; reelStates.value[2]!!.isSpinning = false;
glowThird.value = false; glowThird.value = false;
globalSpinning.value = false; globalSpinning.value = false;
hasSpun.value = true; hasSpun.value = true;
const allThreeMatch = const allThreeMatch =
reelStates.value[0].value !== '❓' && reelStates.value[0]!!.value !== '❓' &&
reelStates.value[0].value === reelStates.value[1].value && reelStates.value[0]!!.value === reelStates.value[1]!!.value &&
reelStates.value[1].value === reelStates.value[2].value; reelStates.value[1]!!.value === reelStates.value[2]!!.value;
if (allThreeMatch) { if (allThreeMatch) {
winFire.value = true; winFire.value = true;
winBlink.value = true; winBlink.value = true;