File size: 402 Bytes
bc20498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<script>export let ratio = 1 / 1;
export let el = void 0;
const attrs = {
  "data-aspect-ratio-root": ""
};
</script>

<div style:position="relative" style:width="100%" style:padding-bottom="{ratio ? 100 / ratio : 0}%">
	<div
		bind:this={el}
		style:position="absolute"
		style:top="0"
		style:right="0"
		style:bottom="0"
		style:left="0"
		{...$$restProps}
		{...attrs}
	>
		<slot />
	</div>
</div>