HomePhabricator

Allow users to scale the image

Tags
None
Referenced Files
None
Subscribers
None

Description

Allow users to scale the image

By default, the image is still at most as wide as the page, but with
some CSS trickery, it can now be scaled to be larger or smaller than
that. This first version only adds fixed points of 1×, 2×, 3×, 4×, 5×
scale, but the CSS works just as well with fractional scaling (including
< 1), and a follow-up commit will add some JS that replaces the five
radio buttons with a range input (slider). (An input’s dynamic value
can’t be accessed with CSS alone, so that version must be restricted to
users with JS, and no-JS users will have to live with the fixed scales.)

Add width= and height= attributes to the HTML, because it seems like a
nice thing to do, but to actually use the dimensions in CSS we also need
to put them in CSS variables – attr(width px) for arbitrary properties
is specced, but actual browsers only support attr without units in
content, unfortunately.

Details

Provenance
LucasWerkmeisterAuthored on May 14 2022, 4:27 PM
Parents
R2422:e93d0e535020: Extract load_image() function
Branches
Unknown
Tags
Unknown
ChangeId
None