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

FlexBox, JavaScript, 3D

Jair Rodriguezβ€’ 310

@Jairth

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


Many thanks to @AdrianoEscarabote for his help, I was able to complete the challenge.

Community feedback

Adrianoβ€’ 34,090

@AdrianoEscarabote

Posted

Hi Jair Rodriguez, how are you?

I really liked the result of your project, but I have some tips that I think you will enjoy:

I will try to help you with your problem!

I analyzed your code! To start I will get the buttons by the class so it will look like this:

const numbers = document.querySelectorAll(".span");

I removed this:

// const uno = document.querySelector("#uno")
// const dos = document.querySelector("#dos")
// const three = document.querySelector("#three")
// const four = document.querySelector("#four")
// const five = document.querySelector("#five")

and also removed the function called scaner!

I added this:

numbers.forEach((element) => {
    element.addEventListener("click", () => {
        selected.innerText = `You selected ${element.innerText} out of 5`
        submit.addEventListener("click", () => {
            wrapper.style.transform = "rotateY(-180deg)";
        });
    })
})

I added the submit event inside the other, to create a scheme that as long as the user doesn't click on the number, the submit button won't work!

Another tip is about the color of the buttons:

instead of using this function:

numbers.forEach((num) => {
    num.addEventListener("click", function click() {
        num.setAttribute("style", "background : hsl(217, 12%, 63%); color: white");
    });
});

use this:

.span::focus { background-color: white; }

Tell me if it was easy to understand ahuauahuah

The rest is great!

I hope it helps... πŸ‘

Marked as helpful

0

Jair Rodriguezβ€’ 310

@Jairth

Posted

@AdrianoEscarabote Thank you very much! I see that I was close to the answer, I had tried your method but I failed in some statements. Thank you very, very much!

1
Adrianoβ€’ 34,090

@AdrianoEscarabote

Posted

@Jairth no problem! keep coding!!

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