Spaces:
Running
Running
Download app.js from Lunaron/lunaron-tools: direct link, hf CLI and curl.
- Browser
- Download file 1.94 kB
-
https://huggingface.co/spaces/Lunaron/lunaron-tools/resolve/main/app.js
- Command line
-
hf download hf://spaces/Lunaron/lunaron-tools/app.js
-
curl -L -o app.js https://huggingface.co/spaces/Lunaron/lunaron-tools/resolve/main/app.js
1.94 kB
| import { renderCharCount } from './features/ui/charcount-ui.js'; | |
| import { renderPassword } from './features/ui/password-ui.js'; | |
| import { renderDummy } from './features/ui/dummy-ui.js'; | |
| import { renderColor } from './features/ui/color-ui.js'; | |
| import { renderTimer } from './features/ui/timer-ui.js'; | |
| import { renderCompress } from './features/ui/compress-ui.js'; | |
| import { renderBgRemove } from './features/ui/bg-remove-ui.js'; | |
| // メインスクリプト(main.js)で定義されたLunaronAppが存在すれば、各ツールのUIレンダリング関数を登録する | |
| if (window.LunaronApp && window.LunaronApp.registerTool) { | |
| window.LunaronApp.registerTool('charcount', renderCharCount); | |
| window.LunaronApp.registerTool('password', renderPassword); | |
| window.LunaronApp.registerTool('dummy', renderDummy); | |
| window.LunaronApp.registerTool('color', renderColor); | |
| window.LunaronApp.registerTool('timer', renderTimer); | |
| window.LunaronApp.registerTool('compress', renderCompress); | |
| window.LunaronApp.registerTool('bg-remove', renderBgRemove); | |
| // 残りの未実装ツールには開発中のモックUIを登録する | |
| const remaining = ['qrcode', 'upscale', 'sns-preview', 'diff', 'report']; | |
| remaining.forEach(tool => { | |
| window.LunaronApp.registerTool(tool, (containerId) => { | |
| document.getElementById(containerId).innerHTML = ` | |
| <div style="text-align: center; padding: 80px; background: var(--bg-card); border-radius: var(--radius); border: 1px dashed var(--border);"> | |
| <h3 style="font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 16px;">開発中</h3> | |
| <p style="color: var(--text-muted);">このツールは現在実装中です。</p> | |
| </div> | |
| `; | |
| }); | |
| }); | |
| // 登録完了後、すでにハッシュがあれば再度ルーティングを実行して画面を描画する | |
| window.dispatchEvent(new HashChangeEvent("hashchange")); | |
| } | |