Fix light theme script injection bug
This commit is contained in:
@@ -394,3 +394,22 @@
|
|||||||
capInput.addEventListener('keydown', e=>{ if(e.key==='Enter') play(); });
|
capInput.addEventListener('keydown', e=>{ if(e.key==='Enter') play(); });
|
||||||
window.addEventListener('load', ()=>setTimeout(play,180));
|
window.addEventListener('load', ()=>setTimeout(play,180));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
(function(){
|
||||||
|
const p = new URLSearchParams(window.location.search);
|
||||||
|
if (p.get('theme') === 'light') {
|
||||||
|
document.body.style.setProperty('background', '#ffffff', 'important');
|
||||||
|
document.documentElement.style.setProperty('background', '#ffffff', 'important');
|
||||||
|
const b = document.querySelector('.badge');
|
||||||
|
if (b) b.style.setProperty('background', "url('/PragatiVeer_Logo/SVG_Logos/Square_light_background.svg') center/cover no-repeat", 'important');
|
||||||
|
// Override trailing color repeatedly so particles look okay in light mode
|
||||||
|
setInterval(() => {
|
||||||
|
if (typeof fadeCol !== 'undefined') {
|
||||||
|
fadeCol = 'rgba(255,255,255,0.22)';
|
||||||
|
}
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -99,9 +99,8 @@ def port_html():
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
|
||||||
"""
|
"""
|
||||||
html = html.replace("</body>", light_theme_script)
|
html += light_theme_script
|
||||||
|
|
||||||
with open(dest_path, 'w', encoding='utf-8') as f:
|
with open(dest_path, 'w', encoding='utf-8') as f:
|
||||||
f.write(html)
|
f.write(html)
|
||||||
|
|||||||
Reference in New Issue
Block a user