Make iframe background transparent to fix FOUC and use vibrant cyan/magenta firecrackers
This commit is contained in:
@@ -156,11 +156,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
body, html {
|
body, html {
|
||||||
background: #000000 !important;
|
background: transparent !important;
|
||||||
background-image: none !important;
|
background-image: none !important;
|
||||||
}
|
}
|
||||||
body.sad {
|
body.sad {
|
||||||
background: #000000 !important;
|
background: transparent !important;
|
||||||
background-image: none !important;
|
background-image: none !important;
|
||||||
}
|
}
|
||||||
body::after {
|
body::after {
|
||||||
@@ -236,8 +236,8 @@
|
|||||||
}
|
}
|
||||||
resize(); addEventListener('resize',resize);
|
resize(); addEventListener('resize',resize);
|
||||||
|
|
||||||
const SPARK=window.isLightTheme?['#b91c1c','#c2410c','#1d4ed8','#15803d','#7e22ce','#0f172a']:['#f6dd93','#e8c463','#d4af37','#fff4cf','#ffffff','#8fb4ff'];
|
const SPARK=window.isLightTheme?['#0891b2','#2563eb','#db2777','#ea580c','#7c3aed','#059669']:['#f6dd93','#e8c463','#d4af37','#fff4cf','#ffffff','#8fb4ff'];
|
||||||
const CONF=window.isLightTheme?['#b91c1c','#c2410c','#1d4ed8','#15803d','#7e22ce','#0f172a','#b45309']:['#f6dd93','#e8c463','#d4af37','#ffffff','#ffd34d'];
|
const CONF=window.isLightTheme?['#0891b2','#2563eb','#db2777','#ea580c','#7c3aed','#059669','#d97706']:['#f6dd93','#e8c463','#d4af37','#ffffff','#ffd34d'];
|
||||||
let parts=[], running=false, mode='fireworks', rafFW=null, fwTimers=[], fadeCol=(window.isLightTheme ? 'rgba(255,255,255,0.22)' : 'rgba(0,0,0,0.22)');
|
let parts=[], running=false, mode='fireworks', rafFW=null, fwTimers=[], fadeCol=(window.isLightTheme ? 'rgba(255,255,255,0.22)' : 'rgba(0,0,0,0.22)');
|
||||||
|
|
||||||
function burst(xr,yr,count){
|
function burst(xr,yr,count){
|
||||||
@@ -419,8 +419,8 @@
|
|||||||
window.isLightTheme = isLight;
|
window.isLightTheme = isLight;
|
||||||
|
|
||||||
if (isLight) {
|
if (isLight) {
|
||||||
document.body.style.setProperty('background', '#ffffff', 'important');
|
document.body.style.setProperty('background', 'transparent', 'important');
|
||||||
document.documentElement.style.setProperty('background', '#ffffff', 'important');
|
document.documentElement.style.setProperty('background', 'transparent', 'important');
|
||||||
const b = document.querySelector('.badge');
|
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 (b) b.style.setProperty('background', "url('/PragatiVeer_Logo/SVG_Logos/Square_light_background.svg') center/cover no-repeat", 'important');
|
||||||
if (typeof fadeCol !== 'undefined') {
|
if (typeof fadeCol !== 'undefined') {
|
||||||
@@ -431,8 +431,8 @@
|
|||||||
window.sadFaceEyes = 'rgba(40,60,90,0.95)';
|
window.sadFaceEyes = 'rgba(40,60,90,0.95)';
|
||||||
window.sadFaceTears = 'rgba(30,144,255,0.92)';
|
window.sadFaceTears = 'rgba(30,144,255,0.92)';
|
||||||
} else {
|
} else {
|
||||||
document.body.style.setProperty('background', '#000000', 'important');
|
document.body.style.setProperty('background', 'transparent', 'important');
|
||||||
document.documentElement.style.setProperty('background', '#000000', 'important');
|
document.documentElement.style.setProperty('background', 'transparent', 'important');
|
||||||
const b = document.querySelector('.badge');
|
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 (b) b.style.setProperty('background', "url('/PragatiVeer_Logo/SVG_Logos/Square_dark_background.svg') center/cover no-repeat", 'important');
|
||||||
if (typeof fadeCol !== 'undefined') {
|
if (typeof fadeCol !== 'undefined') {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ def port_html():
|
|||||||
# 1. Inject CSS to make background transparent and hide stage layout
|
# 1. Inject CSS to make background transparent and hide stage layout
|
||||||
hide_css = """
|
hide_css = """
|
||||||
body, html {
|
body, html {
|
||||||
background: #000000 !important;
|
background: transparent !important;
|
||||||
background-image: none !important;
|
background-image: none !important;
|
||||||
}
|
}
|
||||||
body.sad {
|
body.sad {
|
||||||
background: #000000 !important;
|
background: transparent !important;
|
||||||
background-image: none !important;
|
background-image: none !important;
|
||||||
}
|
}
|
||||||
body::after {
|
body::after {
|
||||||
@@ -77,8 +77,8 @@ def port_html():
|
|||||||
html = html.replace("<script>", init_theme_script, 1)
|
html = html.replace("<script>", init_theme_script, 1)
|
||||||
|
|
||||||
# Make firecracker spark/confetti arrays dynamic based on theme
|
# 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'];"
|
spark_replacement = "const SPARK=window.isLightTheme?['#0891b2','#2563eb','#db2777','#ea580c','#7c3aed','#059669']:['#f6dd93','#e8c463','#d4af37','#fff4cf','#ffffff','#8fb4ff'];"
|
||||||
conf_replacement = "const CONF=window.isLightTheme?['#b91c1c','#c2410c','#1d4ed8','#15803d','#7e22ce','#0f172a','#b45309']:['#f6dd93','#e8c463','#d4af37','#ffffff','#ffd34d'];"
|
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 SPARK\s*=\s*\[[^\]]*\];", spark_replacement, html)
|
||||||
html = re.sub(r"const CONF\s*=\s*\[[^\]]*\];", conf_replacement, html)
|
html = re.sub(r"const CONF\s*=\s*\[[^\]]*\];", conf_replacement, html)
|
||||||
|
|
||||||
@@ -122,8 +122,8 @@ def port_html():
|
|||||||
window.isLightTheme = isLight;
|
window.isLightTheme = isLight;
|
||||||
|
|
||||||
if (isLight) {
|
if (isLight) {
|
||||||
document.body.style.setProperty('background', '#ffffff', 'important');
|
document.body.style.setProperty('background', 'transparent', 'important');
|
||||||
document.documentElement.style.setProperty('background', '#ffffff', 'important');
|
document.documentElement.style.setProperty('background', 'transparent', 'important');
|
||||||
const b = document.querySelector('.badge');
|
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 (b) b.style.setProperty('background', "url('/PragatiVeer_Logo/SVG_Logos/Square_light_background.svg') center/cover no-repeat", 'important');
|
||||||
if (typeof fadeCol !== 'undefined') {
|
if (typeof fadeCol !== 'undefined') {
|
||||||
@@ -134,8 +134,8 @@ def port_html():
|
|||||||
window.sadFaceEyes = 'rgba(40,60,90,0.95)';
|
window.sadFaceEyes = 'rgba(40,60,90,0.95)';
|
||||||
window.sadFaceTears = 'rgba(30,144,255,0.92)';
|
window.sadFaceTears = 'rgba(30,144,255,0.92)';
|
||||||
} else {
|
} else {
|
||||||
document.body.style.setProperty('background', '#000000', 'important');
|
document.body.style.setProperty('background', 'transparent', 'important');
|
||||||
document.documentElement.style.setProperty('background', '#000000', 'important');
|
document.documentElement.style.setProperty('background', 'transparent', 'important');
|
||||||
const b = document.querySelector('.badge');
|
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 (b) b.style.setProperty('background', "url('/PragatiVeer_Logo/SVG_Logos/Square_dark_background.svg') center/cover no-repeat", 'important');
|
||||||
if (typeof fadeCol !== 'undefined') {
|
if (typeof fadeCol !== 'undefined') {
|
||||||
|
|||||||
Reference in New Issue
Block a user