ChillDiv Olympics
Inspiration
The idea for ChillDiv Olympics came from the often frustrating experience of trying to perfectly center a div during web development. We wanted to turn this universal developer pain point into a lighthearted and engaging challenge. The quirky humor of Chill Guy and the gamified progression were inspired by the hilarious comments we hear in coding communities and the endless pursuit of precision in UI design.
What it does
ChillDiv Olympics is an interactive game where players attempt to center a div as accurately as possible across five progressively challenging levels. Precision is judged in real-time, and Chill Guy provides comedic feedback to keep the experience fun. The game tracks average scores and rewards players with playful titles like "Div Wizard" or "Div Master Supreme."
How we built it
Frontend Stack:
- React & TypeScript were used to manage the app's state and components in a structured and type-safe way.
- Tailwind CSS for styling and ensuring responsiveness.
- GSAP for smooth animations and transitions.
- React & TypeScript were used to manage the app's state and components in a structured and type-safe way.
Game Mechanics:
- Used
getBoundingClientRect()for precision calculations of div centering. - React’s
useStateanduseEffecthooks were employed to handle game state and level progression. - Levels were designed with increasing complexity, introducing scaling, decoy divs, and hidden elements.
- Used
UI Design:
- Modern and playful UI with clear, concise elements that ensure the game is visually appealing and accessible.
- Included a humorous and interactive element with Chill Guy’s feedback.
- Modern and playful UI with clear, concise elements that ensure the game is visually appealing and accessible.
Challenges we ran into
- Precision Calculations:
Fine-tuning the scoring algorithm to ensure fair and accurate results required meticulous debugging. - Balancing Humor and Usability:
Crafting Chill Guy's feedback so it was both funny and motivating without being too repetitive. - State Management:
Managing state for the game’s progress across multiple levels, ensuring a smooth experience without unnecessary re-renders. - Responsive Design:
Ensuring the game worked seamlessly across different screen sizes and input methods was a tricky but rewarding challenge.
Accomplishments that we're proud of
- Created an interactive game that’s both educational and fun, turning a mundane task into an engaging activity.
- Successfully implemented animations and effects that enhance the user experience.
- Crafted a UI that is not only functional but visually appealing and accessible to all users.
What we learned
- Mastered React hooks (
useState,useEffect,useReducer) to manage complex game logic. - Gained experience using GSAP for smooth animations in React.
- Learned how to fine-tune state management and optimize rendering in React applications.
What's next for ChillDiv Olympics
- New Levels and Modes: Introduce more levels with diverse challenges like time-limited modes or multiplayer competitions.
- Leaderboards: Add a global leaderboard to foster competition and engagement.
- Community Features: Let users share their scores and funniest Chill Guy quotes on social media.
- Mobile App: Expand the game to mobile platforms for a broader audience.
With ChillDiv Olympics, we’ve not only embraced the chaos of centering divs but also shared the laughs along the way. It's a game for developers, by developers, and a nod to the quirks of our profession.
Tracks: Chill Guy and Center the div
Built With
- gsap
- react
- typescript
Log in or sign up for Devpost to join the conversation.