@mark-gardner74
Posted
Hi,
You can make it more responsive using flexbox, easy to swap between flex-direction to make things easier to reuse. Your code is solid, very solid for a beginner in JS, must be some other programming in the past.
One tip and it is really the one that I swear by. Mobile-first. You define everything to work on mobile. Even to the extent of trying a fixed screen width of 375px for the first attempt. Design and code the mobile version and then add breakpoints (media queries) for 768px and 1024px (possibly 1440px). When you design mobile-first you will only ever be changing the bits that need changing not scaling down to a lesser screen size.
Secondly, when you design mobile-first you can see which elements of code you can group together in flexbox/grid for when you scale up. In this example the card details / main section start in mobile as flex-direction: column and then switch to row. Once you have defined something, you only need to change the bits you want to override.
Great attempt and good luck with the next one.
Marked as helpful
@mark-gardner74 Please accept my heartiest thanks for your feedback Mark. I am sure you wouldn't mind answering my couple of queries. They might be very helpful for a beginner like me.
-
Do I need to write media queries for all four device widths? I mean isn't there any way I can reduce my CSS?
-
Since you have appreciated my JS code, I would like to know if you feel my JS knowledge and fundamentals are good enough to start learning a framework or should I stick with JS for the time being?
Will be waiting for your helpful feedback.
Regards.
@mark-gardner74
Thanks a lot Mark for your insightful feedback. I am sure you wouldn't mid responding to a couple of queries of mine. They might be very helpful for a beginner like me.
- Is there a way I can reduce my CSS that has gone long due to the media queries or should I write media query for every device width?
- Since you have taken a look at my JS code, do you feel my fundamentals and knowledge is good enough to try my hands on a framework or should I continue to stick with Vanilla JS?
Waiting for your helpful feedback. Regards.