@@ -10,47 +10,29 @@ function BackgroundAnimation() {
10
10
mode === 'light' ? setOpacity ( "20%" ) : setOpacity ( "40%" )
11
11
} , [ mode ] )
12
12
13
+ const generateBoxes = ( ) => {
14
+ return Array . from ( { length : 20 } , ( _ , index ) => (
15
+ < Box
16
+ key = { index }
17
+ component = "span"
18
+ > </ Box >
19
+ ) ) ;
20
+ } ;
21
+
22
+ const generateBoxesWithSx = ( ) => {
23
+ return Array . from ( { length : 19 } , ( _ , index ) => (
24
+ < Box
25
+ key = { index }
26
+ component = "span"
27
+ sx = { { display : { xs : "none" , md : "inline" } } }
28
+ > </ Box >
29
+ ) ) ;
30
+ } ;
31
+
13
32
return (
14
33
< Box sx = { { opacity : opacity } } className = "background" >
15
- < Box component = "span" > </ Box >
16
- < Box component = "span" > </ Box >
17
- < Box component = "span" > </ Box >
18
- < Box component = "span" > </ Box >
19
- < Box component = "span" > </ Box >
20
- < Box component = "span" > </ Box >
21
- < Box component = "span" > </ Box >
22
- < Box component = "span" > </ Box >
23
- < Box component = "span" > </ Box >
24
- < Box component = "span" > </ Box >
25
- < Box component = "span" > </ Box >
26
- < Box component = "span" > </ Box >
27
- < Box component = "span" > </ Box >
28
- < Box component = "span" > </ Box >
29
- < Box component = "span" > </ Box >
30
- < Box component = "span" > </ Box >
31
- < Box component = "span" > </ Box >
32
- < Box component = "span" > </ Box >
33
- < Box component = "span" > </ Box >
34
- < Box component = "span" > </ Box >
35
- < Box component = "span" > </ Box >
36
- < Box component = "span" > </ Box >
37
- < Box component = "span" > </ Box >
38
- < Box component = "span" > </ Box >
39
- < Box component = "span" > </ Box >
40
- < Box component = "span" > </ Box >
41
- < Box component = "span" > </ Box >
42
- < Box component = "span" > </ Box >
43
- < Box component = "span" > </ Box >
44
- < Box component = "span" > </ Box >
45
- < Box component = "span" > </ Box >
46
- < Box component = "span" > </ Box >
47
- < Box component = "span" > </ Box >
48
- < Box component = "span" > </ Box >
49
- < Box component = "span" > </ Box >
50
- < Box component = "span" > </ Box >
51
- < Box component = "span" > </ Box >
52
- < Box component = "span" > </ Box >
53
- < Box component = "span" > </ Box >
34
+ { generateBoxes ( ) }
35
+ { generateBoxesWithSx ( ) }
54
36
</ Box >
55
37
) ;
56
38
}
0 commit comments