Hi guys, for this challenge I started using media queries, please if you have any comment/suggestion let me know.
Thanks!
Hi guys, for this challenge I started using media queries, please if you have any comment/suggestion let me know.
Thanks!
Hi @NicolasEiriz. Congratulations on the project! To be honest, I'm impressed with how accurate it looks.
I just wanted to point out that depending on the screen's size, your words will jump out of their container and stay above other words. You can see it if you use the "Dimensions" on DevTools.
I NEED CRITICISM TO HELP BULID MORE
Hi @korede1004, good work completing the challenge!
I also have some tips for you:
Instead of using img tags to put the images as the background you could use the background-image: url('./images/bg-pattern-bottom.svg')
. You can even add more than one image and the background color to the same element.
Think about adding the main tag to your HTML for accessibility purposes and wrapping the main content in it.
I saw that you have a padding-top to center the image, but depending on the screen size, it won't stay in the center. So, you could use flexbox. Once defined the container of the element, add display: flex; align-items: center; justify-content: center;
on this container and it will center all its direct children in the center on both axes.
Just an extra tip: you could use your body as the background/container of the card and build your card in the main tag.
Hope it helps!
My build is a bit messy - next challenge I will add proper comments. Learnt a lot about using flex, which was good! On to the next :)
Congratulations on your project, @vonsdesign!
Just a little tip, try to add cursor: pointer
on your button to show it's clickable (it will show a hand when you hover over it).
I had issues displaying the background image. Any feedback will be appreciated. Thank you!
Hi, @RalphJnr.
The background-image isn't showing because your "styles.css" is inside a folder. So, you have to add ../
at the beginning of your path (url) to go back a directory.
The way you're doing it, it's trying to find a images/pattern-background-desktop.svg
inside the folder "css".
Would definitely love to hear feedback about the button's shadow & ways to improve it, and the design overall. Thanks in advance!
Hi, @mmetwally0.
Instead of main .card-container .summary-box .payment a:hover
try main .card-container .summary-box .payment > a:hover
. It will change the color just of the payment's a
direct child. So, you won't have your payment-btn's a
changing its text color.
You could also add a transition
to make the change smoother.
Need some critic, what i need to add or repair? Thank you!
Hi @joopWU.
I saw your body
doesn't have a height. Therefore, its height is the same as the container
. So, to make it have all the screen's height as the height you might want to add min-height: 100vh
. With that, your body will have at least all the screen's height as its height. After that, you can add the background-color.
Doing that, your screen will seem a little bigger than the screen's height, tho. It's because, by default, some elements have a margin, and your body has a default margin of 8px on each side. So it's the screen's height plus 16px (8px in the top and 8px in the bottom).
You could reset this with body { margin: 0;}
or you could apply it to all elements using *
, it's up to you.
I tried doing that in your project with dev tools and it created a new issue. Your container will be stuck in the body's top and will add a margin to the top of the body instead of between the body and the container. If you want to know more about it you can click on this link Everything You Need To Know About CSS Margins. The "PARENT AND FIRST OR LAST CHILD ELEMENT" part shows exactly what will happen to your project and how to solve it.
So... If you add something like border: 1px solid transparent;
it might solve it. But it will make the body's height bigger than the screen's size again. It's because the height will be 100vh + 2px (1px each side). To avoid that you can set box-sizing: border-box
to all your elements (*) and they will have the size you set without adding anything more because of the padding or border.
But if you don't want to run into this issue, what I highly recommend is using flexbox to center your card. (still resetting the element's margin, setting box-sizing: border-box
and having the body's min-height as 100vh).
As the challenge is made for a desktop of 1440px and a mobile of 375px, I do not take into account the other resolutions so when you enter the page depending on the browser, screen resolution and the zoom you have on it, the size of the component may look "unstylized".
I think it's a good thing to make the website responsive to different screen sizes, even if it's just a challenge. I usually like to make it responsive and treat the challenge as a real project to improve my skills as a personal challenge (and also because I'm a perfectionist lol).
I just saw the challenge and it sees like it's necessary to style the other resolutions. In the "readme-template" there is a part that says:
Users should be able to:
- View the optimal layout for the app depending on their device's screen size
And just one last thing... If you didn't make it responsive because you didn't know if it was mandatory, you can just skip it but if you got stuck, I can help you:
width: min(360px, 100% - 64px)
. In this way, your card's width would always be the smallest value (a fixed value of 360px on big screens or the screen's width minus 32px (2rem) on each side for the margin on small screens).My first set of JavaScript codes. Comments on areas of improvement and best practices will be appreciated 🙏
Hi @Deen-Abdultawab, congratulations on the website. I would also advise you to...
Put the type of the input product-quantity
as number instead of text (in that case, you would have to hide the arrows that will come with that type to have the same appearence), because now, even if I can't submit a text, I still can write there;
You could also test if the product-quantity
has a value greater than zero, and just if so, decrease its value. Otherwise, your input can receive negative values;
minusBtn.addEventListener('click', () => {
if (productQuantity.value > 0) {
initialValue--;
productQuantity.value = initialValue;
}
})
I also saw you put cursor: pointer
on fa-solid, in that case, you could increase its padding to turn the clickable area bigger, making it easier for the user to click on it;
And at least, all your main-nav
has cursor: pointer
not just the clickable areas.
I hope it helps you.
Any feedback on any part I could have handled better or more efficiently is always valued an appreciated.
Thanks in advance 👏🏾
Nice job completing the challenge. I hope to help you with some advice about your code.
Like that:
rateBtns.forEach((btn) => {
btn.addEventListener("click", () => {
removeSelected();
btn.classList.toggle("selected"); // In this way, toggle will always add the class
yourRate = btn.innerHTML;
});
});
function removeSelected() {
rateBtns.forEach(btn => {
btn.classList.remove('selected');
})
}
yourRate != ""
, you could check whether any of the buttons in rateBtns has the class selected or not.Hope it helps you.
edited: I fixed the bug and now the codes are simplified!
This is my first Frontend Mentor JS challenge. I'm learning JavaScript but I realized it's still quite challenging for me to adapt what I learned into actual project, even for a small one like this.
I couldn't follow the DRY principle (Do not Repeat Yourself) and ended up writing a ton of codes that were repeated over and over again.
Please let me know if there is a better way to fix this :)
Nice job completing the challenge.
I would also advise you to put cursor: pointer in your buttons to show a hand when you hover over them and show it's clickable.