From ab38b3a18ed77736d6591b818b54029c8b0b2bcc Mon Sep 17 00:00:00 2001 From: log1997 <2694233102@qq.com> Date: Fri, 30 Jan 2026 11:20:48 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=F0=9F=90=9B=20=E9=99=90=E5=88=B6?= =?UTF-8?q?=E6=92=92=E8=8A=B1=E5=8A=A8=E7=94=BB=E6=95=B0=E9=87=8F=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E9=A1=B5=E9=9D=A2=E5=8D=A1=E9=A1=BF=E5=92=8C?= =?UTF-8?q?=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constant/config.ts | 1 + src/views/Home/useViewModel.ts | 5 +- src/views/Home/util.ts | 131 --------------------------------- src/views/Home/utils/table.ts | 7 +- 4 files changed, 8 insertions(+), 136 deletions(-) delete mode 100644 src/views/Home/util.ts diff --git a/src/constant/config.ts b/src/constant/config.ts index bf557ea..657f857 100644 --- a/src/constant/config.ts +++ b/src/constant/config.ts @@ -1 +1,2 @@ export const SINGLE_TIME_MAX_PERSON_COUNT = 30 +export const CONFETTI_FIRE_MAX_COUNT = 12 diff --git a/src/views/Home/useViewModel.ts b/src/views/Home/useViewModel.ts index 0598da5..cf1b464 100644 --- a/src/views/Home/useViewModel.ts +++ b/src/views/Home/useViewModel.ts @@ -11,7 +11,7 @@ import { useToast } from 'vue-toast-notification' import dongSound from '@/assets/audio/end.mp3' import enterAudio from '@/assets/audio/enter.wav' import worldCupAudio from '@/assets/audio/worldcup.mp3' -import { SINGLE_TIME_MAX_PERSON_COUNT } from '@/constant/config' +import { CONFETTI_FIRE_MAX_COUNT, SINGLE_TIME_MAX_PERSON_COUNT } from '@/constant/config' import { useElementPosition, useElementStyle } from '@/hooks/useElement' import i18n from '@/locales/i18n' import useStore from '@/store' @@ -623,8 +623,7 @@ export function useViewModel() { .start() .onComplete(() => { playWinMusic() - - confettiFire() + confettiFire(index, CONFETTI_FIRE_MAX_COUNT) resetCamera() }) }) diff --git a/src/views/Home/util.ts b/src/views/Home/util.ts deleted file mode 100644 index 1c3cea1..0000000 --- a/src/views/Home/util.ts +++ /dev/null @@ -1,131 +0,0 @@ -import type { IPersonConfig } from '@/types/storeType' -import confetti from 'canvas-confetti' -import { Object3D, Vector3 } from 'three' -import { filterData } from '@/utils' -/** - * @description 初始化表格数据 - * @param0 allPersonList 所有人的列表 - * @param1 rowCount 行数,默认是7行 - * @returns 表格数据 - */ -export function initTableData({ allPersonList, rowCount }: { allPersonList: IPersonConfig[], rowCount: number }): IPersonConfig[] { - let tableData: IPersonConfig[] = [] - if (allPersonList.length <= 0) { - return [] - } - const totalCount = rowCount * 7 - const allPersonLength = allPersonList.length - if (allPersonLength < totalCount) { - tableData = Array.from({ length: totalCount }, () => JSON.parse(JSON.stringify(allPersonList))).flat() - } - else { - tableData = allPersonList.slice(0, totalCount) - } - tableData = filterData(tableData.slice(0, totalCount), rowCount) - return tableData -} - -/** - * @description 横铺图形:处理数据,把每个卡片在界面的位置写入 - * @param0 tableData 表格数据 - * @param1 rowCount 每行有多少个元素 - * @param2 cardSize 卡片的大小 - * @returns Object3D[] - */ -export function createTableVertices({ tableData, rowCount, cardSize }: { tableData: IPersonConfig[], rowCount: number, cardSize: { width: number, height: number } }): Object3D[] { - const tableLen = tableData.length - const objects: Object3D[] = [] - for (let i = 0; i < tableLen; i++) { - const object = new Object3D() - - object.position.x = tableData[i].x * (cardSize.width + 40) - rowCount * 90 - object.position.y = -tableData[i].y * (cardSize.height + 20) + 1000 - object.position.z = 0 - objects.push(object) - // targets.table.push(object) - } - return objects -} -/** - * @description 创建球体 - * @param0 objectsLength 物体的个数 - * @returns Object3D[] - */ -export function createSphereVertices({ objectsLength }: { objectsLength: number }): Object3D[] { - let i = 0 - const resObjects: Object3D[] = [] - // const objLength = objects.value.length - const vector = new Vector3() - - for (; i < objectsLength; ++i) { - const phi = Math.acos(-1 + (2 * i) / objectsLength) - const theta = Math.sqrt(objectsLength * Math.PI) * phi - const object = new Object3D() - - object.position.x = 800 * Math.cos(theta) * Math.sin(phi) - object.position.y = 800 * Math.sin(theta) * Math.sin(phi) - object.position.z = -800 * Math.cos(phi) - - // rotation object - vector.copy(object.position).multiplyScalar(2) - object.lookAt(vector) - resObjects.push(object) - } - return resObjects -} - -export function confettiFire() { - const duration = 3 * 1000 - const end = Date.now() + duration; - (function frame() { - // launch a few confetti from the left edge - confetti({ - particleCount: 2, - angle: 60, - spread: 55, - origin: { x: 0 }, - }) - // and launch a few from the right edge - confetti({ - particleCount: 2, - angle: 120, - spread: 55, - origin: { x: 1 }, - }) - - // keep going until we are out of time - if (Date.now() < end) { - requestAnimationFrame(frame) - } - }()) - centerFire(0.25, { - spread: 26, - startVelocity: 55, - }) - centerFire(0.2, { - spread: 60, - }) - centerFire(0.35, { - spread: 100, - decay: 0.91, - scalar: 0.8, - }) - centerFire(0.1, { - spread: 120, - startVelocity: 25, - decay: 0.92, - scalar: 1.2, - }) - centerFire(0.1, { - spread: 120, - startVelocity: 45, - }) -} -function centerFire(particleRatio: number, opts: any) { - const count = 200 - confetti({ - origin: { y: 0.7 }, - ...opts, - particleCount: Math.floor(count * particleRatio), - }) -} diff --git a/src/views/Home/utils/table.ts b/src/views/Home/utils/table.ts index 1c3cea1..0e9d5f3 100644 --- a/src/views/Home/utils/table.ts +++ b/src/views/Home/utils/table.ts @@ -74,7 +74,10 @@ export function createSphereVertices({ objectsLength }: { objectsLength: number return resObjects } -export function confettiFire() { +export function confettiFire(index: number, maxLimit: number) { + if (index > maxLimit) { + return + } const duration = 3 * 1000 const end = Date.now() + duration; (function frame() { @@ -92,7 +95,7 @@ export function confettiFire() { spread: 55, origin: { x: 1 }, }) - + console.log('requestAnimationFrame') // keep going until we are out of time if (Date.now() < end) { requestAnimationFrame(frame) From 9d62eb6d360084bcc7ef817eba0b950e067c025c Mon Sep 17 00:00:00 2001 From: LOG1997 <2694233102@qq.com> Date: Sun, 1 Feb 2026 10:57:14 +0800 Subject: [PATCH 2/5] =?UTF-8?q?docs:=20=F0=9F=93=9D=20=E7=89=88=E6=9C=ACv0?= =?UTF-8?q?.6.0-beta3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 172c3d4..bf9f6ab 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "log-lottery", "private": true, - "version": "0.6.0-2", + "version": "0.6.0-3", "type": "module", "license": "MIT", "scripts": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 157616c..94aa331 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -77,7 +77,7 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "app" -version = "0.6.0-1" +version = "0.6.0-3" dependencies = [ "log", "serde", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index c529a38..4f386ea 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "app" -version = "0.6.0-2" +version = "0.6.0-3" description = "A Tauri App" authors = [ "you" ] license = "" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 70f29a8..5adb8d5 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "log-lottery", - "version": "0.6.0-2", + "version": "0.6.0-3", "identifier": "to2026.xyz", "build": { "frontendDist": "../dist", From 864037b2a83f196afa3094dd49831b0174a1272d Mon Sep 17 00:00:00 2001 From: wjrHh218 <2084945328@qq.com> Date: Thu, 5 Feb 2026 23:54:36 +0800 Subject: [PATCH 3/5] =?UTF-8?q?docs:=20=F0=9F=93=9D=20version=20v0.6.0-bet?= =?UTF-8?q?a4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index bf9f6ab..7aeded9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "log-lottery", "private": true, - "version": "0.6.0-3", + "version": "0.6.0-4", "type": "module", "license": "MIT", "scripts": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 94aa331..7155bd3 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -77,7 +77,7 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "app" -version = "0.6.0-3" +version = "0.6.0-4" dependencies = [ "log", "serde", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 4f386ea..f02c704 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "app" -version = "0.6.0-3" +version = "0.6.0-4" description = "A Tauri App" authors = [ "you" ] license = "" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 5adb8d5..3e63187 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "log-lottery", - "version": "0.6.0-3", + "version": "0.6.0-4", "identifier": "to2026.xyz", "build": { "frontendDist": "../dist", From 9bef75bbd7ba7205c33e9cc0f0ee54afcbe2e9f0 Mon Sep 17 00:00:00 2001 From: wjrHh218 <2084945328@qq.com> Date: Fri, 6 Feb 2026 00:03:02 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=F0=9F=90=9B=20=E5=8D=A1=E7=89=87sca?= =?UTF-8?q?le=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useElement/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useElement/index.ts b/src/hooks/useElement/index.ts index ba42343..5a4804c 100644 --- a/src/hooks/useElement/index.ts +++ b/src/hooks/useElement/index.ts @@ -176,13 +176,13 @@ const cardRule: CardRule = { }, 17: { maxLine: 6, - scale: 1.8, + scale: 1.6, rule: [5, 6, 6], length: 3, }, 18: { maxLine: 6, - scale: 1.8, + scale: 1.6, rule: [6, 6, 6], length: 3, }, From 07d0948ea7741bd890bd097dee0f2fc2b995a316 Mon Sep 17 00:00:00 2001 From: wjrHh218 <2084945328@qq.com> Date: Fri, 6 Feb 2026 00:04:00 +0800 Subject: [PATCH 5/5] =?UTF-8?q?docs:=20=F0=9F=93=9D=20version=200.6.0-beta?= =?UTF-8?q?5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7aeded9..66bb3e3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "log-lottery", "private": true, - "version": "0.6.0-4", + "version": "0.6.0-5", "type": "module", "license": "MIT", "scripts": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 7155bd3..afb3a48 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -77,7 +77,7 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "app" -version = "0.6.0-4" +version = "0.6.0-5" dependencies = [ "log", "serde", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index f02c704..c6c970b 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "app" -version = "0.6.0-4" +version = "0.6.0-5" description = "A Tauri App" authors = [ "you" ] license = "" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 3e63187..592f877 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "productName": "log-lottery", - "version": "0.6.0-4", + "version": "0.6.0-5", "identifier": "to2026.xyz", "build": { "frontendDist": "../dist",