Skip to content

Commit

Permalink
add offers page
Browse files Browse the repository at this point in the history
  • Loading branch information
Maana-Ajmera committed Aug 9, 2024
1 parent 7b381f7 commit 18991aa
Show file tree
Hide file tree
Showing 14 changed files with 553 additions and 2 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added img/.DS_Store
Binary file not shown.
Binary file added img/heo-top-offers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/oeight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ofive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ofour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/oone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/oseven.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/osix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/othree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/otwo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions js/categoryjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ document.addEventListener("DOMContentLoaded", function () {
icon.src = "img/" + categoryData.icon;

const nameLink = document.createElement("a");
nameLink.href = "src/"+ categoryData.name+"/" ; // find index.html
nameLink.href = "#"; // Default href is "#"
nameLink.textContent = categoryData.name;

const name = document.createElement("span");
Expand All @@ -26,7 +26,7 @@ document.addEventListener("DOMContentLoaded", function () {
if (!categoryData.subcategories) {
const singleItem = document.createElement("div");
const singleLink = document.createElement("a");
singleLink.href = "src/"+ categoryData.name+"/";
singleLink.href = "#";
singleLink.textContent = categoryData.name;
singleItem.appendChild(singleLink);
subcategoriesList.appendChild(singleItem);
Expand Down Expand Up @@ -75,6 +75,13 @@ document.addEventListener("DOMContentLoaded", function () {
console.log("subcategoriesList is not defined or is empty.");
}

// Add click event listener to redirect to top-offers.html if id is "top-offers"
categoryItem.addEventListener('click', function () {
if (categoryData.id === "top-offers") {
window.location.href = "top-offers.html";
}
});

return categoryItem;
}

Expand Down
39 changes: 39 additions & 0 deletions top-offer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.hero{
background-image: url(img/heo-top-offers.png);
width: 100vw;
height: 100vh;
background-size: cover;
background-repeat: no-repeat;
}
.offer{
height: 80vh;
width: 98vw;
background-size: cover;
background-repeat: no-repeat;
margin: auto;
margin: 1rem;
}
#one{
background-image: url(img/oone.png);
}
#two{
background-image: url(img/otwo.png);
}
#three{
background-image: url(img/othree.png);
}
#four{
background-image: url(img/ofour.png);
}
#five{
background-image: url(img/ofive.png);
}
#six{
background-image: url(img/osix.png);
}
#seven{
background-image: url(img/oseven.png);
}
#eight{
background-image: url(img/oeight.png);
}
Loading

0 comments on commit 18991aa

Please sign in to comment.