Download index.html from Plahoff/my-reader: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/Plahoff/my-reader/resolve/main/index.html
- Command line
-
hf download hf://spaces/Plahoff/my-reader/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Plahoff/my-reader/resolve/main/index.html
1.12 kB
| <html> | |
| <body style="background:#1a1a1a; color:white; font-family:sans-serif; padding:20px;"> | |
| <h2>Мои книги</h2> | |
| <div id="list"></div> | |
| <div id="reader" style="display:none;"> | |
| <button onclick="location.reload()" style="padding:10px; margin-bottom:10px;">← Назад</button> | |
| <div id="text" style="white-space:pre-wrap; line-height:1.6; font-size:18px;"></div> | |
| </div> | |
| <script> | |
| fetch('/api/books').then(r => r.json()).then(books => { | |
| const list = document.getElementById('list'); | |
| list.innerHTML = books.map(b => `<div onclick="load('${b}')" style="padding:15px; background:#333; margin:10px 0; border-radius:8px;">${b}</div>`).join(''); | |
| }); | |
| function load(name) { | |
| fetch('/api/book/' + name).then(r => r.json()).then(data => { | |
| document.getElementById('list').style.display = 'none'; | |
| document.getElementById('reader').style.display = 'block'; | |
| document.getElementById('text').innerText = data.text; | |
| }); | |
| } | |
| </script> | |
| </body> | |
| </html> |