{
	"$schema": "https://shadcn-svelte.com/schema/registry-item.json",
	"name": "tilt-card",
	"title": "Tilt Card",
	"type": "registry:ui",
	"description": "Hover and gesture interaction from Amicro, ported to Svelte 5 and motion-sv.",
	"dependencies": [
		"motion-sv"
	],
	"files": [
		{
			"content": "<script lang=\"ts\">\n\timport { motion } from 'motion-sv';\n\timport type { Snippet } from 'svelte';\n\n\tconst Div = motion.div;\n\n\tinterface Props {\n\t\tchildren?: Snippet;\n\t\tmaxTilt?: number;\n\t\tclass?: string;\n\t\tcardClass?: string;\n\t}\n\n\tlet { children, maxTilt = 15, class: className = '', cardClass = '' }: Props = $props();\n\n\tlet node = $state<HTMLDivElement | null>(null);\n\tlet isHovered = $state(false);\n\n\tlet offsetX = $state(0);\n\tlet offsetY = $state(0);\n\n\tlet rotateX = $derived(-offsetY * 2 * maxTilt);\n\tlet rotateY = $derived(offsetX * 2 * maxTilt);\n\n\tconst springConfig = { type: 'spring', damping: 20, stiffness: 200, mass: 0.5 } as const;\n\n\tfunction onpointermove(event: PointerEvent) {\n\t\tif (!node) return;\n\t\tconst rect = node.getBoundingClientRect();\n\t\toffsetX = (event.clientX - rect.left) / rect.width - 0.5;\n\t\toffsetY = (event.clientY - rect.top) / rect.height - 0.5;\n\t}\n\n\tfunction onpointerleave() {\n\t\tisHovered = false;\n\t\toffsetX = 0;\n\t\toffsetY = 0;\n\t}\n</script>\n\n<!-- svelte-ignore a11y_no_static_element_interactions -->\n<div\n\tbind:this={node}\n\t{onpointermove}\n\tonpointerenter={() => (isHovered = true)}\n\t{onpointerleave}\n\tclass={`tilt-card ${className}`}\n\tdata-testid=\"tilt-card\"\n\tdata-hovered={isHovered}\n>\n\t<Div\n\t\tanimate={{ rotateX, rotateY }}\n\t\ttransition={springConfig}\n\t\tclass={`tilt-card-face ${cardClass}`}\n\t>\n\t\t<div class=\"tilt-card-content\">\n\t\t\t{@render children?.()}\n\t\t</div>\n\t</Div>\n</div>\n\n<style>\n\t.tilt-card {\n\t\tposition: relative;\n\t\twidth: 100%;\n\t\tmax-width: 320px;\n\t\taspect-ratio: 4 / 3;\n\t\tcursor: pointer;\n\t\t\n\t\tperspective: 800px;\n\t}\n\n\t:global(.tilt-card .tilt-card-face) {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tpadding: 1.5rem;\n\t\tborder: 1px solid var(--line);\n\t\tborder-radius: 1rem;\n\t\tbackground: linear-gradient(to bottom right, var(--surface), var(--surface-2));\n\t\tbox-shadow: 0 10px 24px -8px rgb(0 0 0 / 0.2);\n\t\tuser-select: none;\n\t\ttransform-style: preserve-3d;\n\t}\n\n\t.tilt-card-content {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\t\n\t\ttransform: translateZ(40px);\n\t\ttransform-style: preserve-3d;\n\t}\n</style>\n",
			"type": "registry:ui",
			"target": "amicro/TiltCard.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"
		}
	]
}