|
Download task_038/instruction.md from Lego-X/UXInteract: direct link, hf CLI and curl.
- Browser
- Download file 1.49 kB
-
https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_038/instruction.md
- Command line
-
hf download hf://datasets/Lego-X/UXInteract/task_038/instruction.md
-
curl -L -o instruction.md https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_038/instruction.md
1.49 kB
| # Add a configurable text watermark to uploaded images | |
| Replace the starter `index.html` with a single offline front-end page that automatically watermarks a locally selected image and displays the result. | |
| ## Interface | |
| - Use a file input with `data-testid="image-upload"` and a visible result canvas with `data-testid="watermark-canvas"`. | |
| - Use `data-testid` values `wm-text` for the text control (default `Answer`), `wm-size` for font size (including 16 and 32), `wm-opacity` for opacity (0 through 1), and `wm-position` for position (including `top-left`, `center` and `bottom-right`). | |
| - Keep each original and its corresponding result separately in memory. Expose `window.__getImageStore()` returning an independent copy of `{originals: [...], watermarked: [...]}`, two corresponding arrays of data URLs. | |
| ## Acceptance Checklist | |
| - Uploading draws the image at its original aspect ratio and applies the default watermark without another action. | |
| - Editing a setting updates the visible result within five seconds. Changing the text changes the lettering; a larger font enlarges it; lower opacity makes it fainter; position moves it to the selected area. At opacity zero only the original image is visible. | |
| - Store the actual canvas result while leaving original bytes unchanged, including when editing or restoring settings. Mutating the returned store snapshot cannot change either underlying list. | |
| - The page loads and the complete upload and editing workflow works without a network. | |