mirror of
https://github.com/multipleof4/stain.otf.git
synced 2026-01-13 16:17:55 +00:00
109 lines
5.2 KiB
HTML
109 lines
5.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Stain Typeface</title>
|
|
<style>
|
|
@font-face { font-family: 'Stain'; src: url('./dist/Stain.otf') format('opentype'); }
|
|
|
|
:root { --bg: #101010; --fg: #e5e5e5; --border: #333; --font: 'Stain', sans-serif; }
|
|
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); overflow-x: hidden; }
|
|
|
|
/* Layout */
|
|
.container { max-width: 1600px; margin: 0 auto; padding: 2rem 5%; }
|
|
a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
|
|
a:hover { opacity: 0.6; }
|
|
|
|
/* Header */
|
|
nav { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 1.5rem; margin-bottom: 4rem; font-family: sans-serif; font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase; }
|
|
.brand { font-family: var(--font); font-size: 1.5rem; text-transform: none; }
|
|
.menu { display: flex; gap: 2rem; }
|
|
.btn { border: 1px solid var(--fg); padding: 0.6rem 1.2rem; border-radius: 4px; transition: 0.2s; }
|
|
.btn:hover { background: var(--fg); color: var(--bg); opacity: 1; }
|
|
|
|
/* Hero */
|
|
h1 { font-size: clamp(6rem, 20vw, 18rem); line-height: 0.8; margin: 0 0 2rem 0; letter-spacing: -0.04em; font-weight: normal; }
|
|
.intro { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; border-bottom: 1px solid var(--border); padding-bottom: 4rem; margin-bottom: 6rem; }
|
|
.desc { font-size: 1.4rem; line-height: 1.4; max-width: 600px; }
|
|
|
|
/* Specimen Grid */
|
|
.glyph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); margin-bottom: 8rem; }
|
|
.glyph { background: var(--bg); height: 100px; display: flex; align-items: center; justify-content: center; font-size: 3rem; position: relative; transition: 0.2s; }
|
|
.glyph:hover { background: var(--fg); color: var(--bg); z-index: 2; transform: scale(1.2); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
|
|
.meta { position: absolute; top: 4px; left: 6px; font-size: 9px; font-family: sans-serif; opacity: 0.5; }
|
|
|
|
/* Type Tester */
|
|
.tester { min-height: 60vh; }
|
|
.tester-header { display: flex; justify-content: space-between; margin-bottom: 2rem; font-family: sans-serif; font-size: 0.8rem; color: #888; text-transform: uppercase; }
|
|
textarea { width: 100%; background: transparent; border: none; color: var(--fg); font-family: var(--font); font-size: 96px; line-height: 1; resize: none; outline: none; height: auto; overflow: hidden; }
|
|
input[type=range] { width: 200px; accent-color: var(--fg); }
|
|
|
|
footer { padding: 4rem 0; border-top: 1px solid var(--border); margin-top: 4rem; text-align: center; font-family: sans-serif; font-size: 0.8rem; color: #666; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<nav>
|
|
<span class="brand">Stain.otf</span>
|
|
<div class="menu">
|
|
<a href="./fox.html">The Fox</a>
|
|
<a href="https://github.com/multipleof4/stain.otf">GitHub</a>
|
|
<a href="./dist/Stain.otf" class="btn" download>Download</a>
|
|
</div>
|
|
</nav>
|
|
|
|
<header>
|
|
<h1>Stain</h1>
|
|
<div class="intro">
|
|
<div class="desc">
|
|
A procedural OpenType typeface constructed with JavaScript. <br>
|
|
Organic curves meet rigorous logic.
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<main>
|
|
<div class="glyph-grid">
|
|
<!-- Standard ASCII set -->
|
|
<script>
|
|
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
chars.split('').forEach(c => {
|
|
document.write(`<div class="glyph"><span class="meta">${c.charCodeAt(0)}</span>${c}</div>`);
|
|
});
|
|
</script>
|
|
</div>
|
|
|
|
<section class="tester">
|
|
<div class="tester-header">
|
|
<span>Type Tester</span>
|
|
<input type="range" min="24" max="240" value="96" id="sizer">
|
|
</div>
|
|
<textarea id="field" spellcheck="false">The quick brown fox jumps over the lazy dog.</textarea>
|
|
</section>
|
|
</main>
|
|
|
|
<footer>
|
|
Public Domain (CC0 1.0) • <a href="https://github.com/multipleof4/stain.otf">View Source</a>
|
|
</footer>
|
|
</div>
|
|
|
|
<script>
|
|
const sizer = document.getElementById('sizer');
|
|
const field = document.getElementById('field');
|
|
|
|
// Font sizing
|
|
sizer.addEventListener('input', e => field.style.fontSize = e.target.value + 'px');
|
|
|
|
// Auto-resize textarea
|
|
const fit = () => {
|
|
field.style.height = 'auto';
|
|
field.style.height = field.scrollHeight + 'px';
|
|
};
|
|
field.addEventListener('input', fit);
|
|
window.addEventListener('resize', fit);
|
|
fit();
|
|
</script>
|
|
</body>
|
|
</html>
|