Skip to content

Commit 0275f67

Browse files
Update script.js
1 parent 64af148 commit 0275f67

1 file changed

Lines changed: 0 additions & 47 deletions

File tree

script.js

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,3 @@ document.addEventListener('DOMContentLoaded', () => {
1717
});
1818
}
1919
});
20-
21-
22-
// ===== Metridex helpers (appended, non-intrusive) =====
23-
(function(){
24-
// Apply saved theme early if possible
25-
try {
26-
var htmlEl = document.documentElement;
27-
var stored = localStorage.getItem('metridex.theme');
28-
if(stored === 'light' || stored === 'dark'){
29-
htmlEl.setAttribute('data-theme', stored);
30-
} else if(!htmlEl.getAttribute('data-theme')){
31-
htmlEl.setAttribute('data-theme', 'dark');
32-
}
33-
} catch(e){}
34-
35-
document.addEventListener('DOMContentLoaded', function(){
36-
// Theme toggle by #theme-toggle button
37-
try{
38-
var btn = document.getElementById('theme-toggle');
39-
if(btn){
40-
var cur = document.documentElement.getAttribute('data-theme') || 'dark';
41-
btn.textContent = (cur === 'dark') ? '🌙' : '☀️';
42-
btn.addEventListener('click', function(){
43-
var now = document.documentElement.getAttribute('data-theme') || 'dark';
44-
var next = (now === 'dark') ? 'light' : 'dark';
45-
document.documentElement.setAttribute('data-theme', next);
46-
try{ localStorage.setItem('metridex.theme', next); }catch(e){}
47-
btn.textContent = (next === 'dark') ? '🌙' : '☀️';
48-
}, {passive:true});
49-
}
50-
} catch(e){}
51-
52-
// Normalize a placeholder bot CTA (without changing layout)
53-
try{
54-
var selectors = ['a[href="#bot"]','a[data-bot]','a#bot','#open-bot','#connect-bot'];
55-
for(var i=0;i<selectors.length;i++){
56-
var el = document.querySelector(selectors[i]);
57-
if(el){
58-
el.setAttribute('href','https://t.me/MetridexBot');
59-
el.setAttribute('target','_blank');
60-
el.setAttribute('rel','noopener');
61-
break;
62-
}
63-
}
64-
} catch(e){}
65-
});
66-
})();

0 commit comments

Comments
 (0)