File tree Expand file tree Collapse file tree 4 files changed +25
-48
lines changed Expand file tree Collapse file tree 4 files changed +25
-48
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ import {
18
18
} from "@caviardeul/utils/caviarding" ;
19
19
20
20
const _WordContainer : React . FC < { word : string } > = ( { word } ) => {
21
- const { settings } = useContext ( SettingsContext ) ;
22
-
23
21
const { revealedWords, isOver, selection } = useContext ( GameContext ) ;
24
22
if ( word === undefined ) {
25
23
return null ;
@@ -35,12 +33,7 @@ const _WordContainer: React.FC<{ word: string }> = ({ word }) => {
35
33
) ;
36
34
} else {
37
35
return (
38
- < span
39
- className = {
40
- "word caviarded" + ( settings . displayWordLength ? " word-length" : "" )
41
- }
42
- data-word-length = { word . length }
43
- >
36
+ < span className = "word caviarded" data-word-length = { word . length } >
44
37
{ "█" . repeat ( word . length ) }
45
38
</ span >
46
39
) ;
Original file line number Diff line number Diff line change @@ -8,16 +8,12 @@ const SettingsModal: React.FC<{ open: boolean; onClose: () => void }> = ({
8
8
onClose,
9
9
} ) => {
10
10
const { settings, onChangeSettings } = useContext ( SettingsContext ) ;
11
- const { lightMode, displayWordLength , autoScroll } = settings ;
11
+ const { lightMode, autoScroll } = settings ;
12
12
13
13
const handleToggleLightMode = useCallback ( ( ) => {
14
14
onChangeSettings ( { lightMode : ! lightMode } ) ;
15
15
} , [ lightMode , onChangeSettings ] ) ;
16
16
17
- const handleToggleDisplayWordLength = useCallback ( ( ) => {
18
- onChangeSettings ( { displayWordLength : ! displayWordLength } ) ;
19
- } , [ displayWordLength , onChangeSettings ] ) ;
20
-
21
17
const handleToggleAutoscroll = useCallback ( ( ) => {
22
18
onChangeSettings ( { autoScroll : ! autoScroll } ) ;
23
19
} , [ autoScroll , onChangeSettings ] ) ;
@@ -39,15 +35,6 @@ const SettingsModal: React.FC<{ open: boolean; onClose: () => void }> = ({
39
35
Activer le mode sombre
40
36
</ label >
41
37
< br />
42
- < label >
43
- < input
44
- type = "checkbox"
45
- checked = { displayWordLength }
46
- onChange = { handleToggleDisplayWordLength }
47
- />
48
- Afficher le nombre de lettres au clic
49
- </ label >
50
- < br />
51
38
< label >
52
39
< input
53
40
type = "checkbox"
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import SaveManagement from "@caviardeul/utils/save";
7
7
8
8
const defaultSettings : Settings = {
9
9
lightMode : false ,
10
- displayWordLength : true ,
11
10
autoScroll : true ,
12
11
} ;
13
12
const getInitialSettings = ( ) : Settings => {
@@ -19,8 +18,6 @@ const getInitialSettings = (): Settings => {
19
18
}
20
19
return {
21
20
lightMode : settings ?. lightMode ?? defaultSettings . lightMode ,
22
- displayWordLength :
23
- settings ?. displayWordLength ?? defaultSettings . displayWordLength ,
24
21
autoScroll : settings ?. autoScroll ?? defaultSettings . autoScroll ,
25
22
} ;
26
23
} ;
Original file line number Diff line number Diff line change @@ -455,7 +455,8 @@ main {
455
455
height : calc (100% - #{$guessInputHeight } );
456
456
}
457
457
458
- h1 , h2 {
458
+ h1 ,
459
+ h2 {
459
460
line-height : normal ;
460
461
}
461
462
@@ -490,28 +491,27 @@ main {
490
491
border-radius : 30px 255px 30px 225px / 30px 225px 30px 250px ;
491
492
}
492
493
493
- & .word-length {
494
- cursor : pointer ;
495
- user-select : none ;
496
- & ::after {
497
- align-items : center ;
498
- content : attr (data-word-length );
499
- color : var (--color-background );
500
- display : flex ;
501
- height : 100% ;
502
- left : 0 ;
503
- justify-content : center ;
504
- opacity : 0 ;
505
- position : absolute ;
506
- top : 0 ;
507
- transition : opacity 0.2s ease-in-out ;
508
- width : 100% ;
509
- }
510
- & :active ::after ,
511
- & :focus ::after ,
512
- & :focus-within ::after {
513
- opacity : 1 ;
514
- }
494
+ // word length indicator
495
+ cursor : pointer ;
496
+ user-select : none ;
497
+ & ::after {
498
+ align-items : center ;
499
+ content : attr (data-word-length );
500
+ color : var (--color-background );
501
+ display : flex ;
502
+ height : 100% ;
503
+ left : 0 ;
504
+ justify-content : center ;
505
+ opacity : 0 ;
506
+ position : absolute ;
507
+ top : 0 ;
508
+ transition : opacity 0.2s ease-in-out ;
509
+ width : 100% ;
510
+ }
511
+ & :active ::after ,
512
+ & :focus ::after ,
513
+ & :focus-within ::after {
514
+ opacity : 1 ;
515
515
}
516
516
}
517
517
}
You can’t perform that action at this time.
0 commit comments