Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Responsive Grid with Vanilla Javascript

P
Haydn Kerr•555
@haydnkerr
A solution to the Memory game challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


This is one of the funnest challenges I've done so far on Frontend Mentor. I gave myself a weekend to complete this and I succeeded meeting this time constraint. Some of the aspects that gave me the most trouble was the size of the logic involved when alternating between different grid sizes, players and themes. Also figuring out the winners for the end screen and ordering them took a lot more problem solving than I thought it would.

Overall this functions exactly how I want to and I even took it a step further to add a flip animation to each of the tiles when chosen.

Some things I need to consider for debugging are:

  1. If the user spams a single button then they will rack up points and in turn finish the game. I'm thinking I'll just add a class that blocks a button being chosen.
  2. There are some styling features I need to change for responsiveness; mainly font-size

In the future, and as much as I love vanilla JS, I really want to learn some JS frameworks to make this process a bit more efficient so open to any suggestions on where I should start

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Haydn Kerr'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