File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ const { data: block } = useAsyncData(props.uuid, () =>
2929 <BaseMedia
3030 v-if =" block"
3131 class =" block-media"
32- :aspect =" block.type === 'arcade' ? 'auto' : (block.aspect_ratio ?? undefined)"
32+ :aspect =" block.type === 'arcade' || block.type === 'iframe' ? 'auto' : (block.aspect_ratio ?? undefined)"
3333 :border =" block.border"
3434 :radius =" block.border_radius"
3535 :caption =" block.caption ?? undefined"
@@ -65,6 +65,8 @@ const { data: block } = useAsyncData(props.uuid, () =>
6565 />
6666 </template >
6767
68+ <div v-else-if =" block.type === 'iframe' && block.embed" v-html =" block.embed" class =" iframe" />
69+
6870 <img v-else-if =" block.external_image_url" class =" media" :src =" block.external_image_url" alt =" " loading =" lazy" />
6971 </BaseMedia >
7072</template >
@@ -105,4 +107,17 @@ const { data: block } = useAsyncData(props.uuid, () =>
105107 display : none ;
106108 }
107109}
110+
111+ .iframe {
112+ aspect-ratio : 9 / 16 ;
113+ iframe {
114+ width : 100% ;
115+ height : 100% ;
116+ }
117+ @container (width > 30rem ) {
118+ width : 100% ;
119+ aspect-ratio : 16 / 10 ;
120+ max-height : 450px ;
121+ }
122+ }
108123 </style >
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { Video } from '../content/video.js';
33
44export interface BlockMedia {
55 id : string ;
6- type : 'video' | 'image' | 'arcade' | 'external-image' | null ;
6+ type : 'video' | 'image' | 'arcade' | 'external-image' | 'iframe' | null ;
77 image : string | File | null ;
88 video : string | Video | null ;
99 embed : string | null ;
You can’t perform that action at this time.
0 commit comments