
The latest update has been completed
66%
HTML , CSS , javascript , bootstrap 5.3
Welcome to Martfury Online Store !
Thank you for reading this post, don't forget to subscribe!
Gaming Store
import { EVENTS, waitForEvents } from "/js/utils/events.js";
import { uiBuilder } from "./header-builder.js";
waitForEvents([EVENTS.CONFIG_LOADED], async function () {
await uiBuilder();
await onInit();
document.dispatchEvent(new Event(EVENTS.HEADER_LOADED));
});
async function onInit() {
generateMenu();
initHeaderStoreInformation();
}
function initHeaderStoreInformation() {
const storeInformation = SiteConfig.store_information;
const logo = storeInformation.logo;
const logoElement = document.getElementById("header-logo");
if (logoElement) {
logoElement.src = logo;
}
}
const menuData = [
{
title: 'Xbox Info',
// icon: '',
icon: '
',
subMenus: [
{
title: "",
items: [{ image: "../img/m6.jpg" }],
},
{
title: "",
items: [{ image: "../img/s1.jpg" }],
},
{
title: "",
items: [{ image: "../img/t1.jpg" }],
},
{
title: "",
items: [{ image: "../img/m5.webp" }],
},
{
title: "",
items: [{ image: "../img/m5.webp" }],
},
{
title: "",
items: [{ image: "../img/m2.avif" }],
},
{
title: "",
items: [{ image: "../img/132456.jpg" }],
},
{
title: "",
items: [{ image: "../img/321465798789879.jpg" }],
},
{
title: "",
items: [{ image: "../img/123456789456123.png" }],
},
{
title: "Upcoming Releases",
items: [
"Avowed",
"Starfield",
"Hellblade 2",
"The Outer Worlds 2",
"Perfect Dark",
"Indiana Jones",
"Everwild",
],
},
{
title: "Upcoming Releases",
items: [
"Avowed",
"Starfield",
"Hellblade 2",
"The Outer Worlds 2",
"Perfect Dark",
"Indiana Jones",
"Everwild",
],
},
],
},
{
title: "Gaming Merchandise",
icon: '',
subMenus: [
{
title: "Clothing",
items: [
"Gaming Hoodies",
"T-Shirts",
"Hats",
"Socks",
"Jackets",
"Sweatpants",
"Sneakers",
],
},
{
title: "Decor",
items: [
"Wall Posters",
"LED Light Strips",
"Game-Themed Rugs",
"Desk Mats",
"Gaming Wall Art",
"Themed Neon Signs",
],
},
{
title: "",
items: [{ image: "../img/321465798789879.jpg" }],
},
{
title: "",
items: [{ image: "../img/1234.png" }],
},
],
},
{
title: 'PC Gaming Danger',
icon: '',
subMenus: [
{
title: "Gaming Hardware",
items: [
"High-Performance Graphics Cards",
"Overclocked Processors",
"RGB Motherboards",
"Ultra-Fast RAM Modules",
"Platinum Certified Power Supplies",
],
},
{
title: "Gaming Peripherals",
items: [
"Mechanical RGB Keyboards",
"Wireless Gaming Mice",
"Professional Streaming Microphones",
"High-Resolution Gaming Monitors",
"Adjustable Ergonomic Gaming Chairs",
],
},
],
},
{
title: "Streaming Gear",
icon: '',
subMenus: [
{
title: "Capture Devices",
items: [
"Elgato 4K60 Pro",
"AverMedia Live Gamer Duo",
"Razer Ripsaw HD",
"Blackmagic ATEM Mini Pro",
],
},
{
title: "Lighting & Green Screens",
items: [
"Elgato Key Light",
"Neewer Softbox Studio Lights",
"Foldable Green Screens",
"RGB LED Smart Panels",
],
},
],
},
{
title: 'VR Gaming Discounts 30%',
icon: '',
subMenus: [
{
title: "VR Headsets",
items: [
"Oculus Quest Pro",
"HTC Vive Pro 2",
"Valve Index Full Kit",
"Pimax 8K VR Headset",
],
},
{
title: "VR Accessories",
items: [
"360° Motion Tracking Sensors",
"Haptic Feedback VR Gloves",
"Omnidirectional VR Treadmills",
"High-Resolution VR Lenses",
],
},
],
},
{
title: "Gaming Accessories",
icon: '',
subMenus: [
{
title: "High-End Gaming Controllers",
items: [
"Elite Series 2 Controllers",
"SCUF Customizable Controllers",
"Arcade Fight Sticks",
"Adaptive Gaming Controllers",
],
},
{
title: "Headsets & Audio Gear",
items: [
"Wireless Surround Sound Gaming Headsets",
"Studio-Quality Gaming Microphones",
"Noise-Canceling Streaming Headphones",
],
},
],
},
{
title: 'Mobile Gaming Info',
icon: '',
subMenus: [
{
title: "Mobile Devices",
items: [
"Razer Phone",
"ASUS ROG Phone",
"Black Shark",
"iPhone Gaming Accessories",
],
},
{
title: "Mobile Accessories",
items: [
"Mobile Controllers",
"Cooling Fans",
"Gaming Earbuds",
"Power Banks",
],
},
],
},
{
title: "Esports & Competitive Gaming",
icon: '',
subMenus: [
{
title: "Popular Esports Games",
items: [
"League of Legends",
'Dota 2 Warning',
"CS:GO",
"Valorant",
"Overwatch",
],
},
{
title: "Esports Gear",
items: [
"High-Refresh Monitors",
"Pro Gaming Mice",
"Noise-Canceling Headsets",
"Esports Jerseys",
],
},
],
},
{
title: "Board Games & Tabletop",
icon: "",
subMenus: [
{
title: "Popular Board Games",
items: ["Catan", "Risk", "Gloomhaven", "Monopoly", "Ticket to Ride"],
},
{
title: "Tabletop RPGs",
items: ["Dungeons & Dragons", "Pathfinder", "Warhammer 40K"],
},
],
},
{
title: 'Racing Games Warning',
icon: "",
subMenus: [
{
title: "Popular Racing Games",
items: [
'Forza Horizon 5 Warning',
"Gran Turismo 7",
"Need for Speed Heat",
"Assetto Corsa",
"F1 2023",
],
},
{
title: "Racing Accessories",
items: [
"Racing Wheels",
"Pedals",
"VR Racing Seats",
"Motion Simulators",
],
},
],
},
];
function generateMenu() {
const navbarMenu = document.getElementById("navbarMenu");
const offcanvasMenu = document.getElementById("offcanvasMenuList");
menuData.forEach((menu, index) => {
let dropdownItem = document.createElement("li");
dropdownItem.className = "dropdown-item hover-bg-color";
dropdownItem.innerHTML = `
${menu.subMenus
.map(
(subMenu) => `
-
${subMenu.title}
${subMenu.items
.map((item) => {
let content = "";
if (typeof item === "object" && item.image) {
content = `
`;
} else {
content = `${item}`;
}
return `- ${content}
`;
})
.join("")}
`
)
.join("")}
`;
navbarMenu.appendChild(dropdownItem);
let offcanvasItem = document.createElement("li");
offcanvasItem.className = "list-group-item";
offcanvasItem.innerHTML = `
${menu.icon ? menu.icon + " " : ""}${menu.title}
${menu.subMenus
.map(
(subMenu) => `
-
${subMenu.title}
${subMenu.items
.map((item) => {
let content = "";
if (typeof item === "object" && item.image) {
content = `
`;
} else {
content = `${item}`;
}
return `- ${content}
`;
})
.join("")}
`
)
.join("")}
`;
offcanvasMenu.appendChild(offcanvasItem);
});
}