Support Light Theme natively for Streak Modal & iframe

This commit is contained in:
2026-07-10 16:33:50 +05:30
parent d04295552e
commit 2ca9fdbbb5
2 changed files with 33 additions and 9 deletions

View File

@@ -81,6 +81,28 @@ def port_html():
# 5. Adjust badge size from 230px to 240px
html = html.replace("--badge:230px;", "--badge:240px;")
light_theme_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>
</body>
"""
html = html.replace("</body>", light_theme_script)
with open(dest_path, 'w', encoding='utf-8') as f:
f.write(html)
print("Ported successfully to public/streak-animation.html")