diff --git a/src/lib/carbon/Carbon.svelte b/src/lib/carbon/Carbon.svelte index d031a49..8eaaa8a 100644 --- a/src/lib/carbon/Carbon.svelte +++ b/src/lib/carbon/Carbon.svelte @@ -1,70 +1,76 @@ {#if !dev} -
+ {/if} diff --git a/src/lib/carbon/CarbonLuxe.svelte b/src/lib/carbon/CarbonLuxe.svelte index 44901ea..83330eb 100644 --- a/src/lib/carbon/CarbonLuxe.svelte +++ b/src/lib/carbon/CarbonLuxe.svelte @@ -1,66 +1,69 @@ {#if !dev} - + {/if} diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 5431182..1f8ab00 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -4,61 +4,59 @@ import { cubicOut } from "svelte/easing"; import type { TransitionConfig } from "svelte/transition"; export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)); + return twMerge(clsx(inputs)); } -export const isBrowser = typeof document !== "undefined"; - type FlyAndScaleParams = { - y?: number; - x?: number; - start?: number; - duration?: number; + y?: number; + x?: number; + start?: number; + duration?: number; }; export const flyAndScale = ( - node: Element, - params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 150 } + node: Element, + params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 150 } ): TransitionConfig => { - const style = getComputedStyle(node); - const transform = style.transform === "none" ? "" : style.transform; - - const scaleConversion = ( - valueA: number, - scaleA: [number, number], - scaleB: [number, number] - ) => { - const [minA, maxA] = scaleA; - const [minB, maxB] = scaleB; - - const percentage = (valueA - minA) / (maxA - minA); - const valueB = percentage * (maxB - minB) + minB; - - return valueB; - }; - - const styleToString = ( - style: Record