2025-03-28 14:16:20 +01:00
|
|
|
<script lang="ts">
|
2025-10-13 16:05:50 +02:00
|
|
|
let {
|
|
|
|
|
icon_href = "",
|
2026-07-30 17:07:46 +02:00
|
|
|
width = "800px",
|
2025-10-13 16:05:50 +02:00
|
|
|
children
|
|
|
|
|
}: {
|
|
|
|
|
icon_href?: string;
|
|
|
|
|
width?: string;
|
|
|
|
|
children?: import('svelte').Snippet;
|
|
|
|
|
} = $props();
|
2023-01-17 19:03:14 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="block" style="width: {width}; max-width: 100%">
|
|
|
|
|
<img src={icon_href} alt="File icon" class="icon">
|
2026-07-30 17:07:46 +02:00
|
|
|
<div class="description bubble">
|
2025-10-13 16:05:50 +02:00
|
|
|
{@render children?.()}
|
2023-01-17 19:03:14 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.block {
|
2023-01-17 22:53:41 +01:00
|
|
|
display: flex;
|
2023-01-17 19:03:14 +01:00
|
|
|
flex-direction: row;
|
2023-01-17 22:53:41 +01:00
|
|
|
margin: 8px auto;
|
2023-01-17 19:03:14 +01:00
|
|
|
}
|
2024-09-05 17:28:31 +02:00
|
|
|
@media(max-width: 400px) {
|
2023-01-17 22:53:41 +01:00
|
|
|
.block {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-17 19:03:14 +01:00
|
|
|
.icon {
|
|
|
|
|
flex: 0 0 auto;
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
/* Prevent icon from being stretched if text content is too large */
|
2023-01-17 22:53:41 +01:00
|
|
|
align-self: center;
|
2023-10-23 17:10:27 +02:00
|
|
|
width: 128px;
|
2023-01-17 19:03:14 +01:00
|
|
|
}
|
|
|
|
|
.description {
|
|
|
|
|
flex: 1 1 auto;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
text-align: initial;
|
|
|
|
|
padding-left: 8px;
|
|
|
|
|
vertical-align: middle;
|
2023-01-17 22:53:41 +01:00
|
|
|
overflow-wrap: anywhere;
|
2023-01-17 19:03:14 +01:00
|
|
|
background-color: var(--shaded_background);
|
2024-11-19 15:31:51 +01:00
|
|
|
backdrop-filter: blur(4px);
|
2023-01-17 19:03:14 +01:00
|
|
|
padding: 8px;
|
2026-07-30 17:07:46 +02:00
|
|
|
margin: 0;
|
2023-01-17 19:03:14 +01:00
|
|
|
}
|
|
|
|
|
</style>
|