jkomoros / card-web

The web app behind thecompendium.cards
Apache License 2.0
52 stars 8 forks source link

Allow images in cards #4

Open jkomoros opened 5 years ago

jkomoros commented 5 years ago

And slide g48845643ff_0_173 should get the feedback loop image

jkomoros commented 4 years ago

This could be quite simple: just a few stylesheets and classes the image can have for positioning, and the images are uploaded to a google cloud storage bucket

jkomoros commented 4 years ago

But could be much more complex: a gallery to enumerate the images available to you from within the editor

jkomoros commented 4 years ago

The simplest is literally just manually upload a picture into a GCS bucket and then copy paste its URL in

jkomoros commented 3 years ago

Cards get a images property that is a map of field_name to array of image objects, which includes a src (partial image URLs) and positioning data. The image URLs are generated by appending the image storage bucket (a GCS bucket) to the url.

Certain fields (body by default) have a imagesAllowed, which means that the UI will show an affordance to add an image. That shows an upload field in a dialog that is also the image picker.

Each image record includes the partial src, as well as position, one of top-left, top-right for now. Those are shown in a little chip in the editor UI with drop downs to change.

Images are uploaded to a separate folder per author. In the future it should be possible to navigate in the file picker to see someone else's images (since all of them are public anyway)

jkomoros commented 3 years ago

The fact that images could take non-trivial time to load complicates the screenshot service ( you ahve to wait for the images onload to fire). It also ideally requires you to size the image so that even before it's loaded it will take up the proper size in the layout.

jkomoros commented 3 years ago