-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
657fea8
commit 5235326
Showing
10 changed files
with
284 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,159 +1,78 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
@layer utilities { | ||
/* Hide scrollbar for Chrome, Safari and Opera */ | ||
.no-scrollbar::-webkit-scrollbar { | ||
display: none; | ||
} | ||
/* Hide scrollbar for IE, Edge and Firefox */ | ||
.no-scrollbar { | ||
-ms-overflow-style: none; /* IE and Edge */ | ||
scrollbar-width: none; /* Firefox */ | ||
} | ||
} | ||
|
||
|
||
@layer base { | ||
@font-face { | ||
font-family: Teko; | ||
font-style: normal; | ||
font-weight: 300; | ||
src: url(/static/fonts/teko/Teko-Light.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Teko; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url(/static/fonts/teko/Teko-Regular.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Teko; | ||
font-style: normal; | ||
font-weight: 500; | ||
src: url(/static/fonts/teko/Teko-Medium.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Teko; | ||
font-style: normal; | ||
font-weight: 600; | ||
src: url(/static/fonts/teko/Teko-SemiBold.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Teko; | ||
font-style: normal; | ||
font-weight: 700; | ||
src: url(/static/fonts/teko/Teko-Bold.ttf) format("tff"); | ||
} | ||
|
||
@font-face { | ||
font-family: Poppins; | ||
font-style: normal; | ||
font-weight: 100; | ||
src: url(/static/fonts/poppins/Poppins-Thin.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: italic; | ||
font-weight: 100; | ||
src: url(/static/fonts/poppins/Poppins-ThinItalic.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: normal; | ||
font-weight: 200; | ||
src: url(/static/fonts/poppins/Poppins-ExtraLight.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: italic; | ||
font-weight: 200; | ||
src: url(/static/fonts/poppins/Poppins-ExtraLightItalic.ttf) | ||
format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: normal; | ||
font-weight: 300; | ||
src: url(/static/fonts/poppins/Poppins-Light.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: italic; | ||
font-weight: 300; | ||
src: url(/static/fonts/poppins/Poppins-LightItalic.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: url(/static/fonts/poppins/Poppins-Regular.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: italic; | ||
font-weight: 400; | ||
src: url(/static/fonts/poppins/Poppins-Italic.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: normal; | ||
font-weight: 500; | ||
src: url(/static/fonts/poppins/Poppins-Medium.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: italic; | ||
font-weight: 500; | ||
src: url(/static/fonts/poppins/Poppins-MediumItalic.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: normal; | ||
font-weight: 600; | ||
src: url(/static/fonts/poppins/Poppins-SemiBold.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: italic; | ||
font-weight: 600; | ||
src: url(/static/fonts/poppins/Poppins-SemiBoldItalic.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: normal; | ||
font-weight: 700; | ||
src: url(/static/fonts/poppins/Poppins-Bold.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: italic; | ||
font-weight: 700; | ||
src: url(/static/fonts/poppins/Poppins-BoldItalic.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: normal; | ||
font-weight: 800; | ||
src: url(/static/fonts/poppins/Poppins-ExtraBold.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: italic; | ||
font-weight: 800; | ||
src: url(/static/fonts/poppins/Poppins-ExtraBoldItalic.ttf) | ||
format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: normal; | ||
font-weight: 900; | ||
src: url(/static/fonts/poppins/Poppins-Black.ttf) format("tff"); | ||
} | ||
@font-face { | ||
font-family: Poppins; | ||
font-style: italic; | ||
font-weight: 900; | ||
src: url(/static/fonts/poppins/Poppins-BlackItalic.ttf) format("tff"); | ||
} | ||
:root { | ||
--background: 0 0% 100%; | ||
--foreground: 224 71.4% 4.1%; | ||
|
||
--muted: 220 14.3% 95.9%; | ||
--muted-foreground: 220 8.9% 46.1%; | ||
|
||
--popover: 0 0% 100%; | ||
--popover-foreground: 224 71.4% 4.1%; | ||
|
||
--card: 0 0% 100%; | ||
--card-foreground: 224 71.4% 4.1%; | ||
|
||
--border: 220 13% 91%; | ||
--input: 220 13% 91%; | ||
|
||
--primary: 220.9 39.3% 11%; | ||
--primary-foreground: 210 20% 98%; | ||
|
||
--secondary: 220 14.3% 95.9%; | ||
--secondary-foreground: 220.9 39.3% 11%; | ||
|
||
--accent: 220 14.3% 95.9%; | ||
--accent-foreground: 220.9 39.3% 11%; | ||
|
||
--destructive: 0 72.2% 50.6%; | ||
--destructive-foreground: 210 20% 98%; | ||
|
||
--ring: 224 71.4% 4.1%; | ||
|
||
--radius: 0.5rem; | ||
} | ||
|
||
.dark { | ||
--background: 224 71.4% 4.1%; | ||
--foreground: 210 20% 98%; | ||
|
||
--muted: 215 27.9% 16.9%; | ||
--muted-foreground: 217.9 10.6% 64.9%; | ||
|
||
--popover: 224 71.4% 4.1%; | ||
--popover-foreground: 210 20% 98%; | ||
|
||
--card: 224 71.4% 4.1%; | ||
--card-foreground: 210 20% 98%; | ||
|
||
--border: 215 27.9% 16.9%; | ||
--input: 215 27.9% 16.9%; | ||
|
||
--primary: 210 20% 98%; | ||
--primary-foreground: 220.9 39.3% 11%; | ||
|
||
--secondary: 215 27.9% 16.9%; | ||
--secondary-foreground: 210 20% 98%; | ||
|
||
--accent: 215 27.9% 16.9%; | ||
--accent-foreground: 210 20% 98%; | ||
|
||
--destructive: 0 62.8% 30.6%; | ||
--destructive-foreground: 210 20% 98%; | ||
|
||
--ring: 216 12.2% 83.9%; | ||
} | ||
} | ||
|
||
@layer base { | ||
* { | ||
@apply border-border; | ||
} | ||
body { | ||
@apply bg-background text-foreground; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Root from "./progress.svelte"; | ||
|
||
export { | ||
Root, | ||
// | ||
Root as Progress, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script lang="ts"> | ||
import { Progress as ProgressPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = ProgressPrimitive.Props; | ||
let className: $$Props["class"] = undefined; | ||
export let max: $$Props["max"] = 100; | ||
export let value: $$Props["value"] = undefined; | ||
export { className as class }; | ||
</script> | ||
|
||
<ProgressPrimitive.Root | ||
class={cn("bg-secondary relative h-4 w-full overflow-hidden rounded-full", className)} | ||
{...$$restProps} | ||
> | ||
<div | ||
class="bg-primary h-full w-full flex-1 transition-all" | ||
style={`transform: translateX(-${100 - (100 * (value ?? 0)) / (max ?? 1)}%)`} | ||
></div> | ||
</ProgressPrimitive.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,62 @@ | ||
import { type ClassValue, clsx } from "clsx" | ||
import { twMerge } from "tailwind-merge" | ||
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)) | ||
return twMerge(clsx(inputs)); | ||
} | ||
|
||
type FlyAndScaleParams = { | ||
y?: number; | ||
x?: number; | ||
start?: number; | ||
duration?: number; | ||
}; | ||
|
||
export const flyAndScale = ( | ||
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<string, number | string | undefined> | ||
): string => { | ||
return Object.keys(style).reduce((str, key) => { | ||
if (style[key] === undefined) return str; | ||
return str + `${key}:${style[key]};`; | ||
}, ""); | ||
}; | ||
|
||
return { | ||
duration: params.duration ?? 200, | ||
delay: 0, | ||
css: (t) => { | ||
const y = scaleConversion(t, [0, 1], [params.y ?? 5, 0]); | ||
const x = scaleConversion(t, [0, 1], [params.x ?? 0, 0]); | ||
const scale = scaleConversion(t, [0, 1], [params.start ?? 0.95, 1]); | ||
|
||
return styleToString({ | ||
transform: `${transform} translate3d(${x}px, ${y}px, 0) scale(${scale})`, | ||
opacity: t | ||
}); | ||
}, | ||
easing: cubicOut | ||
}; | ||
}; |
Oops, something went wrong.