Frontend: Proof of concept for image preview #2266

Merged
konrad merged 20 commits from Elscrux/vikunja:feature/image-preview into main 2024-05-25 12:11:05 +00:00
Showing only changes of commit 2d3bf4c210 - Show all commits

View File

@ -2,7 +2,6 @@
<img

Can you make this always the same size? Use object-fit: cover; to let the image fill the container nicely.

Can you make this always the same size? Use [`object-fit: cover;`](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) to let the image fill the container nicely.

I included it, but it didn't seem like it made a difference

I included it, but it didn't seem like it made a difference

Did you set a fixed with and height for the image?

Did you set a fixed with and height for the image?

Yes, it's at 4rem now

Yes, it's at 4rem now
:src="blobUrl"
alt="Attachment preview"
style="object-fit: cover;"
>

Please do not use inline styles.

This image should have a rectangular fixed size, then the object-fit property will make sure it looks good.

Please do not use inline styles. This image should have a rectangular fixed size, then the `object-fit` property will make sure it looks good.
</template>
@ -31,5 +30,6 @@ watchEffect(async () => {
<style scoped lang="scss">
img {
border-radius: $radius;
konrad marked this conversation as resolved Outdated

Please use $radius here so that the radius is consistent with other elements.

Please use `$radius` here so that the radius is consistent with other elements.

Done!

Done!
object-fit: cover;

Adding a width: 100% here will make it look like what I meant (will share a screenshot later)

Adding a `width: 100%` here will make it look like what I meant (will share a screenshot later)
}
</style>