feat: Enhance win effects and animations in OfflineView component
This commit is contained in:
@@ -172,6 +172,9 @@ function setupSocketHandlers(socket: WebSocket) {
|
||||
}
|
||||
|
||||
export function connectWebSocket(url?: string): Promise<void> {
|
||||
if (!url) {
|
||||
url = window.__RUNTIME_CONFIG__?.WEBSOCKET_URL
|
||||
}
|
||||
if (!url) {
|
||||
const loc = window.location;
|
||||
const protocol = loc.protocol === "https:" ? "wss:" : "ws:";
|
||||
|
||||
@@ -47,28 +47,28 @@ const spin = (): void => {
|
||||
const base1 = base0 + gap;
|
||||
const base2 = base1 + gap;
|
||||
setTimeout(() => {
|
||||
reelStates.value[0].isSpinning = false;
|
||||
reelStates.value[0]!!.isSpinning = false;
|
||||
}, base0);
|
||||
setTimeout(() => {
|
||||
reelStates.value[1].isSpinning = false;
|
||||
reelStates.value[1]!!.isSpinning = false;
|
||||
}, base1);
|
||||
setTimeout(() => {
|
||||
const firstTwoMatch = reelStates.value[0].value === reelStates.value[1].value &&
|
||||
reelStates.value[0].value !== '❓';
|
||||
const firstTwoMatch = reelStates.value[0]!!.value === reelStates!!.value[1]!!.value &&
|
||||
reelStates.value[0]!!.value !== '❓';
|
||||
const extraDelay = firstTwoMatch ? 1000 : 0;
|
||||
|
||||
glowThird.value = firstTwoMatch;
|
||||
|
||||
setTimeout(() => {
|
||||
reelStates.value[2].isSpinning = false;
|
||||
reelStates.value[2]!!.isSpinning = false;
|
||||
glowThird.value = false;
|
||||
globalSpinning.value = false;
|
||||
hasSpun.value = true;
|
||||
|
||||
const allThreeMatch =
|
||||
reelStates.value[0].value !== '❓' &&
|
||||
reelStates.value[0].value === reelStates.value[1].value &&
|
||||
reelStates.value[1].value === reelStates.value[2].value;
|
||||
reelStates.value[0]!!.value !== '❓' &&
|
||||
reelStates.value[0]!!.value === reelStates.value[1]!!.value &&
|
||||
reelStates.value[1]!!.value === reelStates.value[2]!!.value;
|
||||
if (allThreeMatch) {
|
||||
winFire.value = true;
|
||||
winBlink.value = true;
|
||||
|
||||
Reference in New Issue
Block a user