feat: add Three.js splash screen on app startup#48
Merged
Conversation
Add a full-screen animated splash screen that displays during app initialization. The splash shows a constellation particle field with a slowly rotating wireframe icosahedron behind the "Scripta" wordmark. The splash remains visible until both the store initialization completes and a minimum 2-second display time has elapsed, then fades out smoothly. Implementation follows the Clean architecture pattern with clear separation of concerns: - lib/constants.ts: configuration constants - lib/createScene.ts: pure Three.js scene factory - hooks/useSplashLifecycle.ts: lifecycle state machine - hooks/useThreeScene.ts: React ↔ Three.js bridge - ui/SplashScreen.tsx: overlay component Three.js is loaded via dynamic import() for automatic code-splitting, keeping it out of the main bundle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a full-screen animated splash screen that displays during app initialization. The splash shows a constellation particle field with a slowly rotating wireframe icosahedron behind the "Scripta" wordmark.
Changes
New files (6)
src/features/splash/lib/constants.ts— Configuration constants (particle count, colors, timing)src/features/splash/lib/createScene.ts— Pure Three.js scene factory (particles + connection lines + wireframe icosahedron)src/features/splash/hooks/useSplashLifecycle.ts— Lifecycle state machine (active → fading → done)src/features/splash/hooks/useThreeScene.ts— React ↔ Three.js imperative bridge with dynamic importsrc/features/splash/ui/SplashScreen.tsx— Full-screen overlay component with fade-out transitionsrc/features/splash/index.ts— Public API barrel exportModified files (2)
src/app/providers/store-provider.tsx— ExportstoreInitPromisefor splash timing coordinationsrc/main.tsx— Add<SplashScreen />as overlay siblingDependencies
threeand@types/threeArchitecture
Follows the Clean architecture pattern with clear separation of concerns:
Behavior
Technical Notes
import()— separate Vite chunk, not in main bundle