Make iframe background transparent to fix FOUC and use vibrant cyan/magenta firecrackers

This commit is contained in:
2026-07-10 16:59:43 +05:30
parent ead4942b6d
commit f5049ef965
2 changed files with 16 additions and 16 deletions

View File

@@ -11,11 +11,11 @@ def port_html():
# 1. Inject CSS to make background transparent and hide stage layout
hide_css = """
body, html {
background: #000000 !important;
background: transparent !important;
background-image: none !important;
}
body.sad {
background: #000000 !important;
background: transparent !important;
background-image: none !important;
}
body::after {
@@ -77,8 +77,8 @@ def port_html():
html = html.replace("<script>", init_theme_script, 1)
# Make firecracker spark/confetti arrays dynamic based on theme
spark_replacement = "const SPARK=window.isLightTheme?['#b91c1c','#c2410c','#1d4ed8','#15803d','#7e22ce','#0f172a']:['#f6dd93','#e8c463','#d4af37','#fff4cf','#ffffff','#8fb4ff'];"
conf_replacement = "const CONF=window.isLightTheme?['#b91c1c','#c2410c','#1d4ed8','#15803d','#7e22ce','#0f172a','#b45309']:['#f6dd93','#e8c463','#d4af37','#ffffff','#ffd34d'];"
spark_replacement = "const SPARK=window.isLightTheme?['#0891b2','#2563eb','#db2777','#ea580c','#7c3aed','#059669']:['#f6dd93','#e8c463','#d4af37','#fff4cf','#ffffff','#8fb4ff'];"
conf_replacement = "const CONF=window.isLightTheme?['#0891b2','#2563eb','#db2777','#ea580c','#7c3aed','#059669','#d97706']:['#f6dd93','#e8c463','#d4af37','#ffffff','#ffd34d'];"
html = re.sub(r"const SPARK\s*=\s*\[[^\]]*\];", spark_replacement, html)
html = re.sub(r"const CONF\s*=\s*\[[^\]]*\];", conf_replacement, html)
@@ -122,8 +122,8 @@ def port_html():
window.isLightTheme = isLight;
if (isLight) {
document.body.style.setProperty('background', '#ffffff', 'important');
document.documentElement.style.setProperty('background', '#ffffff', 'important');
document.body.style.setProperty('background', 'transparent', 'important');
document.documentElement.style.setProperty('background', 'transparent', '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');
if (typeof fadeCol !== 'undefined') {
@@ -134,8 +134,8 @@ def port_html():
window.sadFaceEyes = 'rgba(40,60,90,0.95)';
window.sadFaceTears = 'rgba(30,144,255,0.92)';
} else {
document.body.style.setProperty('background', '#000000', 'important');
document.documentElement.style.setProperty('background', '#000000', 'important');
document.body.style.setProperty('background', 'transparent', 'important');
document.documentElement.style.setProperty('background', 'transparent', 'important');
const b = document.querySelector('.badge');
if (b) b.style.setProperty('background', "url('/PragatiVeer_Logo/SVG_Logos/Square_dark_background.svg') center/cover no-repeat", 'important');
if (typeof fadeCol !== 'undefined') {