export enum SpinnerSize { Small = '22px', Medium = '30px', Large = '40px', LargeLarge = '60px', } export const Spinner01 = ({ size = SpinnerSize.Medium, color = 'var(--primary-color)', }: { size?: SpinnerSize; color?: string; }) => { const borderWidth = size === SpinnerSize.Small || size === SpinnerSize.Medium ? '4px' : size === SpinnerSize.Large ? '6px' : '9px'; const css: any = { width: size, aspectRatio: 1, borderRadius: '50%', background: `radial-gradient(farthest-side,${color} 94%,#0000) top/8px 8px no-repeat, conic-gradient(#0000 30%,${color})`, '-webkit-mask': `radial-gradient(farthest-side,#0000 calc(100% - ${borderWidth}),#000 0)`, animation: 'spinner01 1s infinite linear', '@keyframes spinner01': { '100%': { transform: 'rotate(1turn)' }, }, }; return
; }; export const Spinner02 = ({ size = SpinnerSize.Medium, color = 'var(--primary-color)', }: { size?: SpinnerSize; color?: string; }) => { const base = parseInt(size.replace('px', '')); const ballSize = Array.from({ length: 7 }, (_, i) => `${((i * base) / 15 / 7).toFixed(2)}px`); const css: any = { width: size, height: size, display: 'flex', placeItems: 'center', justifyContent: 'center', '.spinner02-box': { '--spin02-w': `${base / 2 - 3}px`, width: '4px', height: '4px', borderRadius: '50%', color, boxShadow: ` calc(1*var(--spin02-w)) calc(0*var(--spin02-w)) 0 0, calc(0.707*var(--spin02-w)) calc(0.707*var(--spin02-w)) 0 ${ballSize[1]}, calc(0*var(--spin02-w)) calc(1*var(--spin02-w)) 0 ${ballSize[2]}, calc(-0.707*var(--spin02-w)) calc(0.707*var(--spin02-w)) 0 ${ballSize[3]}, calc(-1*var(--spin02-w)) calc(0*var(--spin02-w)) 0 ${ballSize[4]}, calc(-0.707*var(--spin02-w)) calc(-0.707*var(--spin02-w)) 0 ${ballSize[5]}, calc(0*var(--spin02-w)) calc(-1*var(--spin02-w)) 0 ${ballSize[6]}`, animation: 'spinner02 1s infinite steps(8)', }, '@keyframes spinner02': { '100%': { transform: 'rotate(1turn)' }, }, }; return (