Files
stain.otf/index.html
2025-11-09 12:01:59 -08:00

187 lines
5.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Stain Font Preview</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
:root {
color-scheme: light;
--bg: #f7f7f8;
--fg: #111827;
--muted: #6b7280;
--border: #e5e7eb;
--font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
margin: 0;
padding: 1.5rem;
font-family: var(--font-ui);
background: var(--bg);
color: var(--fg);
}
h1 {
margin: 0 0 0.75rem;
font-size: 1.8rem;
font-weight: 600;
letter-spacing: 0.03em;
}
p {
margin: 0 0 0.75rem;
color: var(--muted);
font-size: 0.95rem;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
align-items: center;
margin: 1.25rem 0 0.5rem;
font-size: 0.8rem;
color: var(--muted);
}
.controls input[type="range"] {
flex: 1;
}
.tag {
padding: 0.15rem 0.5rem;
border-radius: 999px;
border: 1px solid var(--border);
font-size: 0.7rem;
color: var(--muted);
}
.input-wrap {
display: flex;
align-items: center;
gap: 0.4rem;
font-size: 0.8rem;
color: var(--muted);
margin-bottom: 1.25rem;
}
.input-wrap input {
flex: 1;
padding: 0.35rem 0.5rem;
border-radius: 0.4rem;
border: 1px solid var(--border);
font-family: var(--font-ui);
font-size: 0.85rem;
}
.grid {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 1.25rem;
}
@media (min-width: 768px) {
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.panel {
padding: 1rem 1.1rem;
border-radius: 0.85rem;
border: 1px solid var(--border);
background: #ffffff;
box-shadow: 0 10px 25px rgba(15,23,42,0.03);
display: flex;
flex-direction: column;
gap: 0.35rem;
min-height: 110px;
}
.label {
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.16em;
color: var(--muted);
}
.sample {
flex: 1;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.2ch;
font-size: 40px;
letter-spacing: 0.03em;
color: var(--fg);
word-break: break-word;
}
@font-face {
font-family: "Stain";
src: url("./dist/Stain.otf") format("opentype");
font-weight: 400;
font-style: normal;
font-display: swap;
}
.stain {
font-family: "Stain", system-ui, sans-serif;
}
.sys {
font-family: "Candara", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
</style>
</head>
<body>
<h1>Stain Font Preview</h1>
<p>
Compare the in-progress "Stain" typeface against your system font (Candara preferred) in light mode.
AZ / az currently implemented as basic outlines.
</p>
<div class="controls">
<span class="tag">AZ az</span>
<span>Size</span>
<input id="size" type="range" min="18" max="96" value="40" />
<span id="sizeVal">40px</span>
<span>Letter spacing</span>
<input id="track" type="range" min="-10" max="40" value="3" />
<span id="trackVal">0.03em</span>
</div>
<div class="input-wrap">
<span>Sample text:</span>
<input id="text" value="Stain: The quick brown fox jumps over the lazy dog. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG." />
</div>
<div class="grid">
<section class="panel">
<div class="label">Stain</div>
<div id="stainSample" class="sample stain">
Stain: The quick brown fox jumps over the lazy dog. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.
</div>
</section>
<section class="panel">
<div class="label">System (Candara / fallback)</div>
<div id="sysSample" class="sample sys">
Stain: The quick brown fox jumps over the lazy dog. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.
</div>
</section>
</div>
<script>
const text = document.getElementById("text");
const size = document.getElementById("size");
const sizeVal = document.getElementById("sizeVal");
const track = document.getElementById("track");
const trackVal = document.getElementById("trackVal");
const stainSample = document.getElementById("stainSample");
const sysSample = document.getElementById("sysSample");
const update = () => {
const content = text.value || "Stain: The quick brown fox jumps over the lazy dog. THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.";
const fs = size.valueAsNumber || 40;
const ls = (track.valueAsNumber || 3) / 100;
sizeVal.textContent = `${fs}px`;
trackVal.textContent = `${ls.toFixed(2)}em`;
[stainSample, sysSample].forEach((el) => {
el.textContent = content;
el.style.fontSize = `${fs}px`;
el.style.letterSpacing = `${ls}em`;
});
};
text.addEventListener("input", update);
size.addEventListener("input", update);
track.addEventListener("input", update);
window.addEventListener("load", update);
</script>
</body>
</html>