naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.03k stars 316 forks source link

Viewer tools #3499

Open 5e-Cleric opened 4 weeks ago

5e-Cleric commented 4 weeks ago

AS per right now, only adds a zoom feature.

Creates toolbar in a separate file: toolbar.jsx

Zoom is set in toolbar, then passed to brewRenderer, and then set there in a style tag.

Two problems right now:

image

5e-Cleric commented 4 weeks ago

Using zoom instead of scale sacrifices animatability for fixing overflow issues, which are inavoidable via CSS only with scale:

Based on docs about Overflow related to transform (https://drafts.csswg.org/css-overflow-3/)

The scrollable overflow area is the union of:

From which i gather that the scroll container's scrollable overflow area is calculated based on the original size of the child element. This means that even though the scaled-down child element might visually occupy less space, the scrollable overflow area is determined by the original size of the element.

Zoom does change the natural size, affecting the layout, which gets rid of most problems inside the scrollable parent: (from https://drafts.csswg.org/css-viewport/#zoom-property)

To apply zoom, the used value of a CSS property is pre-multiplied (before any other steps in the used value stage) by the used value of zoom for the element. It also multiplies the natural size of all replaced elements, background images, and nested frames

5e-Cleric commented 4 weeks ago

@calculuschild can i get a deployment?

calculuschild commented 4 weeks ago

Deployment up.

5e-Cleric commented 3 weeks ago

Converted to draft until i figure out the page works.

5e-Cleric commented 3 weeks ago

Hmm as the scroll function scrolls to the top of the page, and the function getting the page gets if the footer is visible, page logic is flawed at the moment.