Rotonde / rotonde-client

Rotonde Base Client
https://client-neauoire.hashbase.io/
MIT License
227 stars 49 forks source link

Implement "big picture" #150

Closed 0x0ade closed 6 years ago

0x0ade commented 6 years ago

Clicking on an image enlarges the picture.

image

You can still scroll down to the entry + thread.

image

It should work with many custom.css themes out of the box:

image

Code-wise, the feed now has got bigpicture_show, _hide, _toggle, _refresh and is_bigpicture. _show and _toggle take either the raw HTML to enlarge, or a generator function (used again on refresh, useful for entries).

CSS-wise, it's a horrible mess depending on constants:

/* In case questions arise:
 * Top is: Center of view = (.entry.top) - 50vh + entry peeking height
 * The maximum height is: view height - operator height - entry peeking height - padding
 * This is horrible.
 * -ade
 */
body #feed .bigpicture > .entry .media { position: absolute; top: calc(-50vh + 60px); left: 50%; margin: 0; transform: translate(-50%, -50%); max-width: calc(100vw - 30px); max-height: calc(100vh - 60px - 60px - 30px); }

... but hell, it's a beautiful mess.

neauoire commented 6 years ago

This great!