feat: implement 3D trophy achievements system and duel support#82
feat: implement 3D trophy achievements system and duel support#82Manaswin05 wants to merge 2 commits into
Conversation
Here's the Screen recording of the websiteScreen.Recording.2026-07-18.203407.mp4Hope you like this😊 |
|
@Manaswin05 This is so awesome man, really nice work |
|
Thanks for the compliment. I am interested to see more😊 |
|
@Younesfdj I have reviewed and tried to fix the merge conflicts, Hope it works now |
|
@Manaswin05 Hey again, the implementation had costs, I couldn't ship on a mobile-heavy site: three/fiber/drei added ~273KB gz to every page, the GLBs were 20MB (the cursor ball alone preloaded 5.4MB for every visitor), and the always-on cursor + per-trophy WebGL canvases hurt performance. So I kept your feature and rebuilt the rendering: the models are now pre-baked into looping sprite sheets (a script renders each GLB's rotation once, headless), so the trophies and ball look the same but cost ~3MB of cached images and zero runtime 3D. The cursor became an opt-in toy. a ball resting in the corner; click to dribble it as your cursor, right-click to put it back. Award logic moved to a single tested module, and in duels each player now showcases the trophies they've earned rather than the duel awarding them. It lives on #88 the landing commit is authored to you, since the concept and original build are yours. Still polishing the UI before it ships. What do you think of the direction? |
|
Here I did some study regarding this using AI here's some things i would like to share :
1. Progressive Enhancement (Probably my favorite)Instead of loading Three.js for everyone,
Something like
This gives the best experience without punishing everyone. 2. Lazy Load EverythingOne of the biggest issues mentioned was
That can be avoided. Instead of
use
or dynamically import the GLB only after the user enables it. Even better:
Now 99% of visitors never download it. 3. One Shared WebGL CanvasThe maintainer also mentioned
If every trophy creates
that's expensive. Instead
or
This dramatically reduces memory. 4. Compress GLBs20MB is huge. Most GLBs can become
using
Example
or
Many production sites do this. 5. Don't PreloadInstead of
load
using
Users may only ever download one or two trophies. 6. InstancingIf several trophies share geometry, Three.js supports
which renders many copies in one draw call. Much faster than multiple meshes. 7. Render Only When NeededMany Three.js apps render
Instead
This saves a lot of battery. 8.
|
|
@Manaswin05 Really appreciate the breakdown. The sprites are the pre-rendered output of the models, so visual quality is identical at the sizes we display (100–140px). Keeping it sprites-only for this release. Genuinely glad to have you reviewing the PR, and you're more than welcome to jump in on it, or grab anything else that interests you: the trophy system has a real roadmap ahead (repeat trophies, new award types), and I'd be happy to have you build on what you started. PR #88 is where we will work from now on, it stays as a draft until its ready. |
|
@Younesfdj I got it clearly, just need a clarity of what am I supposed to do there. I am ready to implement it. |
📝 Overview
Implements a dynamic, interactive 3D Trophy Achievements System for GitFut. Developers earn premium 3D trophies based on their GitHub stats, rendered in real-time WebGL using React Three Fiber. Full integration across individual profiles and VS/Duel matchups.
🚀 Key Features
🏆 Achievements & Awards
📱 Cross-View Integration
🛠️ Bug Fixes
useGLTFin global cursor froze page mount<Suspense fallback={null}>useMemo(() => scene.clone())SHO/DEFvssho/def)📁 New Files
components/Trophy3D.tsx— Reusable 3D trophy renderercomponents/CustomPointer.tsx— Site-wide 3D football cursorpublic/3D-Models/*.glb— 3D model assets📁 Modified Files
ResultView.tsx— Achievements sidebar + award modalsDuelView.tsx— Achievements header panel + tie rules + modalslayout.tsx— CustomPointer with SuspenseBackground.tsx— Gold ambient glowglobals.css— rise-soft animation keyframesREADME.md— Documented Achievements systempackage.json— Added three, @react-three/fiber, @react-three/drei