Update 1.js

This commit is contained in:
FURK4NGG
2025-02-24 12:53:15 +03:00
committed by GitHub
parent ae02c9d8ac
commit 53adbc0479
+8 -19
View File
@@ -385,25 +385,14 @@ function animateCircles() {
animateCircles(); animateCircles();
const themeMetaTag = document.querySelector('meta[name="theme-color"]'); document.getElementById("toggleTheme").addEventListener("click", function () {
let metaTheme = document.getElementById("themeMeta");
function updateThemeColor() { if (metaTheme.content === "#ffffff") {
if (darkmode.isActivated()) { metaTheme.content = "#100f2c"; // Dark mode rengi
themeMetaTag.setAttribute("content", "#EFF0D3"); // Dark mode aktifken siyah renk } else {
} else { metaTheme.content = "#ffffff"; // Light mode rengi
themeMetaTag.setAttribute("content", "#EFF0D3"); // Açık modda farklı renk }
} });
}
// 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", () => {
setTimeout(updateThemeColor, 100); // Dark mode animasyonu için küçük gecikme
});
/*DISABLE COPY-PASTE*/ /*DISABLE COPY-PASTE*/