Yarn Updates, Conde cleanup

This commit is contained in:
Neshura 2025-04-04 23:55:56 +02:00
parent d7c7db0ef9
commit 6646d3b075
Signed by: Neshura
GPG key ID: 4E2D47B1374C297D
15 changed files with 966 additions and 963 deletions
src/lib

View file

@ -1,7 +1,7 @@
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { cubicOut } from 'svelte/easing';
import type { TransitionConfig } from 'svelte/transition';
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
import { cubicOut } from "svelte/easing";
import type { TransitionConfig } from "svelte/transition";
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
@ -19,9 +19,13 @@ export const flyAndScale = (
params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 150 }
): TransitionConfig => {
const style = getComputedStyle(node);
const transform = style.transform === 'none' ? '' : style.transform;
const transform = style.transform === "none" ? "" : style.transform;
const scaleConversion = (valueA: number, scaleA: [number, number], scaleB: [number, number]) => {
const scaleConversion = (
valueA: number,
scaleA: [number, number],
scaleB: [number, number]
) => {
const [minA, maxA] = scaleA;
const [minB, maxB] = scaleB;
@ -31,11 +35,13 @@ export const flyAndScale = (
return valueB;
};
const styleToString = (style: Record<string, number | string | undefined>): string => {
const styleToString = (
style: Record<string, number | string | undefined>
): string => {
return Object.keys(style).reduce((str, key) => {
if (style[key] === undefined) return str;
return str + `${key}:${style[key]};`;
}, '');
}, "");
};
return {
@ -53,4 +59,4 @@ export const flyAndScale = (
},
easing: cubicOut
};
};
};