daanil-ivanov's picture
Add release card, license, calibration, benchmarks and generation examples
b081c86 verified
Raw History Blame Contribute Delete
3.18 kB
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Self-contained HTML</title>
<style>
body { margin: 0; }
button { font: inherit; }
</style>
</head>
<body>
<div id="root"></div>
<script src="data:text/javascript,noop"></script>
</body>
</html>
But "Output at most ten lines" and "Return one self-contained HTML document with a button labeled Save." The document should include a Save button. Since no content specified, create a minimal self-contained document with a button labeled Save. The button can trigger a download of the document or maybe a toast. Let's make it download the HTML as a file, with a toast.
Let me write it.
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Self-contained HTML</title>
<style>
body { margin: 0; }
.wrap { max-width: 40px; margin: 0 auto; padding: 32px 16px; }
.save-btn {
width: 100%;
padding: 12px 16px;
border: 2px solid #0f172a;
border-radius: 4px;
background: #0f172a;
color: #fff;
font-weight: 700;
cursor: pointer;
}
.save-btn:hover { background: #22334a; }
.save-btn:focus-visible { outline: 3px solid #9fb1c9; outline-offset: 3px; }
.hint { text-align: center; color: #667085; font-size: 12px; }
</style>
</head>
<body>
<div class="wrap">
<h1 style="margin: 0 0 8px; font-size: 24px">Self-contained HTML</h1>
<p class="hint">Everything you need, right here. No dependencies.</p>
<button class="save-btn" type="button" id="save-btn" onclick="window.download('self-contained.html', document.documentElement.textContent.replace('#root', ''))">
Save
</button>
</div>
</body>
</html>
```
Hmm, but `download` with text content — the file would contain HTML text, fine. But downloading the whole document with `document.documentElement.textContent` includes style etc. Good.
Actually let me do something simpler and elegant: a "Save" button that downloads the document as a text file. Add a toast for confirmation.
Also maybe include a small inline SVG? "Omit styling, scripts, comments and explanation" — inline SVG is fine but let's keep it minimal. Maybe a small icon (↓) via text.
Let me write the final code carefully. Ensure only one HTML document, no comments, no extra scripts.
Also note: the page itself should be self-contained — no external assets needed.
Let me produce the output.
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Self-contained HTML</title>
<style>
body { margin: 0; }
.wrap { max-width: 40px; margin: 0 auto; padding: 32px 16px; }
h1 { margin: 0 0 6px; font-size: 22px; }
p { margin: 0 0 20px; color: #555; font-size: 13px; }
.save-btn {
width: 100%;
padding: 11px 15px;
border: 1px solid #0f172a;
border-radius: 4px;
background: #0f172a;
color: #fff;
font-weight: 700;
cursor: pointer;
}
.save-btn:hover { background: #22334a; }
.save-btn:active { background: #33465f; }
.status { min-height: 18px; margin-top: 10px