migrate to Preact and add animations (#1)
- Replace React 19 with Preact via @preact/preset-vite (zero component changes needed — Vite aliases react → preact/compat at build time) - Add custom iOS easing curves (ease-ios, ease-spring) via Tailwind @theme - Update all transitions to use iOS-standard 200ms durations and spring/decel easing - Add active:scale press feedback on tiles, buttons, and toggles - Toggle knob now uses spring easing for a satisfying snap Reviewed-on: #1 Co-authored-by: Jose Henrique <jose.henrique.ivan@gmail.com> Co-committed-by: Jose Henrique <jose.henrique.ivan@gmail.com>
This commit was merged in pull request #1.
This commit is contained in:
@@ -11,12 +11,12 @@ const ToggleSwitch: React.FC<ToggleSwitchProps> = ({ checked, onChange }) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`w-14 h-8 flex items-center rounded-full p-1 cursor-pointer transition-colors duration-300 ${checked ? 'bg-cyan-500' : 'bg-gray-600'}`}
|
||||
<div
|
||||
className={`w-14 h-8 flex items-center rounded-full p-1 cursor-pointer transition-colors duration-200 ease-ios ${checked ? 'bg-cyan-500' : 'bg-gray-600'}`}
|
||||
onClick={handleToggle}
|
||||
>
|
||||
<div
|
||||
className={`bg-white w-6 h-6 rounded-full shadow-md transform transition-transform duration-300 ${checked ? 'translate-x-6' : 'translate-x-0'}`}
|
||||
<div
|
||||
className={`bg-white w-6 h-6 rounded-full shadow-md transform transition-transform duration-200 ease-spring ${checked ? 'translate-x-6' : 'translate-x-0'}`}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user