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, () =>
29
29
<BaseMedia
30
30
v-if =" block"
31
31
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)"
33
33
:border =" block.border"
34
34
:radius =" block.border_radius"
35
35
:caption =" block.caption ?? undefined"
@@ -65,6 +65,8 @@ const { data: block } = useAsyncData(props.uuid, () =>
65
65
/>
66
66
</template >
67
67
68
+ <div v-else-if =" block.type === 'iframe' && block.embed" v-html =" block.embed" class =" iframe" />
69
+
68
70
<img v-else-if =" block.external_image_url" class =" media" :src =" block.external_image_url" alt =" " loading =" lazy" />
69
71
</BaseMedia >
70
72
</template >
@@ -105,4 +107,17 @@ const { data: block } = useAsyncData(props.uuid, () =>
105
107
display : none ;
106
108
}
107
109
}
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
+ }
108
123
</style >
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { Video } from '../content/video.js';
3
3
4
4
export interface BlockMedia {
5
5
id : string ;
6
- type : 'video' | 'image' | 'arcade' | 'external-image' | null ;
6
+ type : 'video' | 'image' | 'arcade' | 'external-image' | 'iframe' | null ;
7
7
image : string | File | null ;
8
8
video : string | Video | null ;
9
9
embed : string | null ;
You can’t perform that action at this time.
0 commit comments