Skip to content

Commit

Permalink
add filter elements
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorVilas committed Apr 25, 2023
1 parent 2651105 commit 1ce14ae
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions modules/pages/shop.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const shopCategories = ['All Collections', 'Cacti', 'Plants', 'Succulents'];

export default function home() {
const shop = [categories(), banner(), catalog()];

Expand All @@ -7,9 +9,8 @@ export default function home() {
function categories() {
const section = document.createElement('section');
const categoriesList = document.createElement('ul');
const categories = ['All Collections', 'Cacti', 'Plants', 'Succulents'];

categories.forEach((category, i) => {
shopCategories.forEach((category, i) => {
const li = document.createElement('li');
li.textContent = category;

Expand All @@ -29,7 +30,7 @@ function banner() {
const section = document.createElement('section');
const title = document.createElement('h1');

title.textContent = 'All Collections';
title.textContent = shopCategories[0];

section.classList.add('shop-banner');

Expand All @@ -40,8 +41,25 @@ function banner() {

function catalog() {
const section = document.createElement('section');
const filterDiv = document.createElement('div');
const filter = document.createElement('p');
const dropdown = document.createElement('select');
const dropdownOptions = ['Best Selling', 'Lorem Ipsum', 'Dolor Sit', 'Amet Consectetur'];

dropdownOptions.forEach(category => {
const option = document.createElement('option');
option.textContent = category;

dropdown.append(option);
});

filter.textContent = 'Filter';

section.classList.add('shop-catalog');
filterDiv.classList.add('shop-filter');

filterDiv.append(filter, dropdown);
section.append(filterDiv);

return section;
}

0 comments on commit 1ce14ae

Please sign in to comment.