Update 1.js
This commit is contained in:
+10
-1
@@ -1,8 +1,16 @@
|
|||||||
/*CHANGE THEME*/
|
/*CHANGE THEME*/
|
||||||
|
|
||||||
// MutationObserver ile body'nin class listesini izleyelim
|
// MutationObserver ile body'nin class listesini izleyelim
|
||||||
const observer = new MutationObserver(() => {
|
const observer = new MutationObserver(() => {
|
||||||
const isDark = document.body.classList.contains("darkmode--activated");
|
const isDark = document.body.classList.contains("darkmode--activated");
|
||||||
|
|
||||||
|
// Meta tag'in rengini değiştirelim
|
||||||
|
const themeColorMeta = document.querySelector('meta[name="theme-color"]');
|
||||||
|
themeColorMeta.setAttribute("content", isDark ? "#100f2c" : "#F8F6E3");
|
||||||
|
|
||||||
|
// Apple status bar rengini değiştirelim
|
||||||
|
const appleStatusBarMeta = document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');
|
||||||
|
appleStatusBarMeta.setAttribute("content", isDark ? "black-translucent" : "default");
|
||||||
|
|
||||||
console.log(isDark ? "Dark Mode aktif" : "Dark Mode pasif");
|
console.log(isDark ? "Dark Mode aktif" : "Dark Mode pasif");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -16,6 +24,7 @@ observer.observe(document.body, {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*SERVICES VISIBILITY*/
|
/*SERVICES VISIBILITY*/
|
||||||
const boxes = document.querySelectorAll('.services_id');
|
const boxes = document.querySelectorAll('.services_id');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user