Update 1.js
This commit is contained in:
+9
-3
@@ -2,16 +2,22 @@ const themeMetaTag = document.querySelector('meta[name="theme-color"]');
|
|||||||
|
|
||||||
function updateThemeColor() {
|
function updateThemeColor() {
|
||||||
if (document.body.classList.contains("darkmode--activated")) {
|
if (document.body.classList.contains("darkmode--activated")) {
|
||||||
themeMetaTag.setAttribute("content", "#fff"); // Karanlık Mod Rengi
|
themeMetaTag.setAttribute("content", "#100f2c"); // Karanlık Mod Rengi
|
||||||
} else {
|
} else {
|
||||||
themeMetaTag.setAttribute("content", "#fff"); // Açık Mod Rengi
|
themeMetaTag.setAttribute("content", "#ffffff"); // 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
|
// Dark mode değiştiğinde theme color'ı güncelle
|
||||||
document.addEventListener("DOMContentLoaded", updateThemeColor);
|
document.addEventListener("DOMContentLoaded", updateThemeColor);
|
||||||
document.addEventListener("click", updateThemeColor);
|
document.addEventListener("click", () => {
|
||||||
|
setTimeout(updateThemeColor, 100); // Dark mode animasyonu için küçük gecikme
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/*SERVICES VISIBILITY*/
|
/*SERVICES VISIBILITY*/
|
||||||
const boxes = document.querySelectorAll('.services_id');
|
const boxes = document.querySelectorAll('.services_id');
|
||||||
|
|||||||
Reference in New Issue
Block a user