Update 1.js
This commit is contained in:
+18
-18
@@ -385,24 +385,24 @@ function animateCircles() {
|
|||||||
animateCircles();
|
animateCircles();
|
||||||
|
|
||||||
|
|
||||||
const themeMetaTag = document.querySelector('meta[name="theme-color"]');
|
const themeMetaTag = document.querySelector('meta[name="theme-color"]');
|
||||||
|
|
||||||
function updateThemeColor() {
|
function updateThemeColor() {
|
||||||
if (document.body.classList.contains("darkmode--activated")) {
|
if (darkmode.isActivated()) {
|
||||||
themeMetaTag.setAttribute("content", "#100f2c"); // Karanlık Mod Rengi
|
themeMetaTag.setAttribute("content", "#000000"); // Dark mode aktifken siyah renk
|
||||||
} else {
|
} else {
|
||||||
themeMetaTag.setAttribute("content", "#000000"); // Açık Mod Rengi
|
themeMetaTag.setAttribute("content", "#100f2c"); // Açık modda farklı renk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dark mode butonu oluştur ve çalıştır
|
// Dark mode butonu oluştur ve çalıştır
|
||||||
const darkmode = new Darkmode(options);
|
const darkmode = new Darkmode(options);
|
||||||
darkmode.showWidget();
|
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", () => {
|
document.addEventListener("click", () => {
|
||||||
setTimeout(updateThemeColor, 100); // Dark mode animasyonu için küçük gecikme
|
setTimeout(updateThemeColor, 100); // Dark mode animasyonu için küçük gecikme
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user