Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596<script lang="ts"> import type { Picture } from '../transcript.svelte'; import { clipKind } from './attachments';
// numbers default to clips only: pass them when the message has pictures too. let { clips, label, numbers = clips.map((_, index) => index + 1), end = false, }: { clips: Picture[]; label: string; numbers?: number[]; end?: boolean; } = $props();</script>
<ul class="clips" class:end aria-label="{label}s"> {#each clips as clip, index (index)} <li class:video={clipKind(clip.mime) === 'video'}> {#if clipKind(clip.mime) === 'video'} <!-- svelte-ignore a11y_media_has_caption (shown media, not authored) --> <video src={clip.src} controls preload="metadata" aria-label="{label} #{numbers[index]}" ></video> {:else} <audio src={clip.src} controls preload="none" aria-label="{label} #{numbers[index]}" ></audio> {/if} <a href={clip.src} target="_blank" rel="noopener noreferrer" >{clip.mime}</a > </li> {/each}</ul>
<style> .clips { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; } .clips.end { justify-content: flex-end; max-width: 85%; margin: 0; } li { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; padding: 6px; background: var(--surface); border: 1px solid color-mix(in oklab, var(--muted) 15%, transparent); border-radius: 12px; } audio { width: 280px; max-width: 100%; height: 36px; } video { display: block; width: auto; max-width: min(320px, 100%); max-height: 200px; border-radius: 8px; background: #000; } a { align-self: flex-end; color: var(--muted); font-family: var(--mono); font-size: calc(var(--type-xs) * var(--canvas-scale, 1)); text-decoration: none; } a:hover { color: var(--text); text-decoration: underline; }</style>