@@ -10,6 +10,52 @@ interface KeyboardShortcutsProps {
1010 shortcuts : KeyboardShortcut [ ] ;
1111}
1212
13+ // Component for individual keyboard shortcut badge with hover effects
14+ const ShortcutBadge : React . FC < { shortcut : string } > = ( { shortcut } ) => {
15+ const [ isHovered , setIsHovered ] = useState ( false ) ;
16+
17+ return (
18+ < div
19+ style = { {
20+ background : isHovered
21+ ? 'linear-gradient(145deg, #3498db, #2980b9)'
22+ : 'linear-gradient(145deg, #2c3e50, #34495e)' ,
23+ padding : '6px 12px' ,
24+ borderRadius : '8px' ,
25+ fontSize : '13px' ,
26+ fontFamily : 'monospace' ,
27+ fontWeight : 'bold' ,
28+ color : '#ffffff' ,
29+ textShadow : '0 1px 2px rgba(0, 0, 0, 0.8)' ,
30+ boxShadow : isHovered
31+ ? `
32+ 0 6px 12px rgba(0, 0, 0, 0.4),
33+ 0 3px 6px rgba(0, 0, 0, 0.3),
34+ inset 0 1px 0 rgba(255, 255, 255, 0.3),
35+ inset 0 -1px 0 rgba(0, 0, 0, 0.4)
36+ `
37+ : `
38+ 0 4px 8px rgba(0, 0, 0, 0.3),
39+ 0 2px 4px rgba(0, 0, 0, 0.2),
40+ inset 0 1px 0 rgba(255, 255, 255, 0.2),
41+ inset 0 -1px 0 rgba(0, 0, 0, 0.3)
42+ ` ,
43+ border : isHovered ? '1px solid #1e3a8a' : '1px solid #1a252f' ,
44+ transform : isHovered ? 'translateY(-2px)' : 'translateY(-1px)' ,
45+ transition : 'all 0.2s ease' ,
46+ minWidth : 'fit-content' ,
47+ letterSpacing : '0.5px' ,
48+ cursor : 'default' ,
49+ userSelect : 'none' ,
50+ } }
51+ onMouseEnter = { ( ) => setIsHovered ( true ) }
52+ onMouseLeave = { ( ) => setIsHovered ( false ) }
53+ >
54+ { shortcut }
55+ </ div >
56+ ) ;
57+ } ;
58+
1359const KeyboardShortcuts : React . FC < KeyboardShortcutsProps > = ( { shortcuts } ) => {
1460 const [ isVisible , setIsVisible ] = useState ( false ) ;
1561
@@ -147,7 +193,7 @@ const KeyboardShortcuts: React.FC<KeyboardShortcutsProps> = ({ shortcuts }) => {
147193 width : '90%' ,
148194 maxHeight : '80vh' ,
149195 overflowY : 'auto' ,
150- boxShadow : '0 10px 40px rgba(0, 0, 0, 0.1)' ,
196+ boxShadow : '0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1)' ,
151197 zIndex : 1001 ,
152198 } }
153199 role = "dialog"
@@ -184,19 +230,8 @@ const KeyboardShortcuts: React.FC<KeyboardShortcutsProps> = ({ shortcuts }) => {
184230 borderBottom : index < shortcuts . length - 1 ? '1px solid #f0f0f0' : 'none' ,
185231 } }
186232 >
187- < span style = { { color : '#555' } } > { shortcut . description } </ span >
188- < div
189- style = { {
190- backgroundColor : '#f5f5f5' ,
191- padding : '4px 8px' ,
192- borderRadius : '4px' ,
193- fontSize : '12px' ,
194- fontFamily : 'monospace' ,
195- color : '#333' ,
196- } }
197- >
198- { formatShortcut ( shortcut . key ) }
199- </ div >
233+ < span style = { { color : '#2c3e50' , fontWeight : '500' } } > { shortcut . description } </ span >
234+ < ShortcutBadge shortcut = { formatShortcut ( shortcut . key ) } />
200235 </ div >
201236 ) ) }
202237 </ div >
0 commit comments