This commit is contained in:
2022-10-18 12:35:21 +03:00
parent c557569b8d
commit ff2dfd42d7

View File

@@ -114,7 +114,7 @@ const cards = [
]; ];
const navigationItems = document.querySelectorAll(".nav__item"); const navigationItems = document.querySelectorAll(".nav__item");
const url = window.location.href; const url = window.location.pathname;
let subscribe; let subscribe;
navigationItems.forEach((item) => { navigationItems.forEach((item) => {
@@ -131,7 +131,7 @@ navigationItems.forEach((item) => {
}); });
const cardsToShow = const cardsToShow =
url === "http://127.0.0.1:5500/" ? cards : cards.slice(0, 4); url === "/" || url === "/index.html" ? cards : cards.slice(0, 4);
cardsToShow.forEach((card, index) => { cardsToShow.forEach((card, index) => {
const div = document.createElement("div"); const div = document.createElement("div");
@@ -172,7 +172,7 @@ subscribe.forEach((el) => {
}); });
}); });
if (url === "http://127.0.0.1:5500/about.html") { if (url === "/about.html") {
const cardFromStorage = JSON.parse(localStorage.getItem("card")); const cardFromStorage = JSON.parse(localStorage.getItem("card"));
const div = document.createElement("div"); const div = document.createElement("div");