Spaces:
Sleeping
Sleeping
Download index.html from ME22B191/Neural_Translation: direct link, hf CLI and curl.
- Browser
- Download file 1.49 kB
-
https://huggingface.co/spaces/ME22B191/Neural_Translation/resolve/main/index.html
- Command line
-
hf download hf://spaces/ME22B191/Neural_Translation/index.html
-
curl -L -o index.html https://huggingface.co/spaces/ME22B191/Neural_Translation/resolve/main/index.html
1.49 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>Neural Translator</title> | |
| <style> | |
| body { | |
| font-family: system-ui, sans-serif; | |
| max-width: 640px; | |
| margin: 40px auto; | |
| padding: 0 16px; | |
| } | |
| textarea { | |
| width: 100%; | |
| font-size: 16px; | |
| padding: 8px; | |
| box-sizing: border-box; | |
| } | |
| button { | |
| margin-top: 8px; | |
| padding: 8px 16px; | |
| font-size: 16px; | |
| cursor: pointer; | |
| } | |
| #result { | |
| margin-top: 8px; | |
| min-height: 24px; | |
| font-size: 18px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>Neural Translator</h1> | |
| <textarea id="germanInput" rows="4" placeholder="Type German here..."></textarea> | |
| <button id="translateButton">Translate</button> | |
| <h2>Translation</h2> | |
| <p id="result"></p> | |
| <script> | |
| const button = document.getElementById("translateButton"); | |
| const input = document.getElementById("germanInput"); | |
| const result = document.getElementById("result"); | |
| button.addEventListener("click", async () => { | |
| const germanText = input.value; | |
| const response = await fetch("/translate", { | |
| method: "POST", | |
| headers: { "Content-Type": "application/json" }, | |
| body: JSON.stringify({ text: germanText }), | |
| }); | |
| const data = await response.json(); | |
| result.textContent = data.translation; | |
| }); | |
| </script> | |
| </body> | |
| </html> |