Spaces:
Sleeping
Sleeping
Download scratch_ui.py from PROSTLE/StockSense-AI: direct link, hf CLI and curl.
- Browser
- Download file 2.43 kB
-
https://huggingface.co/spaces/PROSTLE/StockSense-AI/resolve/main/scratch_ui.py
- Command line
-
hf download hf://spaces/PROSTLE/StockSense-AI/scratch_ui.py
-
curl -L -o scratch_ui.py https://huggingface.co/spaces/PROSTLE/StockSense-AI/resolve/main/scratch_ui.py
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.") | |