File size: 2,429 Bytes
af0538f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | 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.")
|