Skip to content

Commit 32ac0d5

Browse files
Update script.js
1 parent 33c0fa6 commit 32ac0d5

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

script.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
if(yearEl) yearEl.textContent = new Date().getFullYear();
88

99
// Theme init
10-
const saved = localStorage.getItem('theme');
11-
if(saved === 'light'){ root.classList.add('light'); toggle && (toggle.textContent='☀️'); }
10+
try{
11+
const saved = localStorage.getItem('metridex.theme') || localStorage.getItem('theme');
12+
if(saved === 'light'){ root.classList.add('light'); if(toggle) toggle.textContent='☀️'; }
13+
}catch(e){}
1214
toggle && toggle.addEventListener('click', ()=>{
1315
root.classList.toggle('light');
1416
const isLight = root.classList.contains('light');
15-
localStorage.setItem('theme', isLight ? 'light' : 'dark');
17+
try{ localStorage.setItem('metridex.theme', isLight ? 'light' : 'dark'); }catch(e){}
1618
toggle.textContent = isLight ? '☀️' : '🌙';
1719
});
1820

@@ -22,7 +24,8 @@
2224
burger.setAttribute('aria-expanded', open ? 'true' : 'false');
2325
});
2426

25-
// Normalize CTAs to bot
26-
const botLinks = document.querySelectorAll('.cta-bot, #connect-bot, a[data-bot]');
27-
botLinks.forEach(a => { a.href='https://t.me/MetridexBot'; a.target='_blank'; a.rel='noopener'; });
27+
// Normalize bot CTAs
28+
document.querySelectorAll('.cta-bot').forEach(a => {
29+
a.href='https://t.me/MetridexBot'; a.target='_blank'; a.rel='noopener';
30+
});
2831
})();

0 commit comments

Comments
 (0)