Spaces:
Sleeping
Sleeping
Download app/miniApp/app.js from mel762/glichPostGen: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/spaces/mel762/glichPostGen/resolve/main/app/miniApp/app.js
- Command line
-
hf download hf://spaces/mel762/glichPostGen/app/miniApp/app.js
-
curl -L -o app.js https://huggingface.co/spaces/mel762/glichPostGen/resolve/main/app/miniApp/app.js
1.13 kB
| /** | |
| * Main Mini App Logic | |
| * Handles tab switching and initialization of sub-components. | |
| */ | |
| document.addEventListener('DOMContentLoaded', () => { | |
| // Initialize Tabs | |
| const tabs = document.querySelectorAll('.nav-item'); | |
| const contents = document.querySelectorAll('.tab-content'); | |
| tabs.forEach(tab => { | |
| tab.addEventListener('click', () => { | |
| // Remove active class from all | |
| tabs.forEach(t => t.classList.remove('active')); | |
| contents.forEach(c => c.classList.remove('active')); | |
| // Add active class to clicked | |
| tab.classList.add('active'); | |
| // Show corresponding content | |
| const targetId = tab.dataset.tab; | |
| document.getElementById(targetId).classList.add('active'); | |
| }); | |
| }); | |
| // Initialize individual tab logic | |
| if (window.settingsTab) window.settingsTab.init(); | |
| if (window.storageTab) window.storageTab.init(); | |
| // Telegram WebApp expansion | |
| if (window.Telegram && window.Telegram.WebApp) { | |
| window.Telegram.WebApp.ready(); | |
| window.Telegram.WebApp.expand(); | |
| } | |
| }); | |