diff --git a/src/app.postcss b/src/app.postcss index 14a20bcb..eed22e4b 100644 --- a/src/app.postcss +++ b/src/app.postcss @@ -4,77 +4,52 @@ @tailwind base; @tailwind components; @tailwind utilities; - @layer base { :root { --background: 0 0% 100%; --foreground: 222.2 84% 4.9%; - - --muted: 210 40% 96.1%; - --muted-foreground: 215.4 16.3% 46.9%; - - --popover: 0 0% 100%; - --popover-foreground: 222.2 84% 4.9%; - --card: 0 0% 100%; --card-foreground: 222.2 84% 4.9%; - - --border: 214.3 31.8% 91.4%; - --input: 214.3 31.8% 91.4%; - - --primary: 344 100% 61%; + --popover: 0 0% 100%; + --popover-foreground: 222.2 84% 4.9%; + --primary: 222.2 47.4% 11.2%; --primary-foreground: 210 40% 98%; - - --secondary: 248 24% 14%; - --secondary-foreground: 0 0% 100%; - + --secondary: 338 100% 44%; + --secondary-foreground: 210 40% 98%; + --muted: 210 40% 96.1%; + --muted-foreground: 215.4 16.3% 46.9%; --accent: 210 40% 96.1%; --accent-foreground: 222.2 47.4% 11.2%; - - --destructive: 0 72.2% 50.6%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 210 40% 98%; - + --border: 214.3 31.8% 91.4%; + --input: 214.3 31.8% 91.4%; --ring: 222.2 84% 4.9%; - - --radius: 0.5rem; + --radius: 0.75rem; } - .dark { --background: 222.2 84% 4.9%; --foreground: 210 40% 98%; - - --muted: 217.2 32.6% 17.5%; - --muted-foreground: 215 20.2% 65.1%; - - --popover: 222.2 84% 4.9%; - --popover-foreground: 210 40% 98%; - --card: 222.2 84% 4.9%; --card-foreground: 210 40% 98%; - - --border: 217.2 32.6% 17.5%; - --input: 217.2 32.6% 17.5%; - - --primary: 344 100% 61%; - --primary-foreground: 210 40% 98%; - - --secondary: 248 24% 14%; - --secondary-foreground: 0 0% 100%; - + --popover: 222.2 84% 4.9%; + --popover-foreground: 210 40% 98%; + --primary: 210 40% 98%; + --primary-foreground: 222.2 47.4% 11.2%; + --secondary: 338 100% 44%; + --secondary-foreground: 210 40% 98%; + --muted: 217.2 32.6% 17.5%; + --muted-foreground: 215 20.2% 65.1%; --accent: 217.2 32.6% 17.5%; --accent-foreground: 210 40% 98%; - --destructive: 0 62.8% 30.6%; --destructive-foreground: 210 40% 98%; - + --border: 217.2 32.6% 17.5%; + --input: 217.2 32.6% 17.5%; --ring: 212.7 26.8% 83.9%; } } -body { - font-family: 'Recursive Variable', sans-serif; -} - @layer base { * { @apply border-border; @@ -84,6 +59,10 @@ body { } } +body { + font-family: 'Recursive Variable', sans-serif; +} + .d { @apply border border-red-500; } diff --git a/src/lib/components/Actions.svelte b/src/lib/components/Actions.svelte index 9400af16..51c7f87b 100644 --- a/src/lib/components/Actions.svelte +++ b/src/lib/components/Actions.svelte @@ -10,6 +10,8 @@ import dayjs from 'dayjs'; import { toBase64 } from 'js-base64'; import { Button } from './ui/Button'; + import { Separator } from './ui/separator'; + import { Switch } from './ui/switch'; const FONT_AWESOME_URL = `https://cdnjs.cloudflare.com/ajax/libs/font-awesome/${FAVersion}/css/all.min.css`; @@ -51,11 +53,11 @@ ${svgString}`); const box: DOMRect = svg.getBoundingClientRect(); canvas.width = box.width; canvas.height = box.height; - if (imagemodeselected === 'width') { + if (imageModeFinal === 'width') { const ratio = box.height / box.width; canvas.width = userimagesize; canvas.height = userimagesize * ratio; - } else if (imagemodeselected === 'height') { + } else if (imageModeFinal === 'height') { const ratio = box.width / box.height; canvas.width = userimagesize * ratio; canvas.height = userimagesize; @@ -170,7 +172,11 @@ ${svgString}`); let svgUrl: string | undefined = $state(); let krokiUrl: string | undefined = $state(); let mdCode: string | undefined = $state(); - let imagemodeselected = $state('auto'); + let isAutoImageMode = $state(true); + let manualSizingMode: 'width' | 'height' = $state('width'); + let imageModeFinal: 'auto' | 'width' | 'height' = $derived( + isAutoImageMode ? 'auto' : manualSizingMode + ); let userimagesize = $state(1080); let isNetlify = $state(false); @@ -198,53 +204,58 @@ ${svgString}`); {/snippet} - -
+ +
{#if isClipboardAvailable()} {/if} -
+
PNG size - + + + Auto + + - + {#if !isAutoImageMode} + +
+ - + - {#if imagemodeselected !== 'auto'} - + +
+ {/if} +
+
+ {@render dualActionButton('PNG', onDownloadPNG, iUrl)} + {@render dualActionButton('SVG', onDownloadSVG, svgUrl)} + + {#if krokiRendererUrl} + + + {/if}
- {@render dualActionButton('PNG', onDownloadPNG, iUrl)} - {@render dualActionButton('SVG', onDownloadSVG, svgUrl)} - - {#if krokiRendererUrl} - - - - {/if} - {#if rendererUrl}
- +