Skip to content

Commit ec21436

Browse files
committed
update: BackgroundAnimation simplification
1 parent 0eee048 commit ec21436

File tree

2 files changed

+23
-40
lines changed

2 files changed

+23
-40
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ NeuraChatAi is an AI-powered chat application that offers customizable chat expe
2222
* OpenAI API 4.24.7
2323
* Joy UI
2424
* React Router
25-
* Lodash
2625
* Material Icons
26+
* Lodash
2727
* Day.js
2828
* Sass
2929
* JS
@@ -47,4 +47,5 @@ Once the application is running, you can:
4747
- Receive AI-generated responses based on your inputs.
4848
- Explore tip suggestions for conversation starters.
4949

50+
5051
Feel free to reach out if you have any questions, feedback, or suggestions. Happy chatting with NeuraChatAi!

src/components/BackgroundAnimation.jsx

+21-39
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,29 @@ function BackgroundAnimation() {
1010
mode === 'light' ? setOpacity("20%") : setOpacity("40%")
1111
},[mode])
1212

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+
1332
return (
1433
<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()}
5436
</Box>
5537
);
5638
}

0 commit comments

Comments
 (0)