Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Interactive Rating Component using vanilla JS

Martin 40

@MCoton

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Most difficult, reviving my very rusty JS. It could definitely be cleaner, any (constructive) feedback on my JS is welcome.

Still unsure of Aria but that's a work of in progress. I doubt my (out of scope) alert to pick a value will be very accessible, advice on how to handle this better would be good.

EDIT: Have applied the suggestions from the comments section. An updated version has now been pushed to GitHub.

Community feedback

Adriano 34,090

@AdrianoEscarabote

Posted

Hi Martin, how are you? I really liked the result of your project, but I have some tips that I think you will enjoy:

To align some content in the center of the screen, always prefer to use display: flex; it will make the layout more responsive!

Example:

body {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

To improve the code structure wrap this div:

<div class="attribution">

with the semantic tag footer

The rest is great!

I hope it helps... 👍

Marked as helpful

0

Martin 40

@MCoton

Posted

@AdrianoEscarabote. Two great suggestions, I'll be adding the semantic markup as suggested from now on.

You are the second to point me at Flex, I think I need to take your advice onboard and start using it properly throughout these challenges.

Thanks!

1
Tomek 240

@qntek

Posted

Hi there. Well, You could add underneath that window hidden paragraph with css value visibility = 'hidden'; It's content could be a message to pick one of those buttons. So:

if (!value) { paragraph.style.visibility = 'visible'; } else display thankyou window.

Marked as helpful

0

Martin 40

@MCoton

Posted

@qntek Hi Tomek, yeah I thought about that after I had submitted it, it's good to have the thought confirmed, thank you.

0

Please log in to post a comment

Log in with GitHub
Discord logo

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