feat: enhance lottery system with participant import and prize config

- Fix ES module import issue in admin.service.ts (require -> import)
- Fix lottery reveal ghosting by hiding name particles on complete
- Add participant import from Excel with tag calculation
- Add prize configuration service with JSON persistence
- Constrain winners overlay to scroll area dimensions
- Fix macOS lsof syntax in stop script
- Add HorseRace view and renderer (WIP)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
empty
2026-01-23 12:20:45 +08:00
parent 35d77cbb22
commit a442d050e4
23 changed files with 2523 additions and 325 deletions

View File

@@ -237,6 +237,19 @@ export class LotteryMachine {
* Start the lottery - transition to Galaxy phase
*/
startGalaxy(): void {
// Clear previous round's reveal display
this.winners = [];
this.confettiParticles = [];
this.revealContainer.removeChildren();
this.scrollContainer.removeChildren();
this.confettiContainer.removeChildren();
this.dimOverlay.clear();
// Reset particles
this.nameParticles.forEach((p) => {
p.isWinner = false;
});
this.phase = 'galaxy';
this.phaseTime = 0;
this.onPhaseChange?.('galaxy');
@@ -542,8 +555,18 @@ export class LotteryMachine {
// Spawn confetti when reveal is complete
if (this.revealProgress >= 1 && this.phase === 'reveal') {
this.phase = 'complete';
// Hide all name particles to prevent ghosting
this.nameParticles.forEach((p) => {
if (p.text) {
p.text.alpha = 0;
p.text.visible = false;
}
});
this.spawnConfettiBurst();
this.createWinnerDisplay();
// Don't create Pixi winner display - Vue overlay handles it
// this.createWinnerDisplay();
this.onWinnersRevealed?.(this.winners);
this.onPhaseChange?.('complete');
}