Update 1.js

This commit is contained in:
FURK4NGG
2025-02-20 18:17:03 +03:00
committed by GitHub
parent 828deff8eb
commit 52e3d506f1
+27
View File
@@ -219,6 +219,33 @@ const options = {
autoMatchOsTheme: true // default: true autoMatchOsTheme: true // default: true
} }
function updateThemeColor() {
let themeColorMeta = document.querySelector('meta[name="theme-color"]');
if (!themeColorMeta) {
themeColorMeta = document.createElement('meta');
themeColorMeta.setAttribute('name', 'theme-color');
document.head.appendChild(themeColorMeta);
}
if (darkmode.isActivated()) {
document.body.style.backgroundColor = "#100f2c"; // Arka plan siyah
themeColorMeta.setAttribute("content", "#100f2c"); // Tarayıcı rengi siyah
} else {
document.body.style.backgroundColor = "#fff"; // Açık moda dön
themeColorMeta.setAttribute("content", "#fff"); // Tarayıcı rengi beyaz
}
}
// Sayfa açıldığında ve toggle butonuna basıldığında güncelle
updateThemeColor();
document.addEventListener("click", function(event) {
if (event.target.classList.contains("darkmode-toggle")) {
setTimeout(updateThemeColor, 500); // Butona basılınca 0.5s gecikmeli güncelle
}
});
/*GALLERY IMAGES*/ /*GALLERY IMAGES*/
var TrandingSlider = new Swiper('.tranding-slider', { var TrandingSlider = new Swiper('.tranding-slider', {