@@ -7,21 +7,21 @@ const useClasses = makeStyles({
7
7
container : {
8
8
display : 'flex' ,
9
9
flexDirection : 'column' ,
10
- gap : '20px' ,
11
- padding : '20px' ,
10
+ gap : tokens . spacingVerticalXL , // 20px
11
+ padding : tokens . spacingVerticalXL , // 20px
12
12
maxWidth : '1000px' ,
13
13
} ,
14
14
controls : {
15
15
display : 'flex' ,
16
- gap : '10px' ,
16
+ gap : tokens . spacingHorizontalMNudge , // 10px
17
17
alignItems : 'center' ,
18
18
flexWrap : 'wrap' ,
19
- marginBottom : '20px' ,
19
+ marginBottom : tokens . spacingVerticalXL , // 20px
20
20
} ,
21
21
patternsGrid : {
22
22
display : 'grid' ,
23
23
gridTemplateColumns : 'repeat(auto-fit, minmax(200px, 1fr))' ,
24
- gap : '20px' ,
24
+ gap : tokens . spacingVerticalXL , // 20px
25
25
} ,
26
26
cardWrapper : {
27
27
perspective : '500px' ,
@@ -92,7 +92,7 @@ const patterns: RotatePattern[] = [
92
92
angle : 180 ,
93
93
easing : curveSpringRelaxed ,
94
94
exitEasing : motionTokens . curveDecelerateMid ,
95
- duration : 2000 ,
95
+ duration : motionTokens . durationUltraSlow * 4 , // 2000ms = 500ms * 4
96
96
exitDuration : motionTokens . durationUltraSlow ,
97
97
} ,
98
98
{
@@ -105,7 +105,7 @@ const patterns: RotatePattern[] = [
105
105
angle : 180 ,
106
106
easing : curveSpringRelaxed ,
107
107
exitEasing : motionTokens . curveDecelerateMid ,
108
- duration : 2000 ,
108
+ duration : motionTokens . durationUltraSlow * 4 , // 2000ms = 500ms * 4
109
109
exitDuration : motionTokens . durationUltraSlow ,
110
110
} ,
111
111
{
@@ -118,7 +118,7 @@ const patterns: RotatePattern[] = [
118
118
angle : 180 ,
119
119
easing : curveSpringRelaxed ,
120
120
exitEasing : motionTokens . curveDecelerateMid ,
121
- duration : 2000 ,
121
+ duration : motionTokens . durationUltraSlow * 4 , // 2000ms = 500ms * 4
122
122
exitDuration : motionTokens . durationUltraSlow ,
123
123
} ,
124
124
] ;
@@ -152,7 +152,9 @@ export const CardFlip = () => {
152
152
return (
153
153
< div className = { classes . container } >
154
154
< div className = { classes . controls } >
155
- < Button onClick = { toggleAllPatterns } > Flip All</ Button >
155
+ < Button onClick = { toggleAllPatterns } aria-label = "Toggle all rotation patterns" >
156
+ Flip All
157
+ </ Button >
156
158
</ div >
157
159
158
160
< div className = { classes . patternsGrid } >
@@ -168,7 +170,20 @@ export const CardFlip = () => {
168
170
exitDuration = { pattern . exitDuration }
169
171
animateOpacity = { false }
170
172
>
171
- < Card className = { classes . patternCard } onClick = { ( ) => togglePattern ( pattern . id ) } appearance = "outline" >
173
+ < Card
174
+ className = { classes . patternCard }
175
+ onClick = { ( ) => togglePattern ( pattern . id ) }
176
+ appearance = "outline"
177
+ role = "button"
178
+ tabIndex = { 0 }
179
+ aria-label = { `Toggle ${ pattern . name } rotation` }
180
+ onKeyDown = { e => {
181
+ if ( e . key === 'Enter' || e . key === ' ' ) {
182
+ e . preventDefault ( ) ;
183
+ togglePattern ( pattern . id ) ;
184
+ }
185
+ } }
186
+ >
172
187
< div className = { classes . demoIcon } style = { { backgroundColor : pattern . color } } >
173
188
{ pattern . icon }
174
189
</ div >
0 commit comments