Update 1.js

This commit is contained in:
FURK4NGG
2025-02-20 18:50:36 +03:00
committed by GitHub
parent eed86cb8b0
commit 32926be8e8
+18
View File
@@ -1,3 +1,21 @@
const themeMetaTag = document.querySelector('meta[name="theme-color"]');
function updateThemeColor() {
if (document.body.classList.contains("darkmode--activated")) {
themeMetaTag.setAttribute("content", "#100f2c"); // Karanlık Mod Rengi
} else {
themeMetaTag.setAttribute("content", "#fff"); // Açık Mod Rengi
}
}
// Dark mode butonu oluştur ve çalıştır
const darkmode = new Darkmode(options);
darkmode.showWidget();
// Dark mode değiştiğinde theme color'ı güncelle
document.addEventListener("DOMContentLoaded", updateThemeColor);
document.addEventListener("click", updateThemeColor);
/*SERVICES VISIBILITY*/
const boxes = document.querySelectorAll('.services_id');