nicco.io/src/lib/components/ImageFrame.svelte

36 lines
762 B
Svelte
Raw Normal View History

2021-08-02 09:53:08 +02:00
<script lang="ts" context="module">
2020-11-08 12:07:17 +01:00
import { initialize } from 'svelte-cloudinary'
initialize({ cloud_name: 'cupcakearmy' })
</script>
2021-08-02 09:53:08 +02:00
<script lang="ts">
2020-11-08 12:07:17 +01:00
import { image } from 'svelte-cloudinary'
2020-11-02 15:55:59 +01:00
2021-08-02 09:53:08 +02:00
export let src: string
// export let srcset: string
export let alt: string
2020-11-08 12:07:17 +01:00
$: cleaned = src.replace('https://api.nicco.io', '/nicco')
2020-09-23 15:37:12 +02:00
</script>
2021-08-02 09:53:08 +02:00
<img use:image={{ src: cleaned, bind: { width: true }, lazy: true }} {alt} />
<!-- <img {srcset} {alt} /> -->
2020-09-23 15:37:12 +02:00
<style>
2020-11-08 12:07:17 +01:00
img {
2020-09-23 15:37:12 +02:00
width: calc(100% - 0.25em);
object-fit: cover;
object-position: center;
border: 0.125em solid var(--clr-primary);
transition: var(--animation);
transform: scale(1);
margin: 0;
}
2020-11-08 12:07:17 +01:00
img {
2020-09-23 15:37:12 +02:00
transform: scale(1.1);
margin: 1em 0;
}
</style>