diff --git a/css/imrs.css b/css/imrs.css new file mode 100644 index 0000000..bde5553 --- /dev/null +++ b/css/imrs.css @@ -0,0 +1,396 @@ +:root { + --bg-deep: #100b09; + --bg: #1c1310; + --bg-raised: #251a15; + --bg-card: #2e2018; + --border: #3d2b1f; + --border-hover:#5c3d28; + --text: #f4deb8; + --text-muted: #e8c28a; + --text-dim: #b37a48; + --accent: #d4975c; + --accent-bright:#e8c28a; + --accent-dim: rgba(212, 151, 92, 0.14); + --green: #4caf7d; + --red: #e06c6c; + --font-serif: 'Lota', Georgia, 'Times New Roman', serif; + --font-mono: 'Sometype Mono', 'Monaco', 'Courier New', monospace; + --font-sans: 'DM Sans', system-ui, sans-serif; + --radius: 10px; + --transition: 0.2s ease; + --max-w: 680px; +} + +*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } + +html { scroll-behavior: smooth; } + +body { + font-family: var(--font-serif); + font-size: 16px; + line-height: 1.7; + color: var(--text); + background-color: var(--bg); + -webkit-font-smoothing: antialiased; +} + +/* ── Typography ── */ + +h1, h2, h3 { + font-family: var(--font-mono); + font-weight: 600; + line-height: 1.2; +} + +a { + color: var(--accent); + text-decoration: none; + transition: opacity var(--transition); +} +a:hover { opacity: 0.75; } + +code { + font-family: var(--font-mono); + font-size: 0.875em; + background: var(--bg-raised); + padding: 0.15em 0.4em; + border-radius: 4px; + color: var(--accent); + word-break: break-all; +} + +/* ── Header ── */ + +.site-header { + position: sticky; + top: 0; + z-index: 100; + background: var(--bg); + backdrop-filter: blur(12px); + border-bottom: 1px solid var(--border); +} + +.nav-container { + max-width: var(--max-w); + margin: 0 auto; + padding: 0.875rem 1.5rem; + display: flex; + justify-content: space-between; + align-items: center; +} + +.nav-logo { + font-family: var(--font-serif); + font-style: italic; + font-size: 1.25rem; + color: var(--text); +} +.nav-logo:hover { opacity: 0.6; } + +.nav-menu { + list-style: none; + display: flex; + gap: 1.5rem; +} + +.nav-menu a { + font-size: 0.875rem; + color: var(--text-muted); + letter-spacing: 0.01em; +} +.nav-menu a:hover { color: var(--text); opacity: 1; } + +/* ── Main ── */ + +.main-content { + max-width: var(--max-w); + margin: 0 auto; + padding: 0 1.5rem; +} + +/* ── Hero ── */ + +.hero { + padding: 4rem 0 3rem; +} + +.hero-eyebrow { + font-size: 0.875rem; + color: var(--text-muted); + margin-bottom: 0.25rem; + letter-spacing: 0.04em; +} + +.hero-title { + font-size: clamp(2.5rem, 6vw, 3.5rem); + color: var(--text); + margin-bottom: 1.25rem; + letter-spacing: -0.02em; +} + +.hero-bio { + font-size: 1.0625rem; + color: var(--text-muted); + line-height: 1.8; + max-width: 560px; + margin-bottom: 1.5rem; +} + +.hero-bio a { + color: var(--accent); + border-bottom: 1px solid var(--accent-dim); + transition: border-color var(--transition), opacity var(--transition); +} +.hero-bio a:hover { + opacity: 1; + border-bottom-color: var(--accent); +} + +/* ── Sections ── */ + +.content-section { + padding: 2.5rem 0; + border-top: 1px solid var(--border); +} + +.section-label { + font-family: var(--font-sans); + font-size: 0.75rem; + font-weight: 500; + text-transform: uppercase; + letter-spacing: 0.1em; + color: var(--text-dim); + margin-bottom: 1.25rem; +} + +/* ── Try it card ── */ + +.try-card { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: var(--radius); + overflow: hidden; +} + +.try-card-body { padding: 1.25rem; } + +.url-row { + display: flex; + gap: 0.5rem; +} + +.url-input { + flex: 1; + background: var(--bg-raised); + border: 1px solid var(--border); + border-radius: 999px; + padding: 0.6rem 1rem; + font-family: var(--font-mono); + font-size: 0.8125rem; + color: var(--text); + outline: none; + transition: border-color var(--transition); +} +.url-input::placeholder { color: var(--text-dim); } +.url-input:focus { border-color: var(--accent); } + +.try-btn { + background: var(--accent); + color: var(--bg); + border: none; + border-radius: 999px; + padding: 0.6rem 1.25rem; + font-family: var(--font-sans); + font-size: 0.875rem; + font-weight: 500; + cursor: pointer; + white-space: nowrap; + transition: opacity var(--transition); + flex-shrink: 0; +} +.try-btn:hover { opacity: 0.85; } +.try-btn:disabled { opacity: 0.4; cursor: not-allowed; } + +.try-result { + display: none; + margin-top: 1rem; +} +.try-result.show { display: block; } + +.result-img-wrap { + border-radius: 8px; + overflow: hidden; + border: 1px solid var(--border); + margin-bottom: 0.875rem; + background: var(--bg-raised); + min-height: 120px; + display: flex; + align-items: center; + justify-content: center; +} + +.result-img-wrap img { + width: 100%; + height: auto; + max-height: 360px; + object-fit: contain; + display: block; +} + +.result-url-row { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.result-url-box { + flex: 1; + font-family: var(--font-mono); + font-size: 0.775rem; + padding: 0.5rem 0.875rem; + background: var(--bg-raised); + border: 1px solid var(--border); + border-radius: 8px; + color: var(--text-muted); + word-break: break-all; + line-height: 1.5; +} + +.copy-btn { + background: var(--bg-raised); + border: 1px solid var(--border); + border-radius: 999px; + padding: 0.5rem 1rem; + font-family: var(--font-sans); + font-size: 0.8125rem; + color: var(--text-muted); + cursor: pointer; + white-space: nowrap; + transition: border-color var(--transition), color var(--transition); + flex-shrink: 0; +} +.copy-btn:hover { border-color: var(--accent); color: var(--accent); } +.copy-btn.copied { background: var(--green); border-color: var(--green); color: var(--bg); } + +.try-error { + display: none; + font-size: 0.875rem; + color: var(--red); + margin-top: 0.75rem; +} +.try-error.show { display: block; } + +.try-card-meta { + font-size: 0.8125rem; + color: var(--text-dim); + padding: 0.75rem 1.25rem; + border-top: 1px solid var(--border); +} + +/* ── Usage examples ── */ + +.usage-list { + display: flex; + flex-direction: column; + gap: 1.25rem; +} + +.usage-item h3 { + font-family: var(--font-sans); + font-size: 0.875rem; + font-weight: 500; + color: var(--text); + margin-bottom: 0.375rem; +} + +.usage-item p { + font-size: 0.875rem; + color: var(--text-muted); + margin-bottom: 0.5rem; + line-height: 1.6; +} + +.code-block { + background: var(--bg-card); + border: 1px solid var(--border); + border-radius: var(--radius); + padding: 0.875rem 1rem; + font-family: var(--font-mono); + font-size: 0.8rem; + color: var(--text-muted); + overflow-x: auto; + line-height: 1.7; + white-space: pre; +} + +.code-block .hl { color: var(--accent); } + +/* ── How it works ── */ + +.steps { + display: flex; + flex-direction: column; +} + +.step { + display: flex; + gap: 1rem; + padding: 1rem 0; + border-bottom: 1px solid var(--border); +} +.step:last-child { border-bottom: none; } + +.step-num { + flex-shrink: 0; + width: 1.75rem; + height: 1.75rem; + border-radius: 50%; + background: var(--bg-card); + border: 1px solid var(--border); + display: flex; + align-items: center; + justify-content: center; + font-size: 0.75rem; + font-weight: 500; + color: var(--accent); + margin-top: 0.1rem; + font-family: var(--font-mono); +} + +.step-body h3 { + font-family: var(--font-serif); + font-size: 0.9375rem; + font-weight: 400; + color: var(--text); + margin-bottom: 0.2rem; +} +.step-body p { + font-size: 0.875rem; + color: var(--text-muted); + line-height: 1.7; +} + +/* ── Footer ── */ + +.site-footer { + max-width: var(--max-w); + margin: 0 auto; + padding: 2.5rem 1.5rem 3rem; + border-top: 1px solid var(--border); + font-size: 0.8125rem; + color: var(--text-dim); + line-height: 1.8; +} + +.site-footer a { color: var(--text-muted); } +.site-footer a:hover { color: var(--text); opacity: 1; } + +/* ── Responsive ── */ + +@media (max-width: 600px) { + .hero { padding: 2.5rem 0 2rem; } + .info-grid { grid-template-columns: 1fr; } + .url-row { flex-direction: column; } + .try-btn { border-radius: var(--radius); } + .nav-menu { display: none; } +} \ No newline at end of file diff --git a/imrs.html b/imrs.html index 08715e9..9b8b34e 100644 --- a/imrs.html +++ b/imrs.html @@ -3,466 +3,48 @@
-madebydanny.uk
+danielmorrisey.com/imrs
- Image media reduction system, easily transform images built on Cloudflare Workers. - Pass any public image URL and get it back converted to AVIF — smaller, faster, cached at the edge. -
-Pass the image URL as a ?url= parameter.
Append the full URL directly after the origin.
-Wrap any src to serve AVIF automatically to supporting browsers.
image/avif — regardless of source format.
Public, immutable, 1-year TTL. Served from edge on repeat requests.
-Access-Control-Allow-Origin: * — safe to use from any origin.
85% AVIF quality. Typically 50–70% smaller than an equivalent JPEG.
-