{
	"$schema": "https://shadcn-svelte.com/schema/registry-item.json",
	"name": "wave-physics-loader",
	"title": "Wave Physics Loader",
	"type": "registry:ui",
	"description": "Loader from Amicro, ported to Svelte 5 and motion-sv.",
	"dependencies": [
		"motion-sv"
	],
	"files": [
		{
			"content": "<script lang=\"ts\">\n\timport { motion } from 'motion-sv';\n\n\tconst Div = motion.div;\n\n\tinterface Props {\n\t\ttheme?: 'light' | 'dark';\n\t}\n\n\tlet { theme = 'light' }: Props = $props();\n\n\tconst frames = $derived(berechneFrames(theme));\n\n\tinterface BarData {\n\t\theights: string[];\n\t\tcolors: string[];\n\t}\n\n\tinterface Frames {\n\t\tbars: BarData[];\n\t\tballX: string[];\n\t\tballY: string[];\n\t\tballScaleX: number[];\n\t\tballScaleY: number[];\n\t\ttimes: number[];\n\t}\n\n\tfunction berechneFrames(themeVal: 'light' | 'dark'): Frames {\n\t\tconst numBars = 15;\n\t\tconst barWidth = 12;\n\t\tconst barGap = 8;\n\t\tconst barTotalWidth = barWidth + barGap;\n\n\t\tconst numFrames = 201;\n\t\tconst B = 4;\n\t\tconst maxBounce = 60;\n\t\tconst baseBarH = 16;\n\t\tconst wavePeakH = 48;\n\n\t\tconst barsData: BarData[] = Array.from({ length: numBars }, () => ({\n\t\t\theights: [],\n\t\t\tcolors: []\n\t\t}));\n\t\tconst bX: string[] = [];\n\t\tconst bY: string[] = [];\n\t\tconst bScaleX: number[] = [];\n\t\tconst bScaleY: number[] = [];\n\t\tconst tArr: number[] = [];\n\n\t\tfor (let k = 0; k < numFrames; k++) {\n\t\t\tconst t = k / (numFrames - 1);\n\t\t\ttArr.push(t);\n\n\t\t\tconst x_frac = t < 0.5 ? t / 0.5 : (1 - t) / 0.5;\n\t\t\tconst ball_idx = x_frac * (numBars - 1);\n\n\t\t\tbX.push(`${ball_idx * barTotalWidth}px`);\n\n\t\t\tlet bounce_f = (x_frac * B) % 1.0;\n\t\t\tif (x_frac === 1 || x_frac === 0) bounce_f = 0;\n\n\t\t\tconst bounce_h = 4 * bounce_f * (1 - bounce_f);\n\t\t\tconst height_factor = Math.max(0, 1 - bounce_h * 2);\n\n\t\t\tconst ball_indent = height_factor * 20;\n\t\t\tconst ball_y = baseBarH + wavePeakH - ball_indent + bounce_h * maxBounce;\n\t\t\tbY.push(`-${ball_y}px`);\n\n\t\t\tconst squish = height_factor;\n\t\t\tbScaleY.push(1 - squish * 0.3);\n\t\t\tbScaleX.push(1 + squish * 0.25);\n\n\t\t\tfor (let i = 0; i < numBars; i++) {\n\t\t\t\tconst dist = Math.abs(i - ball_idx);\n\n\t\t\t\tlet wave_val = 0;\n\t\t\t\tif (dist < 3) {\n\t\t\t\t\twave_val = Math.cos((dist / 3) * (Math.PI / 2));\n\t\t\t\t}\n\n\t\t\t\tlet indent = 0;\n\t\t\t\tif (dist < 1.5) {\n\t\t\t\t\tconst indent_dist = Math.cos((dist / 1.5) * (Math.PI / 2));\n\t\t\t\t\tindent = indent_dist * height_factor * 20;\n\t\t\t\t}\n\n\t\t\t\tconst bar_h = baseBarH + wave_val * wavePeakH - indent;\n\t\t\t\tbarsData[i].heights.push(`${Math.max(4, bar_h)}px`);\n\n\t\t\t\tconst isDark = themeVal === 'dark';\n\t\t\t\tlet r: number, g: number, b: number;\n\t\t\t\tif (isDark) {\n\t\t\t\t\tr = Math.round(39 + wave_val * (228 - 39));\n\t\t\t\t\tg = Math.round(39 + wave_val * (228 - 39));\n\t\t\t\t\tb = Math.round(42 + wave_val * (231 - 42));\n\t\t\t\t} else {\n\t\t\t\t\tr = Math.round(228 - wave_val * (228 - 39));\n\t\t\t\t\tg = Math.round(228 - wave_val * (228 - 39));\n\t\t\t\t\tb = Math.round(231 - wave_val * (231 - 42));\n\t\t\t\t}\n\t\t\t\tbarsData[i].colors.push(`rgb(${r}, ${g}, ${b})`);\n\t\t\t}\n\t\t}\n\n\t\treturn { bars: barsData, ballX: bX, ballY: bY, ballScaleX: bScaleX, ballScaleY: bScaleY, times: tArr };\n\t}\n</script>\n\n<div class=\"relative flex flex-col items-center justify-center w-full scale-[0.6] sm:scale-75 md:scale-100\">\n\t<div class=\"relative flex items-end justify-start h-48 space-x-2 w-[292px]\">\n\t\t{#each frames.bars as bar, i}\n\t\t\t<Div\n\t\t\t\tclass=\"w-3 rounded-full origin-bottom\"\n\t\t\t\tstyle={{\n\t\t\t\t\theight: '16px',\n\t\t\t\t\tbackgroundColor: theme === 'dark' ? 'rgb(39, 39, 42)' : 'rgb(228, 228, 231)'\n\t\t\t\t}}\n\t\t\t\tanimate={{\n\t\t\t\t\theight: bar.heights,\n\t\t\t\t\tbackgroundColor: bar.colors\n\t\t\t\t}}\n\t\t\t\ttransition={{\n\t\t\t\t\tduration: 4,\n\t\t\t\t\trepeat: Infinity,\n\t\t\t\t\ttimes: frames.times,\n\t\t\t\t\tease: 'linear'\n\t\t\t\t}}\n\t\t\t/>\n\t\t{/each}\n\n\t\t<Div\n\t\t\tclass=\"absolute w-3 h-3 bg-zinc-900 dark:bg-white rounded-full z-10 shadow-sm\"\n\t\t\tstyle={{ bottom: 0, left: 0, transformOrigin: 'bottom center' }}\n\t\t\tanimate={{\n\t\t\t\tx: frames.ballX,\n\t\t\t\ty: frames.ballY,\n\t\t\t\tscaleX: frames.ballScaleX,\n\t\t\t\tscaleY: frames.ballScaleY\n\t\t\t}}\n\t\t\ttransition={{\n\t\t\t\tduration: 4,\n\t\t\t\trepeat: Infinity,\n\t\t\t\ttimes: frames.times,\n\t\t\t\tease: 'linear'\n\t\t\t}}\n\t\t/>\n\t</div>\n</div>\n",
			"type": "registry:ui",
			"target": "amicro/WavePhysicsLoader.svelte"
		},
		{
			"content": "This file was ported from Amicro (React) and copied into your project by the\namicro-sv registry: https://amicro-sv.enisdev.com\n\nOriginal: https://github.com/Subhan-code/Amicro--Micro-transitions-\n\nMIT License\n\nCopyright (c) 2026 SYED SUBHAN UDDIN\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
			"type": "registry:file",
			"target": "amicro/LICENSE"
		}
	]
}