fix(observatory): use inline styles to ensure SVG renders correctly

Replaced Tailwind utility classes with inline styles for the container
and SVG element to prevent CSS purging issues in production build.
Added explicit preserveAspectRatio and xmlns attributes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-24 21:24:25 +01:00
parent decd79d547
commit 02db49175a
2 changed files with 9 additions and 5 deletions

View file

@ -82,7 +82,10 @@
let viewBoxStr = $derived(`${viewBox.x} ${viewBox.y} ${viewBox.w} ${viewBox.h}`);
</script>
<div class="relative h-full w-full overflow-hidden rounded-xl bg-sky-100">
<div
class="relative overflow-hidden rounded-xl"
style="width: 100%; height: 100%; min-height: 500px; background-color: #e0f2fe;"
>
<!-- Reset zoom button -->
<button
type="button"
@ -125,8 +128,9 @@
<svg
bind:this={svgEl}
viewBox={viewBoxStr}
class="h-full w-full"
style="cursor: {isPanning ? 'grabbing' : 'grab'};"
preserveAspectRatio="xMidYMid meet"
xmlns="http://www.w3.org/2000/svg"
style="width: 100%; height: 100%; display: block; cursor: {isPanning ? 'grabbing' : 'grab'};"
onwheel={handleWheel}
onpointerdown={handlePointerDown}
onpointermove={handlePointerMove}

View file

@ -8,8 +8,8 @@
}
</script>
<div class="flex flex-col gap-4">
<div class="h-[calc(100vh-12rem)] min-h-[500px] w-full">
<div style="display: flex; flex-direction: column; gap: 1rem;">
<div style="height: calc(100vh - 12rem); min-height: 500px; width: 100%;">
<SeenplatteScene onSelectApp={handleSelectApp} />
</div>