Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 6 months ago

Responsive Hangman Game App

accessibility, next, react, tailwind-css, typescript
Victor Eleanya•780
@mrvicthor
A solution to the Hangman 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?

I am proud of the logic to hide the letters. Being a self-taught developer, it was particularly challenging to fix some of the bugs I encountered when implementing the logic to hide random letters. I am happy that I manage to fix them.

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

Logic to hide random letters.

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

I will like a code review, if possible. I intend to refactor the code overtime.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Sara Dunlop•450
    @Risclover
    Posted 6 months ago

    Hey Victor! Some things you might want to consider figuring out when you refactor in the future that I noticed while testing your solution:

    • You're lacking spaces in between words. As you have it now, there are no spaces, which smooshes the words together, making it look like one word. For example, Orange is the new black looks like orangeis thenew black or orangeisthe newblack, depending on the screen size.
    • As we discussed over in my solution, you're not supposed to reveal the letters like you're doing in a traditional game of Hangman. I think you're making it way too easy on the player by doing that, and you're taking away half of their game lol 😊
    • When the player tries to guess an incorrect letter, although the 'lives' meter goes down like it should, the letter doesn't get disabled to indicate that the user has already guessed that letter. The only time the letters get disabled are when the player guesses a letter correctly, so the player is able to guess a letter incorrectly multiple times, which shouldn't be the case.
    • It looks like your lives meter might contain an extra life, I think? The meter goes down to 0 and then on the NEXT guess, the game ends. It should end right when the meter hits 0, not the turn after.

    Overall, nothing too big. Good job.

    Marked as helpful
  • Tsotne Meladze•1,120
    @tsotneforester
    Posted 2 months ago

    You are smart guy! at first I also intended to export how to play, pick a category and etc... as ** .svg** files, but then I could somehow (AI helped a lot) manage to create componenet that renders that texts correctly. here is css code:

    h1 {
    line-height: 120%;
      text-align: center;
      background: linear-gradient(180deg, #67b6ff 16.42%, #ffffff 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
      display: block;
      position: relative;
    
      &:before,
      &:after {
        content: 'Pause';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        line-height: 120%;
        text-align: center;
        background: linear-gradient(180deg, #67b6ff 16.42%, #ffffff 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
      }
    
      &:before {
        z-index: 1;
        -webkit-text-stroke: 10px #2c3342;
      }
    
      &:after {
        z-index: 2;
      }
    }
    

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.

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