/* Add custom Js code below */
window.baseUrl = 'https://thenew.fyi/ar';
window.is_rtl = true;
window.locale = 'ar';
document.body.classList.add("dark-theme");
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" || darkModeCookie === "";
document.body.classList.toggle("dark-theme", isDarkMode);
}
// التحقق من قيمة الكوكيز عند تحميل الصفحة
document.addEventListener("DOMContentLoaded", function() {
checkDarkModeCookie();
});
// تعيين الوضع الداكن كافتراضيًا عند تحميل الصفحة
document.body.classList.add("dark-theme");
setDarkModeCookie(true);
// الحدث المنشط عند النقر على الزر
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 +=
`
الحقوق محفوظة | 2023
the new
`;
var script = document.createElement("script");
// Add script content
script.src = "https://cdn.lordicon.com/bhenfmcm.js";
// Append
document.head.appendChild(script);
// icons
document.addEventListener("DOMContentLoaded", function(event) {
document.querySelector("body > div.app-inner.flex.flex-col.min-h-full > section.s-block.s-block--features.container > div > div:nth-child(1) div ").innerHTML = `