AarthiAI / scratch_ui.py
PROSTLE's picture
chore: backup existing working state before UI updates
af0538f
Raw History Blame Contribute Delete
2.43 kB
import os
import re
frontend_dir = r"c:\Lang\stuf\StockSense-AI\frontend"
# Emojis to remove
emojis = ["πŸ“ˆ", "πŸ’°", "πŸ€–", "πŸ›’", "πŸ”", "πŸ“‚", "πŸ“‹", "⭐", "⚑", "πŸ”΄", "πŸ”₯", "πŸ“°", "πŸ“Š", "🌐", "🧠", "πŸ’Ή", "πŸ“₯", "πŸ›‘οΈ", "βž•", "β†—", "✨", "πŸ“‰"]
html_path = os.path.join(frontend_dir, "index.html")
js_path = os.path.join(frontend_dir, "app.js")
css_path = os.path.join(frontend_dir, "style.css")
def remove_emojis(text):
for e in emojis:
text = text.replace(e, "")
return text
print("Processing HTML...")
with open(html_path, "r", encoding="utf-8") as f:
html_content = f.read()
html_content = remove_emojis(html_content)
with open(html_path, "w", encoding="utf-8") as f:
f.write(html_content)
print("Processing JS...")
with open(js_path, "r", encoding="utf-8") as f:
js_content = f.read()
js_content = remove_emojis(js_content)
with open(js_path, "w", encoding="utf-8") as f:
f.write(js_content)
print("Appending Glassmorphism to CSS...")
glass_css = """
/* ========================================================
GLASSMORPHISM OVERRIDES
======================================================== */
.wallet-panel,
.trade-panel-content,
.topbar,
.market-bar,
.panel,
.insight-card,
.port-card,
.trade-panel,
.chart-container,
.wallet-balance-card,
.tp-stock-card,
.wallet-form,
.search-dropdown,
.tp-tab-content,
.wallet-txn-item,
.app-footer {
background: rgba(19, 23, 32, 0.45) !important;
backdrop-filter: blur(12px) !important;
-webkit-backdrop-filter: blur(12px) !important;
border: 1px solid rgba(255, 255, 255, 0.08) !important;
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
}
/* Ensure child elements like tables have transparent background */
.positions-table th, .positions-table td {
background: transparent !important;
}
/* Base Body Update for better Glass contrast */
body {
background: linear-gradient(135deg, #0f1219 0%, #080a0f 100%) !important;
background-attachment: fixed !important;
}
/* Hide the CLOSED / Market Badges completely */
.live-badge,
.tp-market-badge,
.av-market-badge {
display: none !important;
}
/* Hide empty emoji containers if they're left blank */
.empty-icon, .loader-brain, .insight-icon, .pipe-icon, .llm-icon, .wallet-header-icon {
display: none !important;
}
"""
with open(css_path, "a", encoding="utf-8") as f:
f.write(glass_css)
print("Done.")