/* Add custom Js code below */
document.querySelector(
"body > div.app-inner.flex.flex-col.min-h-full > header > div.main-nav-container.shadow-default.bg-white > div > div > div .flex.items-center.justify-end"
).innerHTML += `
`;
// الدالة لتعيين قيمة الكوكيز
function setDarkModeCookie(value) {
document.cookie =
"darkMode=" + value + "; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/";
}
// الدالة للتحقق من قيمة الكوكيز وتحديث حالة الصفحة
function checkDarkModeCookie() {
var darkModeCookie = document.cookie.replace(
/(?:(?:^|.*;\s*)darkMode\s*=\s*([^;]*).*$)|^.*$/,
"$1"
);
var isDarkMode = darkModeCookie === "true";
document.body.classList.toggle("dark-theme", isDarkMode);
}
// التحقق من قيمة الكوكيز عند تحميل الصفحة
document.addEventListener("DOMContentLoaded", function () {
checkDarkModeCookie();
});
// الحدث المنشط عند النقر على الزر
var icon = document.querySelector(".mode-toggler.header-btn.cursor-pointer");
icon.onclick = function () {
document.body.classList.toggle("dark-theme");
var isDarkMode = document.body.classList.contains("dark-theme");
setDarkModeCookie(isDarkMode);
};
// go to top button
var goToTopBtn = document.createElement("button");
goToTopBtn.textContent = "العودة الى الأعلى ";
// Create the arrow element
var arrow = document.createElement("span");
arrow.innerHTML = "↑";
goToTopBtn.appendChild(arrow);
goToTopBtn.classList.add("btn-top");
var footer = document.querySelector("footer");
footer.before(goToTopBtn);
// Function to scroll to the top of the page
function goToTop() {
document.documentElement.scrollTo({
top: 0,
behavior: "smooth",
});
}
// Attach event listener to the button click event
goToTopBtn.addEventListener("click", goToTop);
document.querySelector(
"body > div.app-inner.flex.flex-col.min-h-full > footer > div.store-footer__inner > div > div a > h3"
).innerHTML += `
tatoevent| Boon
`;