diff options
Diffstat (limited to 'static')
| -rw-r--r-- | static/app.js | 34 | ||||
| -rw-r--r-- | static/index.html | 61 | ||||
| -rw-r--r-- | static/styles.css | 231 |
3 files changed, 204 insertions, 122 deletions
diff --git a/static/app.js b/static/app.js index bb09c86..6a93a95 100644 --- a/static/app.js +++ b/static/app.js @@ -2,6 +2,12 @@ const MAX_BYTES = 10 * 1024 * 1024; const ALLOWED_EXTENSIONS = /\.(jpe?g|png|heic)$/i; const form = document.querySelector('#upload-form'); +const pageTitle = document.querySelector('#page-title'); +const notice = document.querySelector('.notice'); +const requirements = document.querySelector('.requirements'); +const metadataFields = document.querySelector('#metadata-fields'); +const description = document.querySelector('#description'); +const characterCount = document.querySelector('#character-count'); const input = document.querySelector('#image-input'); const dropZone = document.querySelector('#drop-zone'); const fileRow = document.querySelector('#file-row'); @@ -28,6 +34,27 @@ function clearSelection() { preview.removeAttribute('src'); } +function showCompletion(message, receipt) { + input.value = ''; + input.disabled = true; + fileRow.hidden = true; + dropZone.hidden = true; + submitButton.hidden = true; + removeButton.disabled = true; + if (previewUrl) URL.revokeObjectURL(previewUrl); + previewUrl = null; + preview.removeAttribute('src'); + pageTitle.textContent = 'Upload complete'; + notice.textContent = 'Your image was submitted for private review.'; + requirements.hidden = true; + metadataFields.hidden = true; + setStatus(`${message} Receipt: ${receipt}`, 'success'); +} + +description.addEventListener('input', () => { + characterCount.textContent = `${description.value.length} / 1000 characters`; +}); + function validate(file) { if (!file) return 'Choose an image to continue.'; if (!ALLOWED_EXTENSIONS.test(file.name)) return 'Choose a JPG, PNG, or HEIC image.'; @@ -86,19 +113,18 @@ form.addEventListener('submit', async (event) => { const file = input.files[0]; const error = validate(file); if (error) { setStatus(error, 'error'); return; } + if (!form.reportValidity()) return; submitButton.disabled = true; submitButton.querySelector('span').textContent = 'Submitting…'; setStatus('Securely sending your image…'); - const body = new FormData(); - body.append('image', file); + const body = new FormData(form); try { const response = await fetch(window.location.pathname, { method: 'POST', body }); const result = await response.json(); if (!response.ok) throw new Error(result.message || 'Upload failed.'); - clearSelection(); - setStatus(`${result.message} Receipt: ${result.receipt}`, 'success'); + showCompletion(result.message, result.receipt); } catch (error) { submitButton.disabled = false; setStatus(error.message || 'Upload failed. Please try again.', 'error'); diff --git a/static/index.html b/static/index.html index 3100128..779e688 100644 --- a/static/index.html +++ b/static/index.html @@ -4,42 +4,38 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="Submit one image privately for review."> - <title>Private Drop</title> + <title>Blind Uploader</title> <link rel="stylesheet" href="/styles.css"> </head> <body> - <main class="shell"> - <header class="masthead"> - <a class="brand" href="/" aria-label="Private Drop home"> - <span class="brand-mark" aria-hidden="true"></span> - Private Drop - </a> - <span class="privacy-label"><span aria-hidden="true">●</span> Private intake</span> - </header> + <main class="page"> + <section class="upload-box" aria-labelledby="page-title"> + <h1 id="page-title">Blind Uploader</h1> + <p class="notice">Submit one image for private review. The file will be renamed, stored outside the public website, and will not be available through a public link.</p> + <p class="requirements">Accepted formats: JPG, PNG, or HEIC. Maximum size: 10 MB.</p> - <section class="intro" aria-labelledby="page-title"> - <p class="eyebrow">Secure image submission</p> - <h1 id="page-title">Send one image.<br><em>Nothing more.</em></h1> - <p class="lede">Your image is delivered directly to our private review queue. It is never published or made available through a public link.</p> - </section> + <form id="upload-form"> + <fieldset class="metadata-fields" id="metadata-fields"> + <legend>Submission details</legend> - <section class="upload-card" aria-labelledby="upload-title"> - <div class="card-heading"> - <div> - <p class="step">01 / Upload</p> - <h2 id="upload-title">Choose your image</h2> - </div> - <p class="formats">JPG · PNG · HEIC<br>10 MB maximum</p> - </div> + <label for="callsign">Amateur radio callsign</label> + <input id="callsign" name="callsign" type="text" maxlength="32" autocomplete="off" required> + + <label for="submitter-name">Name</label> + <input id="submitter-name" name="name" type="text" maxlength="200" autocomplete="name" required> + + <label for="email">Email address</label> + <input id="email" name="email" type="email" maxlength="254" autocomplete="email" required> + + <label for="description">A brief description of the file</label> + <textarea id="description" name="description" maxlength="1000" rows="5" required></textarea> + <span class="character-count" id="character-count">0 / 1000 characters</span> + </fieldset> - <form id="upload-form" novalidate> <input id="image-input" name="image" type="file" accept=".jpg,.jpeg,.png,.heic,image/jpeg,image/png,image/heic,image/heif" required> <label class="drop-zone" for="image-input" id="drop-zone"> - <span class="upload-icon" aria-hidden="true"> - <svg viewBox="0 0 24 24" role="img"><path d="M12 16V4m0 0L7.5 8.5M12 4l4.5 4.5M5 14.5V19h14v-4.5"/></svg> - </span> - <span class="drop-title">Drop an image here</span> - <span class="drop-copy">or <u>browse your device</u></span> + <span class="drop-title">Choose an image</span> + <span class="drop-copy">or drag and drop it here</span> </label> <div class="file-row" id="file-row" hidden> @@ -53,17 +49,10 @@ <p class="status" id="status" role="status" aria-live="polite"></p> <button class="submit-button" type="submit" id="submit-button" disabled> - <span>Submit image</span><span aria-hidden="true">↗</span> + <span>Submit image</span> </button> </form> </section> - - <aside class="privacy-note"> - <span class="lock" aria-hidden="true">⌁</span> - <div><strong>Private by design</strong><p>Files are renamed on arrival, stored outside the public website, and available only to the review team.</p></div> - </aside> - - <footer><span>Private Drop</span><span>Confidential image intake</span></footer> </main> <script src="/app.js" defer></script> </body> diff --git a/static/styles.css b/static/styles.css index b59e7a3..4a1ffd1 100644 --- a/static/styles.css +++ b/static/styles.css @@ -1,120 +1,187 @@ :root { - --ink: #191815; - --paper: #f3efe6; - --card: #fbf8f1; - --accent: #ddff4f; - --muted: #756f64; - --line: #d5cfc2; - --error: #a63b2b; - --success: #336440; + --background: #f4f4f4; + --surface: #ffffff; + --text: #202124; + --muted: #62666b; + --border: #c9ccd1; + --primary: #1f5fa9; + --primary-hover: #174d8a; + --error: #a12622; + --success: #23723a; } * { box-sizing: border-box; } +[hidden] { display: none !important; } + body { margin: 0; min-width: 320px; - color: var(--ink); - background: - radial-gradient(circle at 84% 12%, rgba(221, 255, 79, .22), transparent 23rem), - var(--paper); + min-height: 100vh; + color: var(--text); + background: var(--background); font-family: Arial, Helvetica, sans-serif; +} + +button, input, textarea { font: inherit; } + +.page { min-height: 100vh; + display: grid; + place-items: center; + padding: 24px; } -body::before { - content: ""; - position: fixed; - inset: 0; - pointer-events: none; - opacity: .24; - background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E"); +.upload-box { + width: min(100%, 560px); + padding: 32px; + background: var(--surface); + border: 1px solid var(--border); + border-radius: 8px; + box-shadow: 0 4px 18px rgba(0, 0, 0, .07); } -button, input { font: inherit; } +h1 { + margin: 0 0 12px; + font-size: 1.65rem; + line-height: 1.2; +} -.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; position: relative; } +.notice { + margin: 0; + color: var(--text); + line-height: 1.5; +} -.masthead { - height: 90px; - display: flex; - align-items: center; - justify-content: space-between; - border-bottom: 1px solid var(--ink); +.requirements { + margin: 12px 0 24px; + color: var(--muted); + font-size: .9rem; + line-height: 1.4; +} + +.metadata-fields { + display: grid; + gap: 8px; + margin: 0 0 24px; + padding: 0; + border: 0; +} + +.metadata-fields legend { + margin-bottom: 14px; + padding: 0; + font-weight: 700; +} + +.metadata-fields label { margin-top: 6px; font-weight: 700; } + +.metadata-fields input, +.metadata-fields textarea { + width: 100%; + padding: 10px 12px; + border: 1px solid var(--border); + border-radius: 6px; + color: var(--text); + background: var(--surface); } -.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 800; letter-spacing: -.03em; } -.brand-mark { width: 19px; height: 19px; background: var(--ink); border-radius: 50% 50% 2px 50%; transform: rotate(45deg); } -.privacy-label { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; } -.privacy-label span { color: #83a400; margin-right: 7px; } +.metadata-fields textarea { resize: vertical; } -.intro { padding: 76px 0 58px; display: grid; grid-template-columns: 1.45fr .72fr; gap: 8vw; align-items: end; } -.eyebrow, .step { text-transform: uppercase; letter-spacing: .16em; font-size: .68rem; font-weight: 800; margin: 0 0 22px; } -h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(3.35rem, 7vw, 6.5rem); line-height: .86; letter-spacing: -.065em; font-weight: 400; margin: 0; } -h1 em { color: transparent; -webkit-text-stroke: 1.5px var(--ink); font-weight: 400; } -.lede { font-family: Georgia, 'Times New Roman', serif; font-size: 1.18rem; line-height: 1.55; margin: 0 0 3px; max-width: 29rem; } +.metadata-fields input:focus-visible, +.metadata-fields textarea:focus-visible { + border-color: var(--primary); + outline: 3px solid rgba(31, 95, 169, .2); +} -.upload-card { background: var(--card); border: 1px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); padding: clamp(24px, 4vw, 50px); } -.card-heading { display: flex; justify-content: space-between; gap: 30px; align-items: start; margin-bottom: 34px; } -.step { margin-bottom: 8px; color: var(--muted); } -h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.85rem, 3.5vw, 2.65rem); margin: 0; font-weight: 400; letter-spacing: -.035em; } -.formats { margin: 0; text-align: right; font-size: .69rem; line-height: 1.55; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); } -#image-input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; } +.character-count { + justify-self: end; + color: var(--muted); + font-size: .8rem; +} + +#image-input { + position: absolute; + inline-size: 1px; + block-size: 1px; + opacity: 0; +} .drop-zone { - min-height: 250px; - border: 1px dashed #928b80; + min-height: 160px; + border: 2px dashed var(--border); + border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; + gap: 8px; + padding: 24px; text-align: center; cursor: pointer; - transition: background .18s, border-color .18s, transform .18s; - background: rgba(243, 239, 230, .55); + transition: border-color .15s, background .15s; +} + +.drop-zone:hover, +.drop-zone.is-dragging, +#image-input:focus-visible + .drop-zone { + border-color: var(--primary); + background: #f3f7fc; + outline: none; +} + +.drop-title { color: var(--primary); font-weight: 700; } +.drop-copy { color: var(--muted); font-size: .875rem; } + +.file-row { + min-height: 88px; + align-items: center; + border: 1px solid var(--border); + border-radius: 6px; + padding: 10px; + gap: 14px; } -.drop-zone:hover, .drop-zone.is-dragging, #image-input:focus-visible + .drop-zone { background: rgba(221, 255, 79, .16); border-color: var(--ink); outline: none; } -.drop-zone.is-dragging { transform: scale(.992); } -.upload-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; margin-bottom: 20px; } -.upload-icon svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; } -.drop-title { font-family: Georgia, 'Times New Roman', serif; font-size: 1.55rem; margin-bottom: 8px; } -.drop-copy { color: var(--muted); font-size: .82rem; } -.file-row { min-height: 104px; align-items: center; border: 1px solid var(--line); padding: 12px; gap: 16px; background: white; } .file-row:not([hidden]) { display: flex; } -.thumb-wrap { width: 78px; height: 78px; background: #e8e3d9; overflow: hidden; flex: 0 0 auto; } +.thumb-wrap { width: 64px; height: 64px; background: var(--background); overflow: hidden; flex: 0 0 auto; } .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; } -.file-details { min-width: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; } +.file-details { min-width: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; } .file-details strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.file-details span { font-size: .73rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; } -.remove-button { background: transparent; border: 0; font-size: 1.8rem; cursor: pointer; width: 44px; height: 44px; } -.status { min-height: 22px; margin: 16px 0 10px; font-size: .82rem; color: var(--muted); } +.file-details span { color: var(--muted); font-size: .8rem; } +.remove-button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.6rem; cursor: pointer; } + +.status { min-height: 20px; margin: 14px 0 8px; color: var(--muted); font-size: .875rem; line-height: 1.4; } .status.error { color: var(--error); } -.status.success { color: var(--success); font-weight: 700; } - -.submit-button { width: 100%; min-height: 62px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--ink); background: var(--accent); color: var(--ink); font-weight: 800; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; } -.submit-button:not(:disabled):hover { transform: translate(-3px, -3px); box-shadow: 4px 4px 0 var(--ink); } -.submit-button:disabled { background: #ded9cf; color: #8d877c; border-color: #b5afa4; cursor: not-allowed; } - -.privacy-note { display: grid; grid-template-columns: 42px 1fr; gap: 16px; max-width: 600px; margin: 48px auto 88px; } -.lock { border: 1px solid var(--ink); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; font-size: 1.3rem; } -.privacy-note strong { font-size: .72rem; text-transform: uppercase; letter-spacing: .13em; } -.privacy-note p { margin: 7px 0 0; font-family: Georgia, 'Times New Roman', serif; color: var(--muted); line-height: 1.45; } -footer { border-top: 1px solid var(--ink); height: 80px; display: flex; justify-content: space-between; align-items: center; font-size: .65rem; letter-spacing: .13em; text-transform: uppercase; } - -@media (max-width: 720px) { - .shell { width: min(100% - 24px, 1120px); } - .masthead { height: 70px; } - .privacy-label { font-size: .61rem; } - .intro { padding: 52px 0 40px; grid-template-columns: 1fr; gap: 32px; } - .lede { font-size: 1.05rem; max-width: 34rem; } - .upload-card { box-shadow: 5px 5px 0 var(--ink); } - .card-heading { display: block; } - .formats { text-align: left; margin-top: 18px; } - .drop-zone { min-height: 220px; } - footer { align-items: start; flex-direction: column; justify-content: center; gap: 8px; } +.status.success { + margin: 20px 0 0; + padding: 14px; + border: 1px solid #9ac4a5; + border-radius: 6px; + color: var(--success); + background: #f1f8f3; + font-weight: 700; +} + +.submit-button { + width: 100%; + min-height: 46px; + border: 0; + border-radius: 6px; + background: var(--primary); + color: white; + font-weight: 700; + cursor: pointer; +} + +.submit-button:not(:disabled):hover { background: var(--primary-hover); } +.submit-button:focus-visible { outline: 3px solid rgba(31, 95, 169, .3); outline-offset: 2px; } +.submit-button:disabled { background: #a9acb0; cursor: not-allowed; } + +@media (max-width: 520px) { + .page { padding: 12px; } + .upload-box { padding: 22px 18px; } } @media (prefers-reduced-motion: reduce) { - * { scroll-behavior: auto !important; transition: none !important; } + * { transition: none !important; } } |
