Skip to content

Commit 2a351d9

Browse files
committed
docs(Rotate): update transition effects and toggle button text for improved interaction
1 parent d90096c commit 2a351d9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/react-components/react-motion-components-preview/stories/src/Rotate/RotateCardFlip.stories.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ const useClasses = makeStyles({
2828
perspectiveOrigin: 'center center',
2929
height: '140px',
3030
cursor: 'pointer',
31-
transition: 'transform 0.2s ease',
3231
borderRadius: tokens.borderRadiusMedium,
32+
transition: `scale ${motionTokens.durationSlow}ms ${motionTokens.curveDecelerateMid}`,
3333
'&:hover': {
34-
transform: 'translateY(-2px)',
34+
scale: '105%',
3535
},
3636
},
3737
patternCard: {
@@ -155,11 +155,15 @@ export const CardFlip = () => {
155155
}
156156
};
157157

158+
const getToggleButtonText = () => {
159+
return activePatterns.size === patterns.length ? 'Flip to Back' : 'Flip to Front';
160+
};
161+
158162
return (
159163
<div className={classes.container}>
160164
<div className={classes.controls}>
161165
<Button onClick={toggleAllPatterns} aria-label="Toggle all rotation patterns">
162-
Flip All
166+
{getToggleButtonText()}
163167
</Button>
164168
</div>
165169

0 commit comments

Comments
 (0)