zachleat / idea-book

A public dump of ideas for side projects, for public upvoting/downvoting/commenting.
Creative Commons Attribution 4.0 International
24 stars 1 forks source link

A screenshot web component #23

Closed zachleat closed 2 years ago

zachleat commented 3 years ago

Customizable viewport size, toggle between JS enabled and not.

https://pptr.dev/#?product=Puppeteer&version=v5.5.0&show=api-pagescreenshotoptions

Stretch goal: Allow scrolling?

Would be great for https://www.11ty.dev/

nhoizey commented 3 years ago

Would it make a screenshot of the page where the component is used?

If so, that means all screenshots made with the component have the screenshot button visible? 🤔

zachleat commented 3 years ago

Ah, no sorry, you’d point it at a URL and it would display the screenshot of that URL.

I’m thinking a reusable thing for this (with a few more features) on the 11ty.dev home page and author pages:

image

nhoizey commented 3 years ago

Oooh, ok, now I understand.

I currently use thum.io for this (but it's limited), and resize with Cloudinary. A simple local solution would be great indeed! 👍

zachleat commented 2 years ago

This exists now https://github.com/11ty/api-screenshot but wow I want to do the scrolling thing 😅

nhoizey commented 2 years ago

With scrolling, do you aim for:

zachleat commented 2 years ago

(For future me) I did build a demo of this but it’s kinda half baked and not public yet. Dunno if I’ll circle back to it but a private repo is here: https://github.com/11ty/component-screenshot

screenshot scroller

The interaction would be smoother if you don’t have obtrusive scrollbars like me.

nhoizey commented 2 years ago

I don't really understand what happens here… 😅

It this whole animation an automated screencast with a mouse pointer "activating" an iframe and scrolling inside?

zachleat commented 2 years ago

It starts out with a standard screenshot, and then you can click to activate and load a full page screenshot in the same pane (which is scrollable). Not sure if it’s practical or worth it 😅 which is why I’ll probably just leave it private.

Gonna close this one

nhoizey commented 2 years ago

Ok! 😅