diff --git a/internal/api/api.go b/internal/api/api.go index b142b49..c23333f 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -77,7 +77,7 @@ func (s *Server) Handler() http.Handler { r.URL.Path = "/web/" static.ServeHTTP(w, r) }) - for _, name := range []string{"app.js", "app.css", "sei.svg"} { + for _, name := range []string{"app.js", "app.css", "sei.svg", "lateral-regular.woff2", "lateral-bold.woff2", "items-text.woff2", "repro-mono.woff2"} { mux.HandleFunc("GET /"+name, func(w http.ResponseWriter, r *http.Request) { r.URL.Path = "/web/" + name static.ServeHTTP(w, r) diff --git a/internal/api/api_test.go b/internal/api/api_test.go index 11471be..4542ee0 100644 --- a/internal/api/api_test.go +++ b/internal/api/api_test.go @@ -229,7 +229,11 @@ func TestPage(t *testing.T) { !strings.Contains(w.Header().Get("Content-Security-Policy"), "frame-ancestors 'none'") { t.Fatalf("index: %d %v", w.Code, w.Header()) } - for path, kind := range map[string]string{"/app.js": "javascript", "/app.css": "css", "/sei.svg": "svg"} { + for path, kind := range map[string]string{ + "/app.js": "javascript", "/app.css": "css", "/sei.svg": "svg", + "/lateral-regular.woff2": "font/woff2", "/lateral-bold.woff2": "font/woff2", + "/items-text.woff2": "font/woff2", "/repro-mono.woff2": "font/woff2", + } { if w := h.do("GET", path, ""); w.Code != http.StatusOK || !strings.Contains(w.Header().Get("Content-Type"), kind) { t.Fatalf("%s: %d %s", path, w.Code, w.Header().Get("Content-Type")) } diff --git a/internal/api/web/app.css b/internal/api/web/app.css index 4b64444..5d17dde 100644 --- a/internal/api/web/app.css +++ b/internal/api/web/app.css @@ -1,17 +1,38 @@ +@font-face { + font-family: Lateral; + src: url(/lateral-regular.woff2) format("woff2"); + font-weight: 400; + font-display: swap; +} +@font-face { + font-family: Lateral; + src: url(/lateral-bold.woff2) format("woff2"); + font-weight: 700; + font-display: swap; +} +@font-face { + font-family: "Items Text"; + src: url(/items-text.woff2) format("woff2"); + font-display: swap; +} +@font-face { + font-family: "ABC Repro Mono"; + src: url(/repro-mono.woff2) format("woff2"); + font-display: swap; +} :root { - --page: #F5F5F7; - --card: #FFFFFF; + --page: #f5f5f7; + --card: #ffffff; --text: #000000; --muted: #666666; - --line: #CCCCCC; + --line: #cccccc; --sei: #600014; - --gold: #966F22; - --tint: #E9DCE1; - --tint-text: #600014; + --gold: #966f22; + --gold-text: #8c671f; + --tint: #f5f5f7; --bad: #600014; - --button: #000000; - --button-text: #FFFFFF; - --display: "Lateral", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif; + --focus: #600014; + --display: Lateral, "Arial Narrow", system-ui, sans-serif; --serif: "Items Text", Georgia, "Times New Roman", serif; --mono: "ABC Repro Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; } @@ -19,14 +40,14 @@ :root { --page: #000000; --card: #131313; - --text: #FFFFFF; + --text: #ffffff; --muted: #999999; --line: #333333; - --tint: #460812; - --tint-text: #DCCDD0; - --bad: #B99BA1; - --button: #FFFFFF; - --button-text: #000000; + --gold: #d6c9ac; + --gold-text: var(--gold); + --tint: #000000; + --bad: #b99ba1; + --focus: #b99ba1; } } * { box-sizing: border-box; } @@ -36,135 +57,127 @@ body { min-height: 100vh; display: flex; flex-direction: column; - font: 18px/1.2 var(--serif); + font: 16px/1.5 var(--display); color: var(--text); background: var(--page); - overflow-x: hidden; } -body::before { - content: ""; - position: fixed; - z-index: -1; - width: 80vmax; - height: 80vmax; - right: -25vmax; - bottom: -30vmax; - background: url(/sei.svg) center / contain no-repeat; - opacity: .05; - pointer-events: none; -} -@media (prefers-color-scheme: dark) { body::before { filter: invert(1) grayscale(1); opacity: .035; } } -.bar, .layout, footer { max-width: 72rem; width: 100%; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; } -.bar { display: flex; align-items: center; justify-content: space-between; padding-top: 1.5rem; padding-bottom: 1.5rem; } -.brand { display: block; color: var(--text); } +a { color: inherit; text-decoration: none; } +button, input { font: inherit; } +:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; } +.skip-link { position: absolute; top: -5rem; left: 1.5rem; padding: .75rem 1rem; background: var(--card); z-index: 2; } +.skip-link:focus { top: 1rem; } +.bar, .layout, footer { width: min(100% - 6rem, 75rem); margin: 0 auto; } +.bar { display: flex; align-items: center; justify-content: space-between; min-height: 104px; border-bottom: 1px solid var(--line); } +.brand { display: block; padding: 12px 0; } .lockup { display: block; height: 32px; width: auto; } .lockup.dark { display: none; } @media (prefers-color-scheme: dark) { .lockup.light { display: none; } .lockup.dark { display: block; } } -.pill, .kicker, label, button, dt, footer, .hint, .steps span, .progress, .mono { font-family: var(--mono); } -.pill, .kicker, label, dt, footer, .progress { font-size: 12px; line-height: 1.3; text-transform: uppercase; letter-spacing: .02em; } -.pill { padding: .35rem .7rem; color: var(--tint-text); background: var(--tint); display: inline-flex; align-items: center; gap: .5rem; } -.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-in-out infinite; } -.layout { flex: 1; display: grid; gap: 3rem; align-items: start; padding-top: 3rem; padding-bottom: 4rem; } -@media (max-width: 59.99rem) { .card { order: -1; } } -@media (min-width: 60rem) { .layout { grid-template-columns: 1.1fr 1fr; gap: 5rem; padding-top: 5rem; } } -.kicker { margin: 0 0 1rem; color: var(--sei); } -@media (prefers-color-scheme: dark) { .kicker { color: var(--bad); } } -h1 { margin: 0 0 1.25rem; font: bold clamp(48px, 7vw, 84px)/.92 var(--display); font-stretch: condensed; letter-spacing: -.01em; max-width: 12ch; } -.lede { margin: 0 0 2.5rem; font-size: 20px; color: var(--muted); max-width: 34ch; } -.steps { list-style: none; margin: 0 0 2.5rem; padding: 0; border-top: 1px solid var(--line); } -.steps li { display: flex; gap: 1.25rem; padding: 1rem 0; border-bottom: 1px solid var(--line); } -.steps span { font-size: 12px; line-height: 1.6; color: var(--muted); } -.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 0; } -.stats dt { color: var(--muted); margin-bottom: .4rem; } -.stats dd { margin: 0; font: bold 28px/1 var(--display); font-stretch: condensed; } -.card { - position: relative; - padding: 2.25rem; - background: var(--card); - border: 1px solid var(--line); - animation: rise .5s ease-out both; -} -.card::before { content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 3px; background: var(--sei); } -h2 { margin: 0 0 1.75rem; font: bold 32px/1 var(--display); font-stretch: condensed; } -label { display: block; margin-bottom: .5rem; color: var(--muted); } -.field { display: flex; border: 1px solid var(--line); background: var(--page); transition: border-color .15s; } -.field:focus-within { border-color: var(--text); } -.field[data-state="valid"] { border-color: var(--text); } +.docs-link, .pill, .kicker, .eyebrow, label, button, dt, footer, .hint, .step-number, .progress, .mono, .testnet-note { font-family: var(--mono); } +.docs-link, .pill, .kicker, .eyebrow, label, dt, footer, .step-number, .progress { font-size: 11px; line-height: 1.5; text-transform: uppercase; letter-spacing: .03em; } +.docs-link { display: flex; align-items: center; gap: 1.5rem; min-height: 44px; } +.docs-link span { font-size: 20px; } +.docs-link:hover { text-decoration: underline; text-underline-offset: 5px; } +.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 6rem; row-gap: 5rem; align-items: start; padding: 4rem 0 2.5rem; } +.hero { padding-top: 1rem; } +.kicker { margin: 0 0 1.75rem; color: var(--gold-text); } +.kicker span { margin-right: .6rem; } +h1 { margin: 0 0 1.5rem; font: 700 clamp(76px, 7.8vw, 112px)/.94 var(--display); letter-spacing: -.025em; max-width: 9ch; } +.lede { margin: 0 0 3rem; font: 21px/1.5 var(--serif); color: var(--muted); max-width: 35ch; } +.stats { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 1rem; margin: 0; padding-top: 1.5rem; border-top: 1px solid var(--line); } +.stats dt { color: var(--muted); margin-bottom: .65rem; } +.stats dd { margin: 0; font: 700 30px/1.15 var(--display); overflow-wrap: anywhere; } +.stats div:first-child dd { color: var(--gold); } +.card { min-width: 0; padding: 2rem; background: var(--card); border: 1px solid var(--line); } +.card-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.75rem; } +.eyebrow { margin: 0; color: var(--muted); } +.pill { padding: .4rem .65rem; color: var(--text); background: var(--tint); display: inline-flex; align-items: center; gap: .5rem; } +.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; } +h2 { margin: 0; font: 700 42px/1.05 var(--display); letter-spacing: -.015em; } +.card-copy { margin: .65rem 0 1.75rem; color: var(--muted); } +label { display: block; margin-bottom: .65rem; } +.field { display: flex; border: 1px solid var(--line); background: var(--card); } +.field:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; } .field[data-state="invalid"] { border-color: var(--bad); } -input { - flex: 1; - min-width: 0; - padding: .9rem 1rem; - font: 15px/1.3 var(--mono); - color: var(--text); - background: transparent; - border: 0; - outline: none; -} -.hint { margin: .5rem 0 0; font-size: 12px; color: var(--muted); } +input { width: 100%; min-width: 0; min-height: 54px; padding: .85rem 1rem; font: 16px/1.5 var(--mono); color: var(--text); background: transparent; border: 0; outline: none; border-radius: 0; } +input::placeholder { color: var(--muted); opacity: 1; } +.hint { min-height: 2.8em; margin: .65rem 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); } .field[data-state="invalid"] + .hint { color: var(--bad); } -.field[data-state="valid"] + .hint::before { content: "✓ "; color: var(--text); } -#captcha:not(:empty) { margin-top: 1rem; } -button { - font-size: 14px; - line-height: 1.3; - text-transform: uppercase; - border-radius: 0; - cursor: pointer; - transition: opacity .15s, background .15s, color .15s; -} -.primary, .secondary { width: 100%; margin-top: 1.25rem; padding: 1rem; display: flex; align-items: center; justify-content: center; gap: .75rem; } -.primary { color: var(--button-text); background: var(--button); border: 1px solid var(--button); } -.primary:hover:not(:disabled) { opacity: .85; } +#captcha:not(:empty) { margin-top: 1rem; max-width: 100%; overflow-x: auto; } +button { font-size: 12px; line-height: 1.5; text-transform: uppercase; border-radius: 0; cursor: pointer; transition: background .15s, color .15s; } +.primary, .secondary { width: 100%; min-height: 52px; padding: .85rem 1rem; display: flex; align-items: center; justify-content: center; gap: .75rem; } +.primary { margin-top: 1rem; color: #ffffff; background: var(--sei); border: 1px solid var(--sei); } +.primary:hover:not(:disabled) { background: #34050d; border-color: #34050d; } .primary:disabled { cursor: progress; opacity: .7; } -.secondary { color: var(--text); background: transparent; border: 1px solid var(--text); } -.secondary:hover { color: var(--button-text); background: var(--button); } -.inline { padding: 0 1rem; font-size: 12px; color: var(--text); background: transparent; border: 0; border-left: 1px solid var(--line); } -.inline:hover { color: var(--sei); } +.button-arrow { font-size: 20px; line-height: 1; } +.testnet-note { margin: .85rem auto 0; max-width: 38ch; font-size: 10px; line-height: 1.6; text-align: center; color: var(--muted); } +.secondary { margin-top: 1.25rem; min-height: 44px; color: var(--text); background: transparent; border: 1px solid var(--line); } +.secondary:hover { background: var(--text); border-color: var(--text); color: var(--card); } +.inline { flex-shrink: 0; padding: 0 .75rem; font-size: 10px; color: var(--text); background: transparent; border: 0; border-left: 1px solid var(--line); min-height: 44px; } +.inline:hover { background: var(--tint); text-decoration: underline; text-underline-offset: 3px; } .spinner { display: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; } .primary[data-busy="true"] .spinner { display: block; } -:focus-visible { outline: 2px solid var(--sei); outline-offset: 2px; } -.progress { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 1.5rem 0 0; padding: 0; counter-reset: step; } +.primary[data-busy="true"] .button-arrow { display: none; } +.progress { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 1.5rem 0 0; padding: 0; } .progress li { position: relative; padding-top: 1rem; color: var(--muted); } -.progress li::before { content: ""; position: absolute; top: 0; left: 0; right: 4px; height: 3px; background: var(--line); } -.progress li[data-state="active"] { color: var(--text); } +.progress li::before { content: ""; position: absolute; top: 0; left: 0; right: 4px; height: 2px; background: var(--line); } +.progress li[data-state="active"], .progress li[data-state="done"] { color: var(--text); } .progress li[data-state="active"]::before { background: var(--text); animation: pulse 1.2s ease-in-out infinite; } -.progress li[data-state="done"] { color: var(--text); } .progress li[data-state="done"]::before { background: var(--text); } .progress li[data-state="failed"] { color: var(--bad); } .progress li[data-state="failed"]::before { background: var(--bad); } -#status { - margin-top: 1rem; - padding: .9rem 1rem; - font-size: 16px; - overflow-wrap: anywhere; - border: 1px solid var(--line); - border-left: 4px solid var(--muted); - background: var(--page); - animation: rise .25s ease-out; -} +#status { margin-top: 1rem; padding: .9rem 1rem; overflow-wrap: anywhere; border: 1px solid var(--line); border-left: 3px solid var(--muted); background: var(--page); } #status:empty { display: none; } #status[data-kind="ok"] { border-left-color: var(--text); } #status[data-kind="error"] { border-left-color: var(--bad); } .tx { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; } -.tx .mono { flex: 1; font-size: 12px; color: var(--muted); } +.tx .mono { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); } .tx .inline { align-self: stretch; padding: .25rem .75rem; } -.details { margin: 1.75rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); display: grid; gap: .7rem; } -.details div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; align-items: baseline; } +.details { margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); display: grid; gap: .75rem; } +.details div { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1rem; align-items: baseline; } .details dt { color: var(--muted); } -.details dd { margin: 0; font-size: 16px; overflow-wrap: anywhere; } -dd.mono { font-size: 11.5px; } -footer { padding-top: 1.5rem; padding-bottom: 1.5rem; color: var(--muted); border-top: 1px solid var(--line); } +.details dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; } +dd.mono { font-size: 10px; line-height: 1.6; } +.guide { grid-column: 1 / -1; padding-top: 2rem; border-top: 1px solid var(--line); } +.guide h2 { font-size: 28px; } +.steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem; margin: 1.75rem 0 0; padding: 0; } +.steps li { display: flex; gap: 1rem; } +.step-number { color: var(--gold-text); padding-top: .2rem; } +.steps h3 { margin: 0 0 .5rem; font-size: 16px; font-weight: 400; } +.steps p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 29ch; } +footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1.5rem 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; } +.footer-divider { margin: 0 .75rem; color: var(--line); } @keyframes spin { to { transform: rotate(360deg); } } @keyframes pulse { 50% { opacity: .3; } } -@keyframes rise { from { opacity: 0; transform: translateY(6px); } } @media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } } -@media (max-width: 30rem) { +@media (max-width: 68rem) { + .layout { column-gap: 3rem; } .card { padding: 1.5rem; } - .stats { grid-template-columns: 1fr 1fr; } - .stats dd { font-size: 24px; } - .details div { grid-template-columns: 1fr; gap: .15rem; } + .stats { gap: .65rem; } + .stats dd { font-size: 26px; } +} +@media (max-width: 52rem) { + .bar, .layout, footer { width: min(100% - 3rem, 36rem); } + .bar { min-height: 88px; } + .layout { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding-top: 2.5rem; } + .hero { padding-top: 0; } + .kicker { margin-bottom: 1.25rem; } + h1 { font-size: clamp(76px, 16vw, 100px); max-width: 12ch; } + .lede { margin-bottom: 1.75rem; font-size: 19px; } + .stats { padding-top: 1.25rem; } + .stats dd { font-size: 28px; } + .card { padding: 1.75rem; } + .guide { padding-top: 1.75rem; } + .steps { grid-template-columns: 1fr; gap: 1.5rem; } + .steps p { max-width: none; } +} +@media (max-width: 24rem) { + .bar, .layout, footer { width: calc(100% - 2rem); } + .card { padding: 1.25rem; } + .card-heading { gap: .5rem; } + .stats dt { font-size: 10px; } + .stats dd { font-size: 25px; } + .details div { grid-template-columns: 4rem minmax(0, 1fr); gap: .5rem; } } diff --git a/internal/api/web/app.js b/internal/api/web/app.js index 5e970c4..5004fdb 100644 --- a/internal/api/web/app.js +++ b/internal/api/web/app.js @@ -49,14 +49,19 @@ function busy(on) { function validate() { const v = $("address").value.trim(); - $("field").dataset.state = !v ? "" : ADDRESS.test(v) ? "valid" : "invalid"; - return ADDRESS.test(v); + const valid = ADDRESS.test(v); + const invalid = Boolean(v) && !valid; + $("field").dataset.state = !v ? "" : valid ? "valid" : "invalid"; + $("address").setAttribute("aria-invalid", String(invalid)); + $("hint").textContent = invalid ? "Enter a valid address: 0x followed by 40 hex characters." + : valid ? "Valid EVM address. You're ready to request SEI." + : "Enter an EVM address: 0x + 40 hex characters."; + return valid; } async function load() { info = await (await fetch("/api/info")).json(); document.title = `${info.chainName} faucet`; - $("title").textContent = `${info.chainName} faucet`; $("network").textContent = info.chainName; $("amount").textContent = `${sei(info.amountWei)} SEI`; $("cooldown").textContent = `1 per ${info.addressCooldownSeconds / 3600}h`; @@ -99,6 +104,8 @@ $("form").onsubmit = async (e) => { e.preventDefault(); if (!validate()) { $("field").dataset.state = "invalid"; + $("address").setAttribute("aria-invalid", "true"); + $("hint").textContent = "Enter a valid address: 0x followed by 40 hex characters."; $("address").focus(); show(""); return; diff --git a/internal/api/web/index.html b/internal/api/web/index.html index df1aa23..8a3bd74 100644 --- a/internal/api/web/index.html +++ b/internal/api/web/index.html @@ -10,37 +10,36 @@ +
-Testnet +Developer docs
-

Testnet faucet

-

Get testnet SEI in seconds.

-

Fund a wallet to deploy contracts and send transactions on Sei. Testnet tokens have no value.

-
    -
  1. 01Paste an EVM address, or fill it from your wallet.
  2. -
  3. 02Confirm you are human.
  4. -
  5. 03Get SEI once the transfer is confirmed on chain.
  6. -
+

Built for building

+

Get testnet SEI.

+

Your next idea starts here. Fund a wallet to deploy contracts and explore the Sei testnet.

Per claim
–
-
Limit
–
+
Claim limit
–
Faucet balance
–
-
-

Sei testnet faucet

+
+

Testnet faucet

Testnet
+

Fund your wallet

+

Test tokens. Real possibilities.

- +
- +
-

0x followed by 40 hex characters

+

Enter an EVM address: 0x + 40 hex characters.

- + +

For testing only. Testnet SEI has no monetary value.

+
+

From wallet to testnet.

+
    +
  1. 01

    Bring your wallet

    Paste your EVM address, or use your connected wallet.

  2. +
  3. 02

    Make a request

    Complete the human verification when prompted.

  4. +
  5. 03

    Start building

    Your SEI arrives once the transfer is confirmed on chain.

  6. +
+
- + diff --git a/internal/api/web/items-text.woff2 b/internal/api/web/items-text.woff2 new file mode 100644 index 0000000..4c44951 Binary files /dev/null and b/internal/api/web/items-text.woff2 differ diff --git a/internal/api/web/lateral-bold.woff2 b/internal/api/web/lateral-bold.woff2 new file mode 100644 index 0000000..1e1f09c Binary files /dev/null and b/internal/api/web/lateral-bold.woff2 differ diff --git a/internal/api/web/lateral-regular.woff2 b/internal/api/web/lateral-regular.woff2 new file mode 100644 index 0000000..6ba56ed Binary files /dev/null and b/internal/api/web/lateral-regular.woff2 differ diff --git a/internal/api/web/repro-mono.woff2 b/internal/api/web/repro-mono.woff2 new file mode 100644 index 0000000..af34afe Binary files /dev/null and b/internal/api/web/repro-mono.woff2 differ