Skip to content

Product carousel with filters. Click next or previous to move around the slider, select an item or filter the items by searching, price range or item type

License

Notifications You must be signed in to change notification settings

david-lorenzo-vargas/vanilla-js-carousel

Repository files navigation

Product carousel with filters

Table of Contents

  1. Description
  2. Technologies
  3. Demo
  4. Installation and viewing
  5. Implementation, observations, other notes

Description:

The app consist of a carousel of products and 3 filters: search, price range and types. All the 3 filters can be applied in different combinations together.
When the user clicks to an item in the carousel, there is a pop-up with item details and a link to the product page.
For the large screens, there is also a navigation bar implemented, so that the user can go through the collection using navigation dots.

Technologies:

JavaScript, CSS, HTML, Webpack, Babel, Eslint, Autoprefixer, Stylelint.

Demo:

  1. Mobile version

new look mobile

  1. tablet version

new look tablet

  1. Responsive

new look responsive

  1. Slider functionality

new look slider

  1. Item pop up

new look popup item

  1. Filter functionality

new look filters

  1. Error message

new look error

Installation and viewing

  1. Clone the repo in your code editor git clone https://github.com/david-lorenzo-vargas/vanilla-js-carousel.git
  2. Install NPM packages npm install
  3. View the project in the browser: npm run start

Implementation, observations, other notes:

Carousel

The carousel is built dynamically using JavaScript. The user can navigate using the next and previous arrows and in the desktop view, they can also use navigation dots under the carousel. When the length of the array of items is smaller than the viewport, both the arrows and navigation dots are desactivated.

Filters

There are 3 available filters: search, price range and product type. The filters search for matching criteria as the user types, so that no additional action/button click is required to start the search. Once the filter is cleared, the search criteria goes back to inital settings.

All the 3 filters can work both individually and together. This way the user can filter items in many different ways at the same time.

In case there are no items matching search criteria, a message is rendered in the carousel body. The message informs the user about the result and suggests to re-adjust the search.

For types options (drop-down menu), the options are taken dynamically from the array of urls provided using JS reduce function.

Popup

When a product item is clicked, a popup shows up with item details and a link to the product page. The user can close the popup both by clicking on the "close" button and by clicking outside of pop-up item (available in bigger viewports).

Cross browser compatibility

Autoprefixer has been used to make sure all CSS and JavaScript features are supported in major browsers.

Responsive

The task is built Mobile first. Media queries and responsive design techniques (%, relative length units em and rem, displays flex and grid, etc.) are applied to make sure the app adjusts to all view ports.

Styles

Plain CSS

Favicon

New Look Favicon added

Additional implementations

In addition to current code of the task, I believe the following implementations would be beneficial:

  • The data with an array of products can be fetched from an API rather that from a mock file.
  • Additional testing with Jest could be implemented in order to check the logic of the filters and other utilities.

About

Product carousel with filters. Click next or previous to move around the slider, select an item or filter the items by searching, price range or item type

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published