Step-by-step
//
const courseContentData= {
nail: {
"Right-Time-section": [
{ selector: ".section-headding-1 h1", value: "Hello, Nail Enthusiast!" },
{ selector: ".section-headding-1 h2", value: "Welcome to the Nail Course" },
{ selector: ".right-time-section", value: "Master the art of nails." },
{ selector: ".enjoy", value: "Explore creative nail designs and techniques." },
{ selector: ".free", value: "Start your journey today for free!" },
{ selector: ".meet", value: "Meet Your Nail Experts" },
{ selector: ".intro", action: "changeVideo(this, './videos/nail-intro.mp4')" },
{ selector: ".facility", action: "changeVideo(this, './videos/nail-facility.mp4')" },
{ selector: ".CPBA", action: "changeVideo(this, './videos/nail-cpba.mp4')" }
],
"Correspondence-course": [
{ selector: ".cpba-correspondence", value: "Meet Your Nail Tutor" },
{ selector: "#maintutorVideoSource", attribute: "src", value: "./videos/nail-tutor.mp4" }
],
"Tutor-Slider": [
{
name: "Elvy",
role: "Manager",
image: "https://www.cpba.co.uk/wp-content/uploads/2025/01/Elvy-image.png",
video: "./videos/nail-tutor-elvy.mp4"
},
{
name: "Tania",
role: "Relationship Manager",
image: "https://www.cpba.co.uk/wp-content/uploads/2025/01/Tania-image.png",
video: "./videos/nail-tutor-tania.mp4"
},
{
name: "Catherine",
role: "PA of Director",
image: "https://www.cpba.co.uk/wp-content/uploads/2025/01/Catherine-image.png",
video: "./videos/nail-tutor-catherine.mp4"
},
{
name: "Mark",
role: "Senior Instructor",
image: "https://www.cpba.co.uk/wp-content/uploads/2025/01/Mark-image.png",
video: "./videos/nail-tutor-mark.mp4"
},
{
name: "Lucy",
role: "Course Coordinator",
image: "https://www.cpba.co.uk/wp-content/uploads/2025/01/Lucy-image.png",
video: "./videos/nail-tutor-lucy.mp4"
}
]
},
makeup: {
"Right-Time-section": [
{ selector: ".section-headding-1 h1", value: "Hello, Makeup Artist!" },
{ selector: ".section-headding-1 h2", value: "Welcome to the Makeup Course" },
{ selector: ".right-time-section", value: "Learn professional makeup skills." },
{ selector: ".enjoy", value: "Transform your creativity into a career." },
{ selector: ".free", value: "Join us today for free!" },
{ selector: ".meet", value: "Meet Your Makeup Instructor" },
{ selector: ".intro", action: "changeVideo(this, './videos/makeup-intro.mp4')" },
{ selector: ".facility", action: "changeVideo(this, './videos/makeup-facility.mp4')" },
{ selector: ".CPBA", action: "changeVideo(this, './videos/makeup-cpba.mp4')" }
],
"Correspondence-course": [
{ selector: ".cpba-correspondence", value: "Meet Your Makeup Tutor" },
{ selector: "#maintutorVideoSource", attribute: "src", value: "./videos/makeup-tutor.mp4" }
],
"Tutor-Slider": [
{
name: "Elvy",
role: "Manager",
image: "https://www.cpba.co.uk/wp-content/uploads/2025/01/Elvy-image.png",
video: "./videos/makeup-tutor-elvy.mp4"
},
{
name: "Tania",
role: "Relationship Manager",
image: "https://www.cpba.co.uk/wp-content/uploads/2025/01/Tania-image.png",
video: "./videos/makeup-tutor-tania.mp4"
}
]
}
};
let currentIndex = Math.floor(cards.length / 2); // Start with the middle card
let offset = -(currentIndex * 100 / 3); // Adjust offset for centering
updateActiveCard(); // Initialize
//