Spaces:
Running
Running
responsive card
Browse files
src/lib/components/chat/Assistant.svelte
CHANGED
|
@@ -114,7 +114,7 @@
|
|
| 114 |
</script>
|
| 115 |
|
| 116 |
<article
|
| 117 |
-
class="group/assistant relative flex w-
|
| 118 |
style={rowHeight ? `min-height: ${rowHeight}px` : ''}
|
| 119 |
>
|
| 120 |
<div class="nodrag pointer-events-auto flex flex-1 cursor-auto flex-col justify-between">
|
|
|
|
| 114 |
</script>
|
| 115 |
|
| 116 |
<article
|
| 117 |
+
class="group/assistant relative flex w-[calc(100dvw-2rem)] flex-col rounded-3xl border border-border bg-background p-5 shadow-lg/5 lg:w-[600px]"
|
| 118 |
style={rowHeight ? `min-height: ${rowHeight}px` : ''}
|
| 119 |
>
|
| 120 |
<div class="nodrag pointer-events-auto flex flex-1 cursor-auto flex-col justify-between">
|
src/lib/components/chat/User.svelte
CHANGED
|
@@ -159,7 +159,7 @@
|
|
| 159 |
</script>
|
| 160 |
|
| 161 |
<article
|
| 162 |
-
class="group/user relative z-10 w-
|
| 163 |
>
|
| 164 |
<div class="nodrag pointer-events-auto cursor-auto">
|
| 165 |
<header class="mb-3 flex items-center justify-between">
|
|
|
|
| 159 |
</script>
|
| 160 |
|
| 161 |
<article
|
| 162 |
+
class="group/user relative z-10 w-[calc(100dvw-2rem)] rounded-3xl border border-border bg-background p-5 shadow-lg/5 lg:w-[600px]"
|
| 163 |
>
|
| 164 |
<div class="nodrag pointer-events-auto cursor-auto">
|
| 165 |
<header class="mb-3 flex items-center justify-between">
|
src/lib/components/flow/FitViewOnResize.svelte
CHANGED
|
@@ -8,7 +8,11 @@
|
|
| 8 |
|
| 9 |
let { initialNodes }: { initialNodes: Node[] } = $props();
|
| 10 |
|
| 11 |
-
const DEFAULT_WIDTH = breakpointsState.isMobile
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
const DEFAULT_HEIGHT = 100;
|
| 13 |
const H_SPACING = 60;
|
| 14 |
const V_SPACING = 60;
|
|
@@ -71,7 +75,7 @@
|
|
| 71 |
fitView({
|
| 72 |
maxZoom: breakpointsState.isMobile ? 1 : 1.15,
|
| 73 |
minZoom: 0.7,
|
| 74 |
-
padding: 0.15,
|
| 75 |
...(shouldAnimate ? { interpolate: 'smooth' as const, duration: 250 } : {}),
|
| 76 |
nodes: nodes.map((n) => ({ id: n.id }))
|
| 77 |
});
|
|
|
|
| 8 |
|
| 9 |
let { initialNodes }: { initialNodes: Node[] } = $props();
|
| 10 |
|
| 11 |
+
const DEFAULT_WIDTH = breakpointsState.isMobile
|
| 12 |
+
? typeof window !== 'undefined'
|
| 13 |
+
? window.innerWidth - 32
|
| 14 |
+
: 390
|
| 15 |
+
: 600;
|
| 16 |
const DEFAULT_HEIGHT = 100;
|
| 17 |
const H_SPACING = 60;
|
| 18 |
const V_SPACING = 60;
|
|
|
|
| 75 |
fitView({
|
| 76 |
maxZoom: breakpointsState.isMobile ? 1 : 1.15,
|
| 77 |
minZoom: 0.7,
|
| 78 |
+
padding: breakpointsState.isMobile ? 0 : 0.15,
|
| 79 |
...(shouldAnimate ? { interpolate: 'smooth' as const, duration: 250 } : {}),
|
| 80 |
nodes: nodes.map((n) => ({ id: n.id }))
|
| 81 |
});
|