Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

My first advance challenge in React JS

react, animation
Edward Montoya•200
@edward-montoya
A solution to the Connect Four game challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

What I'm Most Proud Of:

In completing the Connect Four challenge, I'm particularly proud of how I tackled the game's logic and user interface. Implementing the core gameplay mechanics from scratch was both challenging and rewarding, allowing me to dive deep into problem-solving and algorithmic thinking. I successfully created a responsive, intuitive user interface that enhances the player experience, making the game accessible and enjoyable for users of all ages. Overcoming these challenges has not only bolstered my technical skills but also my confidence in managing complex project requirements.

What I Would Do Differently Next Time:

Reflecting on the project, one area I aim to improve for future work is the overall structure and organization of my codebase. While the application's size was relatively small, making the component architecture more scalable and maintainable is something I'd prioritize in my next project. Specifically, I plan to implement a cleaner component structure, utilizing a dictionary for state management and a token library for consistent styling across the app. This approach will not only streamline development but also facilitate easier updates and potentially collaborative efforts, ensuring that the codebase remains robust and flexible as the project evolves.

What challenges did you encounter, and how did you overcome them?

One of the most significant challenges I encountered during the development of the Connect Four game was implementing the animations for the game chips. Initially, I was unsure how to realistically convey the motion of the chips falling into place on the board after a user's action. The crux of the issue lay in creating a smooth and visually appealing animation that enhanced the gameplay experience without compromising the performance or the responsiveness of the application.

To address this challenge, I opted for a stack-based approach to manage the game chips' animations. I pre-rendered all the chips at the top of the screen, invisible to the player. Upon a player's action, the application dynamically changes the opacity and the vertical position (y-axis) of the corresponding chip, simulating the effect of the chip falling into place. This method not only provided a seamless animation that contributed positively to the user experience but also allowed for a straightforward implementation that maintained the game's performance.

What specific areas of your project would you like help with?

Animations Animations can greatly enhance the user experience but can be tricky to get right, especially in dynamic web applications like games.

Hook Handling Hooks are a cornerstone of functional React components, offering a way to use state and other React features without writing the logic on the component.

React Router React Router is vital for adding navigational components to your application, but it can be complex, especially when dealing with nested routes or protected routes.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Edward Montoya's solution.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit 1st-party linked stylesheets, and styles within <style> tags.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.