π This is a solution to the E-commerce product page challenge on Frontend Mentor.
π₯οΈ Welcome
Thanks for checking out this front-end coding challenge. Frontend Mentor challenges help you improve your coding skills by building realistic projects. To do this challenge, you need a good understanding of HTML, CSS and JavaScript. Press Enter π to start the game!!
- Brief
- The challenge
- Links
- My process
- Built with
- What I learned
- Difficult Things
- Author
- Acknowledgments
In this challenge, you'll build a beautiful product page. We'll be putting your JS skills to the test with a lightbox product gallery and cart functionality!
Your challenge is to build out this e-commerce product page and get it looking as close to the design as possible. You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go π.
Preview π
Users should be able to:
Challenge | Newbie | Junior | Intermediate | Advanced |
---|---|---|---|---|
View the optimal layout for the site depending on their device's screen size | β | |||
See hover states for all interactive elements on the page | β | |||
Open a lightbox gallery by clicking on the large product image | β | |||
Switch the large product image by clicking on the small thumbnail images | β | |||
Add items to the cart | β | |||
View the cart and remove items from it | β |
- Solution URL: Frontend Mentor Solution
- Live Site URL: Netlify
β I challenge my self to finish this for ~5 days
β
π§βπ» Day 1. Studying the design ~4 hours
β Sass boilerplate
β Import Frontend Mentor style guide
β HTML content and tags placement
β
π§βπ» Day 2. Web layouting, mostly working with Sass
β Navbar ~2.5 hours
β Main content (product images and information) ~2.5 hours
β Responsive design ~4 hours
β Sidebar & Cart pop-out ~3 hours
β Lightbox design ~2.5 hours
β
π Day 3. Working with React
β Continuing Lightbox design ~2 hours
β Lightbox & showcase images state ~1.5 hours
β Cart state ~7.5 hours
β Styling Cart's badge & Cart's backdrop ~3 hours
β Make hooks for Lightbox and image showcase ~1.5 hours
β
β±οΈ Day 4. Not doing any coding
β
π Day 5. Add little animation and submit solution to Frontend Mentor π©
β Sidebar ~0.5 hours
β Lightbox & image showcase ~3 hours
β Cart ~1.5 day
β Try to deploy & submit the solution
β
ποΈ Day 6 and forward. Continuing unfinished task
β Work with ngrok later
β Update README.md
β See other people solution and copy the css code
β Fix animation issue
β
ποΈ
βοΈ Prevent for showing leading zero after typing some number inside input
The value={input.toString()
prevent us for showing leading zero after typing some number
<input type="number" value={input.toString()} onChange={change} />
βοΈ Hide input slider
Hide HTML <input/>
slider
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type="number"] {
-moz-appearance: textfield; /* Firefox */
}
βοΈ Respect deadlines
Should have left some extra time for testing the production sites and write some documentation
Things were difficult for me and I finally gave up ππ
- HTML5 Semantic
- Not know how to positioning the icon
- Not know how to work with
<svg/>
- Can't use some css library for image slider
- Buggy
z-index
for button - Not writing a clean CSS code
- Fail to implement reset
input
after clicking 'Add to cart'
Berlianto |
---|
- Material-UI - For cart badge and icon