GithubHelp home page GithubHelp logo

fem-product-page's Introduction

Frontend Mentor - E-commerce product page solution

This is a solution to the E-commerce product page challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • 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

Screenshot

desktop view mobile view desktop cart view mobile cart view

Links

My process

In this challenge, I set out to use Tailwind and TypeScript, which are tools I've been delving into recently. The experience with Tailwind was very satisfying, and I plan to continue using it. In TypeScript, I have my doubts about whether I'm following the best practices, but I put in my best effort to achieve it and I will continue to study it more thoroughly to get the most out of it.

While I had already used Custom Hooks and Context in React for my solution to the Todo app, this time I also decided to put them into practice. For example, I used Context for managing the cart, although I did this with more of a future-oriented mindset, thinking about a more 'real' application where I might need to access the cart from other parts of my application.

Regarding the Custom Hooks, I implemented one for cart functionalities and another for being able to close the cart, the navigation menu, and the product modal when clicking outside. My idea was to avoid repeating the code in every place I wanted to implement this functionality.

Built with

Note: These are just examples. Delete this note and replace the list above with your own choices

What I learned

I learned that it's not recommended to nest a <nav> element within a <header> element.

I discovered the importance of self-hosting web fonts for better web performance.

How to create a hamburger menu.

How to use window.innerWidth property in React to dynamically adapt your user interface, such as hiding/showing the hamburger icon and navigation items based on the window width.

How to create a carousel component using only ReactJS and TailwindCSS, without relying on external libraries.

How to implementing a shopping cart using React and TypeScript. I utilized Context to manage the shopping cart's state and display a badge indicating the quantity of products in the cart.

I leveraged Headless UI to modify a modal component and create an overlay carousel.

Continued development

I would like to take all this learning and apply it to the creation of a more comprehensive and realistic e-commerce solution

Useful resources

Author

fem-product-page's People

Contributors

martinorue avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.