Fall-ready skincare
Fall-ready skincare
{
const children = Array.from($el.children)
const children_products = children.filter((child) => child.classList.contains("filter__product"))
let order = 0
for (let i = 0; i < children_products.length; i++) {
if (children_products[i].dataset.show == "false") {
children_products[i].style.display = "none"
} else {
children_products[i].style.display = ""
children_products[i].style.order = order
order++
}
}
const children_promos = children.filter((child) => child.classList.contains("filter__promo"))
for (let i = 0; i < children_promos.length; i++) {
const index = children.indexOf(children_promos[i])
if (index > -1) {
const next_children_products = children.filter((child) => child.classList.contains("filter__product") && child.dataset.show != "false" && parseInt(child.style.order) > parseInt(children_promos[i].style.order))
if (next_children_products.length > 0) {
children_promos[i].style.display = ""
} else {
children_promos[i].style.display = ""
}
} else {
console.error("Element not found!")
}
}
}, 5)
'
>
Golden Hour Recovery Cream
An incredibly nourishing, yet fast-absorbing face cream.
An incredibly nourishing, yet fast-absorbing face cream.
Rated 4.5 out of 5 stars
4.5 Stars (5,591 Reviews)
1.57 FL OZ
Brighten Up Vitamin C Serum
A concentrated, corrective serum for even-toned, radiant skin.
A concentrated, corrective serum for even-toned, radiant skin.
Rated 4.4 out of 5 stars
4.4 Stars (1,542 Reviews)
1 FL OZ
Forest Alchemy Eye Cream
A supremely nourishing, all-in-one eye cream with powerful active ingredients.
A supremely nourishing, all-in-one eye cream with powerful active ingredients.
Rated 4.2 out of 5 stars
4.2 Stars (1,796 Reviews)
0.5 FL OZ
Perfect Zen Body Lotion
A blissful, hydrating body lotion with an uplifting scent.
A blissful, hydrating body lotion with an uplifting scent.
A blissful, hydrating body lotion with an uplifting scent.
Rated 4.5 out of 5 stars
4.5 Stars (164 Reviews)
8 FL OZ