@@ -49,34 +49,34 @@ const CharacterDisplay: React.FC<CharacterDisplayProps> = ({
4949 const duplicateChar = currentState . duplicateChar || '' ;
5050
5151 // 绘制字符
52- const charGroup = svg . selectAll ( '.char-group' )
52+ svg . selectAll ( '.char-group' )
5353 . data ( inputString . split ( '' ) )
5454 . join (
5555 // 添加新字符
5656 enter => {
5757 const g = enter . append ( 'g' )
5858 . attr ( 'class' , 'char-group' )
59- . attr ( 'transform' , ( d , i ) => `translate(${ startX + i * ( charWidth + spacing ) } , ${ startY } )` )
59+ . attr ( 'transform' , ( _ , i ) => `translate(${ startX + i * ( charWidth + spacing ) } , ${ startY } )` )
6060 . style ( 'opacity' , 0 ) ;
6161
6262 g . append ( 'rect' )
6363 . attr ( 'width' , charWidth )
6464 . attr ( 'height' , charHeight )
6565 . attr ( 'rx' , 5 )
6666 . attr ( 'ry' , 5 )
67- . attr ( 'fill' , ( d , i ) => {
67+ . attr ( 'fill' , ( _ , i ) => {
6868 if ( i >= leftPointer && i <= rightPointer ) {
6969 return '#e0f7fa' ;
7070 }
7171 return '#f5f5f5' ;
7272 } )
73- . attr ( 'stroke' , ( d , i ) => {
73+ . attr ( 'stroke' , ( d ) => {
7474 if ( duplicateFound && d === duplicateChar ) {
7575 return '#f44336' ;
7676 }
7777 return '#ccc' ;
7878 } )
79- . attr ( 'stroke-width' , ( d , i ) => {
79+ . attr ( 'stroke-width' , ( d ) => {
8080 if ( duplicateFound && d === duplicateChar ) {
8181 return 3 ;
8282 }
@@ -102,26 +102,26 @@ const CharacterDisplay: React.FC<CharacterDisplayProps> = ({
102102 update => {
103103 update . transition ( )
104104 . duration ( 400 )
105- . attr ( 'transform' , ( d , i ) => `translate(${ startX + i * ( charWidth + spacing ) } , ${ startY } )` ) ;
105+ . attr ( 'transform' , ( _ , i ) => `translate(${ startX + i * ( charWidth + spacing ) } , ${ startY } )` ) ;
106106
107107 update . select ( 'rect' )
108108 . transition ( )
109109 . duration ( 400 )
110110 . attr ( 'width' , charWidth )
111111 . attr ( 'height' , charHeight )
112- . attr ( 'fill' , ( d , i ) => {
112+ . attr ( 'fill' , ( _ , i ) => {
113113 if ( i >= leftPointer && i <= rightPointer ) {
114114 return '#e0f7fa' ;
115115 }
116116 return '#f5f5f5' ;
117117 } )
118- . attr ( 'stroke' , ( d , i ) => {
118+ . attr ( 'stroke' , ( d ) => {
119119 if ( duplicateFound && d === duplicateChar ) {
120120 return '#f44336' ;
121121 }
122122 return '#ccc' ;
123123 } )
124- . attr ( 'stroke-width' , ( d , i ) => {
124+ . attr ( 'stroke-width' , ( d ) => {
125125 if ( duplicateFound && d === duplicateChar ) {
126126 return 3 ;
127127 }
@@ -139,7 +139,7 @@ const CharacterDisplay: React.FC<CharacterDisplayProps> = ({
139139 }
140140 )
141141 . transition ( )
142- . delay ( ( d , i ) => i * 50 ) // 连续展现动画效果
142+ . delay ( ( _ , i ) => i * 50 ) // 连续展现动画效果
143143 . duration ( 300 )
144144 . style ( 'opacity' , 1 ) ;
145145
0 commit comments