Skip to content

Commit df22b93

Browse files
fix: build errors
1 parent fb1becc commit df22b93

File tree

5 files changed

+115
-204
lines changed

5 files changed

+115
-204
lines changed

components/ParticlesFooter.tsx

Lines changed: 100 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -13,125 +13,127 @@ export default function ParticlesFooter() {
1313
const particlesRef = useRef<HTMLDivElement>(null);
1414
const { theme } = useTheme();
1515

16-
useEffect(() => {
17-
const loadParticles = async () => {
18-
// Load particles.js script
19-
if (!window.particlesJS) {
20-
const script = document.createElement("script");
21-
script.src =
22-
"https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js";
23-
script.onload = () => {
24-
initializeParticles();
25-
};
26-
document.head.appendChild(script);
27-
} else {
28-
initializeParticles();
29-
}
30-
};
31-
32-
const initializeParticles = () => {
33-
if (particlesRef.current && window.particlesJS) {
34-
window.particlesJS("particles-footer", {
35-
particles: {
36-
number: {
37-
value: 70,
38-
density: {
39-
enable: true,
40-
value_area: 1400,
41-
},
16+
const initializeParticles = () => {
17+
const particlesElement = particlesRef.current;
18+
if (particlesElement && window.particlesJS) {
19+
window.particlesJS("particles-footer", {
20+
particles: {
21+
number: {
22+
value: 70,
23+
density: {
24+
enable: true,
25+
value_area: 1400,
4226
},
43-
color: {
44-
value: "#3f51b5",
27+
},
28+
color: {
29+
value: "#3f51b5",
30+
},
31+
shape: {
32+
type: "polygon",
33+
stroke: {
34+
width: 1,
35+
color: "#3f51b5",
4536
},
46-
shape: {
47-
type: "polygon",
48-
stroke: {
49-
width: 1,
50-
color: "#3f51b5",
51-
},
52-
polygon: {
53-
nb_sides: 6,
54-
},
37+
polygon: {
38+
nb_sides: 6,
5539
},
56-
opacity: {
57-
value: 1,
58-
random: true,
59-
anim: {
60-
enable: true,
61-
speed: 0.8,
62-
opacity_min: 0.25,
63-
sync: true,
64-
},
40+
},
41+
opacity: {
42+
value: 1,
43+
random: true,
44+
anim: {
45+
enable: true,
46+
speed: 0.8,
47+
opacity_min: 0.25,
48+
sync: true,
6549
},
66-
size: {
67-
value: 2,
68-
random: true,
69-
anim: {
70-
enable: true,
71-
speed: 10,
72-
size_min: 1.25,
73-
sync: true,
74-
},
50+
},
51+
size: {
52+
value: 2,
53+
random: true,
54+
anim: {
55+
enable: true,
56+
speed: 10,
57+
size_min: 1.25,
58+
sync: true,
7559
},
76-
line_linked: {
60+
},
61+
line_linked: {
62+
enable: true,
63+
distance: 150,
64+
color: "#3f51b5",
65+
opacity: 1,
66+
width: 1,
67+
},
68+
move: {
69+
enable: true,
70+
speed: 8,
71+
direction: "none",
72+
random: true,
73+
straight: false,
74+
out_mode: "out",
75+
bounce: true,
76+
attract: {
7777
enable: true,
78-
distance: 150,
79-
color: "#3f51b5",
80-
opacity: 1,
81-
width: 1,
78+
rotateX: 2000,
79+
rotateY: 2000,
80+
},
81+
},
82+
},
83+
interactivity: {
84+
detect_on: "canvas",
85+
events: {
86+
onhover: {
87+
enable: true,
88+
mode: "grab",
8289
},
83-
move: {
90+
onclick: {
8491
enable: true,
85-
speed: 8,
86-
direction: "none",
87-
random: true,
88-
straight: false,
89-
out_mode: "out",
90-
bounce: true,
91-
attract: {
92-
enable: true,
93-
rotateX: 2000,
94-
rotateY: 2000,
95-
},
92+
mode: "repulse",
9693
},
94+
resize: true,
9795
},
98-
interactivity: {
99-
detect_on: "canvas",
100-
events: {
101-
onhover: {
102-
enable: true,
103-
mode: "grab",
104-
},
105-
onclick: {
106-
enable: true,
107-
mode: "repulse",
96+
modes: {
97+
grab: {
98+
distance: 200,
99+
line_linked: {
100+
opacity: 3,
108101
},
109-
resize: true,
110102
},
111-
modes: {
112-
grab: {
113-
distance: 200,
114-
line_linked: {
115-
opacity: 3,
116-
},
117-
},
118-
repulse: {
119-
distance: 250,
120-
duration: 2,
121-
},
103+
repulse: {
104+
distance: 250,
105+
duration: 2,
122106
},
123107
},
124-
retina_detect: true,
125-
});
108+
},
109+
retina_detect: true,
110+
});
111+
}
112+
};
113+
114+
useEffect(() => {
115+
const loadParticles = async () => {
116+
// Load particles.js script
117+
if (!window.particlesJS) {
118+
const script = document.createElement("script");
119+
script.src =
120+
"https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js";
121+
script.onload = () => {
122+
initializeParticles();
123+
};
124+
document.head.appendChild(script);
125+
} else {
126+
initializeParticles();
126127
}
127128
};
128129

129130
loadParticles();
130131

131132
// Cleanup
132133
return () => {
133-
if (particlesRef.current) {
134-
particlesRef.current.innerHTML = "";
134+
const particlesElement = particlesRef.current;
135+
if (particlesElement) {
136+
particlesElement.innerHTML = "";
135137
}
136138
};
137139
}, [theme]);

components/QuizExamForm.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,13 @@ const QuizExamForm: FC<Props> = ({
221221
)}
222222
{selectedImage && (
223223
<div className="fixed top-0 left-0 z-50 w-full h-full flex justify-center items-center bg-black bg-opacity-50">
224-
<img
224+
<Image
225225
src={link + selectedImage.url}
226226
alt={selectedImage.alt}
227227
className="max-w-[90%] max-h-[90%]"
228+
width={800}
229+
height={600}
230+
unoptimized
228231
/>
229232
<button
230233
onClick={() => setSelectedImage(null)}

components/QuizExamFormUF.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,13 @@ const QuizExamForm: FC<Props> = ({
202202
)}
203203
{selectedImage && (
204204
<div className="fixed top-0 left-0 z-50 w-full h-full flex justify-center items-center bg-black bg-opacity-50">
205-
<img
205+
<Image
206206
src={link + selectedImage.url}
207207
alt={selectedImage.alt}
208208
className="max-w-[90%] max-h-[90%]"
209+
width={800}
210+
height={600}
211+
unoptimized
209212
/>
210213
<button
211214
onClick={() => setSelectedImage(null)}

components/QuizForm.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ const QuizForm: FC<Props> = ({
150150
🎉 Practice Complete!
151151
</h2>
152152
<p className="text-gray-600 dark:text-gray-400 text-lg mb-6">
153-
You've completed all {totalQuestions} questions in this practice
154-
session.
153+
You&apos;ve completed all {totalQuestions} questions in this
154+
practice session.
155155
</p>
156156
</div>
157157

@@ -307,10 +307,13 @@ const QuizForm: FC<Props> = ({
307307
onClick={handleClickOutside}
308308
className="fixed top-0 left-0 z-50 w-full h-full flex justify-center items-center bg-black bg-opacity-50"
309309
>
310-
<img
310+
<Image
311311
src={link + selectedImage.url}
312312
alt={selectedImage.alt}
313313
className="max-w-[90%] max-h-[90%]"
314+
width={800}
315+
height={600}
316+
unoptimized
314317
/>
315318
<button
316319
onClick={() => setSelectedImage(null)}

public/sw.js

Lines changed: 1 addition & 101 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)