melding css and w2p locals

11 views
Skip to first unread message

Dave S

unread,
Jun 15, 2022, 8:10:27 PM6/15/22
to web2py-users
I've got a page where I load an image, and then if you click on the image it scales down (my preferred default is load full size, and then shrink as needed).  Yes, the browser will do this (with the opposite default) automatically if it is a bare image, but I want this to happen on my wrapper page, with the links I like to have at the ready, and the tooltip set.

I can pass the image dimensions just fine, and I can pass down a scale factor just fine (as in, I've figured out by hand the viewport height, and scale to that value).   But I want to know the viewport size dynamically, and scale to the current value.

I've tried
transform:  scale( calc( 100vh / {{ = picheight }} px)) ;
but this results in no scaling (probably an error)

Yes, I could do javascript to replace the python-assisted CSS, but I'd rather not.  Does anybody have a suggestion?  webp2y apparently doesn't know the viewport size (doesn't seem to be a subfield of the request var), and I don't know another CSS-side value for the viewport height than the vh units.

Thanks

Dave S
/dps


Reply all
Reply to author
Forward
0 new messages