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 comments

  • @KarenMascarenhasLourenco

    Submitted

    Is my code understandable?

    Did I use the semantic HTML tags correctly, should I add more or less?

    In what areas of my code can I improve on?

    All feedback is greatly appreciate. It helps me to improve as a frontend developer. Thanks!Is my code understandable?

    Did I use the semantic HTML tags correctly, should I add more or less?

    In what areas of my code can I improve on?

    All feedback is greatly appreciate. It helps me to improve as a frontend developer. Thanks!

    Goran 500

    @GoranK89

    Posted

    Hello Karen!

    The original design has rounded edges and a box shadow, you can add those to the <main> element. Other than that good work! 👍

    Marked as helpful

    1
  • Goran 500

    @GoranK89

    Posted

    This is not a helpful comment but I have to say, you have very clean and readable code! 👍

    Marked as helpful

    0
  • Shreyas 20

    @nairobi02

    Submitted

    Highly dependent on flexbox, and I honestly don't know how i would make these layouts without it. Is that something I need to worry about? There are many event listeners here, one for each button, that would affect performance, Is that something I need to worry about? What are some best practices to avoid the above?

    Vanilla JS

    #sass/scss#parcel

    2

    Goran 500

    @GoranK89

    Posted

    Hello Shreyas,

    you don't need to worry about flexbox, it's made to make your CSS life easier. Regarding the event listeners, they are fine for small apps like this, but if you are concerned about performance, you can check out the so-called 'event bubbling' on MDN-docs, you can research and experiment with that in your future projects. Cheers!

    0
  • HaYeong 100

    @hypyeon

    Submitted

    Hi y'all..

    I learned so much about JavaScript through this challenge. I learned how to code about a year ago but I wasn't consistent with my practice. While solving this challenge I realized how much I've forgotten and that I lacked practical skills.

    For JS, I have these questions, if I may...

    • Overall, I believe there are functions that would make my coding more concise and less of so many repeated ones. If you have any advice, I welcome anything!
    • Can't seem to come up with how to '.toFixed(2)' bill amount. I want it where after you put amount and click elsewhere, it shows you rounded amount with 2 decimal places.
    • Couldn't figure out how to make results change according to the change of 'bill' and 'number of people', so I had to make it undo the 'tip selector' button as you change value of them so that after that you can 're-type' to see the results. Otherwise the previous result will remain with different button selected, if this makes sense.
    • How do I eliminated the arrow buttons that are automatically inside 'input[type=number]'? I tried '-moz-appearance: textfield;' and such, but it keeps getting reported as 'problems'.

    I was really excited to solve this challenge, as I have only focused on HTML and CSS so far. I want to get better at JS quickly so any advice will help! :) Cheers!

    Goran 500

    @GoranK89

    Posted

    Hello HaYeong,

    the calculator works, well done. Now for the JS part, I would recommend you try the forEach loop on all buttons except the custom one. What I mean is a setup something like this:

    First the HTML setup for the buttons

                <input
                  type="button"
                  value="5%"
                  class="btn-tip"
                />
                <input
                  type="button"
                  value="10%"
                  class="btn-tip"
                />
    

    Now we can gather all the buttons in JS and run a loop over them:

    const tipButtons = document.querySelectorAll('.btn-tip');  // all the buttons
    
    tipButtons.forEach(btn =>
      btn.addEventListener('click', function (e) {
    
        // on every clicked button remove the % symbol, only the value remains, store it in a variable
        const clicked = e.target.value.slice(0, -1); 
    
          // some sample calculations you can do with the "clicked" variable
          const billPerPerson = billAmmount.value / peopleNum.value;
          const tipPerPerson = (billPerPerson / 100) * clicked;
          const totalToPay = billPerPerson + tipPerPerson;
        
          // finally displaying the desired calculations example
          tipAmntPerPerson.textContent = '$' + tipPerPerson.toFixed(2);
        }
      })
    );
    

    You can also add some if/else statements inside the loop so for example calculations for "people < 1" are not done. This will probably shorten your code by 90% and clean it up a lot. Hope this was helpful and keep at it!

    Marked as helpful

    0
  • Skye Brown 110

    @skyebrownh

    Submitted

    Tried using CSS Grid but kept seeing some extra bottom padding in the "Join our community" section on desktop. Setting a fixed height did not fix the issue, so I transitioned to use Flexbox instead.

    I wasn't able to get a box shadow working for the main card (although I was able to get it for the button), not really sure why so any tips on that would be helpful!

    Goran 500

    @GoranK89

    Posted

    Hello Skye! Regarding the box-shadow, you can wrap ".community" and ".bottom-wrapper" together into a new div and apply a shadow to that, or you can just apply it to the main html element. Other than that minor detail it looks great!

    0
  • Goran 500

    @GoranK89

    Posted

    Looks good so far! I would add more space around the titles and text, and the overall shape should come close to the example picture.

    0