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 url = window.location.href;
const url = window.location.pathname;
let subscribe;
navigationItems.forEach((item) => {
@@ -131,7 +131,7 @@ navigationItems.forEach((item) => {
});
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) => {
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 div = document.createElement("div");