Skip to content

Commit 524ea8f

Browse files
committed
feat(Rotate): adjust perspective settings and enhance card wrapper styling
1 parent 267c63e commit 524ea8f

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const useClasses = makeStyles({
1010
gap: '20px',
1111
padding: '20px',
1212
maxWidth: '1000px',
13-
perspective: '500px',
1413
},
1514
controls: {
1615
display: 'flex',
@@ -23,7 +22,10 @@ const useClasses = makeStyles({
2322
display: 'grid',
2423
gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
2524
gap: '20px',
25+
},
26+
cardWrapper: {
2627
perspective: '800px',
28+
perspectiveOrigin: 'center center',
2729
},
2830
patternCard: {
2931
height: '140px',
@@ -143,17 +145,15 @@ export const CardFlip = () => {
143145
}
144146
};
145147

146-
const allPatternsVisible = activePatterns.size === patterns.length;
147-
148148
return (
149149
<div className={classes.container}>
150150
<div className={classes.controls}>
151-
<Button onClick={toggleAllPatterns}>{allPatternsVisible ? 'Hide All' : 'Show All'}</Button>
151+
<Button onClick={toggleAllPatterns}>Flip All</Button>
152152
</div>
153153

154154
<div className={classes.patternsGrid}>
155155
{patterns.map(pattern => (
156-
<div key={pattern.id}>
156+
<div key={pattern.id} className={classes.cardWrapper}>
157157
<Rotate
158158
visible={activePatterns.has(pattern.id)}
159159
axis={pattern.axis}
@@ -175,10 +175,6 @@ export const CardFlip = () => {
175175
</div>
176176
))}
177177
</div>
178-
179-
<Body2 style={{ textAlign: 'center', color: tokens.colorNeutralForeground2, marginTop: '20px' }}>
180-
Click any pattern to see its rotation effect, or use the controls above to see them all in sequence
181-
</Body2>
182178
</div>
183179
);
184180
};
@@ -187,7 +183,7 @@ CardFlip.parameters = {
187183
docs: {
188184
description: {
189185
story:
190-
'A collection of common single-axis rotation patterns that you can use as starting points for your own animations. Each pattern demonstrates rotation around a specific axis (X, Y, or Z) with spring-relaxed easing.',
186+
'Each card rotates around a specific axis (X, Y, or Z) with different easing and durations for the enter and exit transitions.',
191187
},
192188
},
193189
};

0 commit comments

Comments
 (0)