({
images = [],
altPrefix = 'Orbiting image',
shape = 'ellipse',
customPath,
baseWidth = 1400,
radiusX = 700,
radiusY = 170,
radius = 300,
starPoints = 5,
starInnerRatio = 0.5,
rotation = -8,
duration = 40,
itemSize = 64,
direction = 'normal',
fill = true,
width = 100,
height = 100,
className = '',
showPath = false,
pathColor = 'rgba(0,0,0,0.1)',
pathWidth = 2,
easing = 'linear',
paused = false,
centerContent,
responsive = false,
})
| 96 | } |
| 97 | |
| 98 | export default function OrbitImages({ |
| 99 | images = [], |
| 100 | altPrefix = 'Orbiting image', |
| 101 | shape = 'ellipse', |
| 102 | customPath, |
| 103 | baseWidth = 1400, |
| 104 | radiusX = 700, |
| 105 | radiusY = 170, |
| 106 | radius = 300, |
| 107 | starPoints = 5, |
| 108 | starInnerRatio = 0.5, |
| 109 | rotation = -8, |
| 110 | duration = 40, |
| 111 | itemSize = 64, |
| 112 | direction = 'normal', |
| 113 | fill = true, |
| 114 | width = 100, |
| 115 | height = 100, |
| 116 | className = '', |
| 117 | showPath = false, |
| 118 | pathColor = 'rgba(0,0,0,0.1)', |
| 119 | pathWidth = 2, |
| 120 | easing = 'linear', |
| 121 | paused = false, |
| 122 | centerContent, |
| 123 | responsive = false, |
| 124 | }) { |
| 125 | const containerRef = useRef(null); |
| 126 | const [scale, setScale] = useState(null); |
| 127 | |
| 128 | const designCenterX = baseWidth / 2; |
| 129 | const designCenterY = baseWidth / 2; |
| 130 | |
| 131 | const path = useMemo(() => { |
| 132 | switch (shape) { |
| 133 | case 'circle': |
| 134 | return generateCirclePath(designCenterX, designCenterY, radius); |
| 135 | case 'ellipse': |
| 136 | return generateEllipsePath(designCenterX, designCenterY, radiusX, radiusY); |
| 137 | case 'square': |
| 138 | return generateSquarePath(designCenterX, designCenterY, radius * 2); |
| 139 | case 'rectangle': |
| 140 | return generateRectanglePath(designCenterX, designCenterY, radiusX * 2, radiusY * 2); |
| 141 | case 'triangle': |
| 142 | return generateTrianglePath(designCenterX, designCenterY, radius * 2); |
| 143 | case 'star': |
| 144 | return generateStarPath(designCenterX, designCenterY, radius, radius * starInnerRatio, starPoints); |
| 145 | case 'heart': |
| 146 | return generateHeartPath(designCenterX, designCenterY, radius * 2); |
| 147 | case 'infinity': |
| 148 | return generateInfinityPath(designCenterX, designCenterY, radiusX * 2, radiusY * 2); |
| 149 | case 'wave': |
| 150 | return generateWavePath(designCenterX, designCenterY, radiusX * 2, radiusY, 3); |
| 151 | case 'custom': |
| 152 | return customPath || generateCirclePath(designCenterX, designCenterY, radius); |
| 153 | default: |
| 154 | return generateEllipsePath(designCenterX, designCenterY, radiusX, radiusY); |
| 155 | } |
nothing calls this directly
no test coverage detected