()
| 23 | }; |
| 24 | |
| 25 | const TextCursorDemo = () => { |
| 26 | const { props, updateProp, resetProps, hasChanges } = useComponentProps(DEFAULT_PROPS); |
| 27 | const { text, followMouseDirection, randomFloat } = props; |
| 28 | |
| 29 | const [key, forceRerender] = useForceRerender(); |
| 30 | |
| 31 | const propData = useMemo( |
| 32 | () => [ |
| 33 | { |
| 34 | name: 'text', |
| 35 | type: 'string', |
| 36 | default: '⚛️', |
| 37 | description: 'The text string to display as the trail.' |
| 38 | }, |
| 39 | { |
| 40 | name: 'spacing', |
| 41 | type: 'number', |
| 42 | default: '100', |
| 43 | description: 'The spacing in pixels between each trail point.' |
| 44 | }, |
| 45 | { |
| 46 | name: 'followMouseDirection', |
| 47 | type: 'boolean', |
| 48 | default: 'true', |
| 49 | description: 'If true, each text rotates to follow the mouse direction.' |
| 50 | }, |
| 51 | { |
| 52 | name: 'randomFloat', |
| 53 | type: 'boolean', |
| 54 | default: 'true', |
| 55 | description: 'If true, enables random floating offsets in position and rotation for a dynamic effect.' |
| 56 | }, |
| 57 | { |
| 58 | name: 'exitDuration', |
| 59 | type: 'number', |
| 60 | default: '0.5', |
| 61 | description: 'The duration in seconds for the exit animation of each trail item.' |
| 62 | }, |
| 63 | { |
| 64 | name: 'removalInterval', |
| 65 | type: 'number', |
| 66 | default: '30', |
| 67 | description: 'The interval in milliseconds between removing trail items when the mouse stops moving.' |
| 68 | }, |
| 69 | { |
| 70 | name: 'maxPoints', |
| 71 | type: 'number', |
| 72 | default: '5', |
| 73 | description: 'The maximum number of trail points to display.' |
| 74 | } |
| 75 | ], |
| 76 | [] |
| 77 | ); |
| 78 | |
| 79 | return ( |
| 80 | <ComponentPropsProvider props={props} defaultProps={DEFAULT_PROPS} resetProps={resetProps} hasChanges={hasChanges}> |
| 81 | <TabsLayout> |
| 82 | <PreviewTab> |
nothing calls this directly
no test coverage detected