Spaces:
Sleeping
Sleeping
Delete Swipercomponent.js
Browse files- Swipercomponent.js +0 -65
Swipercomponent.js
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
import React, { useState } from "react";
|
2 |
-
import { Swiper, SwiperSlide } from "swiper/react";
|
3 |
-
import "swiper/css";
|
4 |
-
import "swiper/css/effect-coverflow";
|
5 |
-
import "swiper/css/pagination";
|
6 |
-
import { EffectCoverflow, Pagination } from "swiper/modules";
|
7 |
-
import "./Swipercomponent.css"; // Ensure you create a corresponding CSS file
|
8 |
-
|
9 |
-
const avatars = [
|
10 |
-
{ name: "Rat", image: "images/rat.png", description: "Clever and resourceful. Loves puzzles and word games.", sample: "Let's solve a riddle together!" },
|
11 |
-
{ name: "Ox", image: "images/ox.png", description: "Strong and dependable. Very patient when explaining concepts.", sample: "I will guide you step by step." },
|
12 |
-
{ name: "Tiger", image: "images/tiger.png", description: "Brave and energetic. Loves exciting challenges.", sample: "Let's make learning an adventure!" },
|
13 |
-
{ name: "Rabbit", image: "images/rabbit.png", description: "Gentle and kind. Encourages learning through storytelling.", sample: "I have a story to share with you!" },
|
14 |
-
{ name: "Dragon", image: "images/dragon.png", description: "Confident and intelligent. Explains ideas clearly.", sample: "I will help you think like a scholar!" },
|
15 |
-
{ name: "Snake", image: "images/snake.png", description: "Calm and analytical. Gives insightful explanations.", sample: "Let's break this down logically!" },
|
16 |
-
{ name: "Horse", image: "images/horse.png", description: "Cheerful and enthusiastic. Encourages active participation.", sample: "Come on, let's say it together!" },
|
17 |
-
{ name: "Goat", image: "images/sheep.png", description: "Creative and friendly. Uses fun examples.", sample: "Let's use pictures to understand this!" },
|
18 |
-
{ name: "Monkey", image: "images/monkey.png", description: "Smart and playful. Makes learning fun.", sample: "I love word games! Do you?" },
|
19 |
-
{ name: "Rooster", image: "images/rooster.png", description: "Confident and vocal. Encourages clear pronunciation.", sample: "Let's practice speaking clearly!" },
|
20 |
-
{ name: "Dog", image: "images/dog.png", description: "Loyal and encouraging. Builds confidence in learners.", sample: "You're doing a great job!" },
|
21 |
-
{ name: "Pig", image: "images/pig.png", description: "Easygoing and kind. Makes learning feel natural.", sample: "Let's take it step by step together!" }
|
22 |
-
];
|
23 |
-
|
24 |
-
function SwiperComponent({ onSelectAvatar }) {
|
25 |
-
const [selected, setSelected] = useState(avatars[0]); // Default to the first avatar
|
26 |
-
|
27 |
-
const handleSelect = (avatar) => {
|
28 |
-
setSelected(avatar);
|
29 |
-
onSelectAvatar(avatar);
|
30 |
-
};
|
31 |
-
|
32 |
-
return (
|
33 |
-
<div className="swiper-container">
|
34 |
-
<Swiper
|
35 |
-
effect={"coverflow"}
|
36 |
-
grabCursor={true}
|
37 |
-
centeredSlides={true}
|
38 |
-
slidesPerView={"auto"}
|
39 |
-
coverflowEffect={{
|
40 |
-
rotate: 0,
|
41 |
-
stretch: 0,
|
42 |
-
depth: 100,
|
43 |
-
modifier: 2.5,
|
44 |
-
slideShadows: false,
|
45 |
-
}}
|
46 |
-
pagination={true}
|
47 |
-
modules={[EffectCoverflow, Pagination]}
|
48 |
-
className="swiper"
|
49 |
-
>
|
50 |
-
{avatars.map((avatar, index) => (
|
51 |
-
<SwiperSlide key={index} onClick={() => handleSelect(avatar)}>
|
52 |
-
<img src={avatar.image} alt={avatar.name} className="avatar-image" />
|
53 |
-
<div className="avatar-info">
|
54 |
-
<h3>{avatar.name}</h3>
|
55 |
-
<p>{avatar.description}</p>
|
56 |
-
<em>"{avatar.sample}"</em>
|
57 |
-
</div>
|
58 |
-
</SwiperSlide>
|
59 |
-
))}
|
60 |
-
</Swiper>
|
61 |
-
</div>
|
62 |
-
);
|
63 |
-
}
|
64 |
-
|
65 |
-
export default SwiperComponent;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|