feat: add race start countdown animation with 3-2-1-Go sequence#89
feat: add race start countdown animation with 3-2-1-Go sequence#89nitin-999-code wants to merge 1 commit intoAnkit-raj-11:mainfrom
Conversation
|
@nitin-999-code is attempting to deploy a commit to the ankit-raj-11's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a race start countdown animation with a 3-2-1-Go sequence for enhanced user experience. The countdown includes visual effects, sound effects, and prevents typing until the race begins.
- Implements a reusable countdown component with visual and audio effects
- Integrates countdown into both race and practice pages with proper state management
- Makes Firebase optional for development environments to improve developer experience
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/soundEffects.js | New utility for Web Audio API-based countdown sound effects |
| src/components/CountdownAnimation.js | New countdown component with visual animations and particle effects |
| src/pages/race.js | Integrates countdown into race page with state management updates |
| src/pages/practice.js | Integrates countdown into practice page with state management updates |
| src/firebase.js | Makes Firebase configuration optional for development |
| src/context/AuthContext.js | Handles graceful fallback when Firebase is disabled |
Comments suppressed due to low confidence (1)
src/pages/race.js:1
- The dependency array includes
onCompletebut this variable is not defined in the component scope. This should likely be removed from the dependencies or the variable should be defined.
import { useState, useEffect, useRef } from "react";
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| gainNode.gain.setValueAtTime(0.3, this.audioContext.currentTime); | ||
| gainNode.gain.exponentialRampToValueAtTime(0.01, this.audioContext.currentTime + 0.2); |
There was a problem hiding this comment.
Using exponentialRampToValueAtTime with 0.01 can cause issues in some browsers as the value approaches zero. Consider using linearRampToValueAtTime or a minimum value like 0.001 instead.
|
|
||
| // Longer, more prominent sound for "GO!" | ||
| gainNode.gain.setValueAtTime(0.4, this.audioContext.currentTime); | ||
| gainNode.gain.exponentialRampToValueAtTime(0.01, this.audioContext.currentTime + 0.5); |
There was a problem hiding this comment.
Using exponentialRampToValueAtTime with 0.01 can cause issues in some browsers as the value approaches zero. Consider using linearRampToValueAtTime or a minimum value like 0.001 instead.
|
can you please review my PR |
share the screenshots or video. |
Screen.Recording.2025-10-13.at.9.08.31.PM.mov |
|
Make the transitions look like scale up the fade before moving to next sequencies, and I the animation should auto when user enter "/race" page, and one more additional request make sure the countdown will auto start when animation ends. |
Description
Implements cool race start animation with countdown as requested in #87
Features Added
Files Changed
Testing
/raceor/practicepageCloses #87