@@ -27,47 +27,58 @@ export default function ReadmeBadge({ username }: Props) {
2727 }
2828
2929 return (
30- < div style = { { marginBottom : '40px' } } >
31- { /* Badge preview — aspect-ratio wrapper prevents layout shift while loading */ }
32- < div style = { { width : '100%' , aspectRatio : '440 / 96' , marginBottom : '10px' } } >
33- { /* eslint-disable-next-line @next/next/no-img-element */ }
34- < img
35- src = { `/api/badge?username=${ username } &v=${ BADGE_VERSION } ` }
36- alt = { altText }
37- loading = "lazy"
38- decoding = "async"
39- style = { { width : '100%' , height : '100%' , display : 'block' } }
40- />
41- </ div >
30+ < div style = { { width : '100%' , marginBottom : '22px' , display : 'flex' , justifyContent : 'center' } } >
31+ < div
32+ className = "record-card"
33+ style = { {
34+ width : 'min(520px, 100%)' ,
35+ border : '2px solid #1a1a1a' ,
36+ borderRadius : '0px' ,
37+ boxShadow : '0 1px 4px rgba(0,0,0,0.05)' ,
38+ padding : '14px 16px' ,
39+ } }
40+ >
41+ { /* Badge preview — aspect-ratio wrapper prevents layout shift while loading */ }
42+ < div style = { { width : '100%' , aspectRatio : '440 / 96' } } >
43+ { /* eslint-disable-next-line @next/next/no-img-element */ }
44+ < img
45+ src = { `/api/badge?username=${ username } &v=${ BADGE_VERSION } ` }
46+ alt = { altText }
47+ loading = "lazy"
48+ decoding = "async"
49+ style = { { width : '100%' , height : '100%' , display : 'block' } }
50+ />
51+ </ div >
4252
43- { /* Copy row */ }
44- < div style = { { display : 'flex' , alignItems : 'center' , justifyContent : 'space-between' , gap : '12px' , marginTop : '4px' } } >
45- < p className = "readme-badge-caption" style = { { fontFamily : MONO , margin : 0 , textAlign : 'left' } } >
46- ↻ paste once — updates automatically
47- </ p >
48- < button
49- onClick = { handleCopy }
50- className = "readme-copy-btn"
51- style = { {
52- fontFamily : MONO ,
53- fontSize : '10px' ,
54- fontWeight : 700 ,
55- letterSpacing : '0.06em' ,
56- padding : '8px 14px' ,
57- minHeight : '36px' ,
58- background : copied ? '#2d7a3c' : 'transparent' ,
59- color : copied ? '#fff' : '#4a4440' ,
60- border : `2px solid ${ copied ? '#2d7a3c' : '#cec6bb' } ` ,
61- cursor : 'pointer' ,
62- transition : 'all 0.15s' ,
63- whiteSpace : 'nowrap' ,
64- flexShrink : 0 ,
65- } }
66- onMouseEnter = { e => { if ( ! copied ) { e . currentTarget . style . borderColor = '#1a1a1a' ; e . currentTarget . style . color = '#1a1a1a' } } }
67- onMouseLeave = { e => { if ( ! copied ) { e . currentTarget . style . borderColor = '#cec6bb' ; e . currentTarget . style . color = '#4a4440' } } }
68- >
69- { copied ? '✓ copied!' : '⎘ copy to readme' }
70- </ button >
53+ { /* Copy row */ }
54+ < div style = { { display : 'flex' , alignItems : 'center' , justifyContent : 'space-between' , gap : '12px' , marginTop : '10px' } } >
55+ < p className = "readme-badge-caption" style = { { fontFamily : MONO , margin : 0 , textAlign : 'left' } } >
56+ ↻ paste once — updates automatically
57+ </ p >
58+ < button
59+ onClick = { handleCopy }
60+ className = "readme-copy-btn"
61+ style = { {
62+ fontFamily : MONO ,
63+ fontSize : '10px' ,
64+ fontWeight : 700 ,
65+ letterSpacing : '0.06em' ,
66+ padding : '8px 14px' ,
67+ minHeight : '36px' ,
68+ background : copied ? '#2d7a3c' : 'transparent' ,
69+ color : copied ? '#fff' : '#4a4440' ,
70+ border : `2px solid ${ copied ? '#2d7a3c' : '#cec6bb' } ` ,
71+ cursor : 'pointer' ,
72+ transition : 'all 0.15s' ,
73+ whiteSpace : 'nowrap' ,
74+ flexShrink : 0 ,
75+ } }
76+ onMouseEnter = { e => { if ( ! copied ) { e . currentTarget . style . borderColor = '#1a1a1a' ; e . currentTarget . style . color = '#1a1a1a' } } }
77+ onMouseLeave = { e => { if ( ! copied ) { e . currentTarget . style . borderColor = '#cec6bb' ; e . currentTarget . style . color = '#4a4440' } } }
78+ >
79+ { copied ? '✓ copied!' : '⎘ copy to readme' }
80+ </ button >
81+ </ div >
7182 </ div >
7283 </ div >
7384 )
0 commit comments