feat(web): let users set their own photo on the account page
Pick a PNG/JPEG/WebP file, crop it to a square on a canvas (drag, wheel, slider or keyboard), export a 256x256 PNG and send it to Hub. Adds remove photo, error states, RU/EN copy and privacy policy text about the stored photo and 30-day backups.
This commit is contained in:
parent
a4cae66336
commit
4c06a17d7e
10 changed files with 739 additions and 14 deletions
|
|
@ -25,3 +25,7 @@ Central status Footer
|
|||
Review: a giant neutral product screenshot alone would feel like any desktop-app page. The hero instead explains persistent voice while browsing text through an intentionally small, labelled diagram. Real native-client imagery appears where it supports the appearance/settings explanation. Sand is the approved V brand colour, not a secondary decorative accent.
|
||||
|
||||
Motion: sections fade in on scroll (IntersectionObserver), the hero enters once, the voice waveform and connection dots pulse softly, buttons and cards lift on hover. The memory block draws a short sand bar for VNOX against a long stone bar and counts up to 120 MB when it scrolls into view. All of it is plain CSS plus a small script, and it is switched off under `prefers-reduced-motion: reduce` (the final values are shown at once). Memory numbers and their sources: `docs/memory-sources.md`.
|
||||
|
||||
## Account photo
|
||||
|
||||
The account page lets a signed-in user upload their own photo (`/v1/account/avatar`, see the Hub `AUTH.md`). The file is decoded with `createImageBitmap` (no `<img>` or blob URL, so the CSP needs no `blob:`), cropped to a square on a canvas (drag, wheel, slider, arrow keys and plus/minus), exported with `canvas.toBlob` as a 256 by 256 PNG and sent with the CSRF header. Crop geometry is in `src/crop.ts` and unit tested. No inline `style` attributes are used. Own avatars are shown from the same origin (`/v1/avatars/<64 hex>`), which `img-src 'self'` already allows. The privacy text says that a re-encoded photo is stored, that "Remove photo" deletes it, and that deleted data can stay in database backups for up to 30 days; that retention is an owner decision that still needs backup rotation on the server.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue