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

All solutions

  • Submitted


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

    I used a simple for-loop to log the rating as the user clicks the buttons.

    let rating;
    for (const numButt of numbers) {
        numButt.addEventListener("click", () => {
            rating = numButt.textContent;
        })
    }
    

    Next time I would probably try event delegation to add event listeners to the buttons. I learned about that only after I had completed that part of the code and didn't want to redo it.

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

    The most challenging part for me was to get the thank you state to show up, while getting the rating state to disappear. In the end, I used Element.classList.remove() and Element.classList.add() to remove and add the "hidden" property. I also prevented the default behavior of the submit button if the user had not provided a rating.

    submitBtn.addEventListener("click", (ev) => {
        if (rating === undefined) {
            console.log("No rating");
            ev.preventDefault;
        } else {
            thx.classList.remove("hidden");
            ratCard.classList.add("hidden");
            output.textContent += `You selected ${rating} out of 5`;
        }
    });
    
  • Submitted


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

    I used the clamp() function to scale the padding in the card section and it ended up working well. The padding is about 5 % of the element width, but no less than 20 px or more than 30 px.

    Another part I'm proud of is the transition property in the link buttons. The background and text color transition smoothly to the active states, with the text color transitioning slightly faster.

    transition: background-color 500ms linear,
                    color 400ms linear;
    

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

    My biggest challenge was to get the profile picture centered horizontally. I had to test various margins to get it right.

    Another difficult part was the card width. I tried to make it scale dynamically, but that didn't look right. In the end I decided to make it just 350 px.

  • Submitted


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

    Mostly I am proud of the mobile page I made using media query. It was a fun experiment that ended up working just like I intended.

    @media only screen and (max-width: 480px) {
        body {
            margin: 0;
        }
    
        main {
            width: 100%;
            margin: 0px;
            border-radius: 0%;
            padding: 0 0 30px;
        }
    
        img {
            display: block;
            border-radius: 0%;
            margin: 0;
            width: 100%;
            height: auto;
        }
    }
    

    Next time I would try to shorten the style.css, as it got quite long.

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

    First I had problems with getting the main element to display properly. The problem was solved when I realised I had set the page height too small.

    The next major problem was with the mobile page. I couldn't get the image to display at the top of the page, but ultimately I just had to tweak padding and margins a bit.

  • Submitted


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

    I chose to utilise the HTML table element in my solution for the plan info box. Next time I might try using CSS grid to achieve the same results.

  • Submitted


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

    I had problems in aligning the card to the center of the page, and getting the image to resize properly. I solved the problems after tinkering with the flexbox properties.