diff --git a/frontend/components/Carousel.jsx b/frontend/components/Carousel.jsx index 264e3bd..df387c2 100644 --- a/frontend/components/Carousel.jsx +++ b/frontend/components/Carousel.jsx @@ -63,15 +63,65 @@ // }; // export default Carousel; -import React, { useState, useEffect, useRef } from 'react'; -import './style/carousel2.css'; +import React, { useState, useEffect, useRef } from "react"; +import "./style/carousel2.css"; +import sunImg from "../public/image/sun-light.png"; +import moonImg from "../public/image/moon-light.png"; const Carousel = () => { + // toggle button + const [theme, setTheme] = useState("light"); + + const toggleTheme = (newTheme) => { + setTheme(newTheme); + + if (newTheme === "dark") { + document.documentElement.classList.add("dark"); + } else { + document.documentElement.classList.remove("dark"); + } + }; + + useEffect(() => { + // Set theme based on system preference + const prefersDark = window.matchMedia( + "(prefers-color-scheme: dark)" + ).matches; + if (prefersDark) { + setTheme("dark"); + document.documentElement.classList.add("dark"); + } + }, []); + const [carouselItems, setCarouselItems] = useState([ - { id: 1, image: '../image/event.JPG', author: '', title: 'devXsphere gaianet', topic: 'meetup' }, - { id: 2, image: '../image/event 2.JPG', author: 'Author 2', title: 'Title 2', topic: 'Topic 2' }, - { id: 3, image: '../image/event 3.JPG', author: 'Author 3', title: 'Title 3', topic: 'Topic 3' }, - { id: 4, image: '../image/event4.jpg', author: 'Author 4', title: 'Title 4', topic: 'Topic 4' } + { + id: 1, + image: "../image/event.JPG", + author: "", + title: "devXsphere gaianet", + topic: "meetup", + }, + { + id: 2, + image: "../image/event 2.JPG", + author: "Author 2", + title: "Title 2", + topic: "Topic 2", + }, + { + id: 3, + image: "../image/event 3.JPG", + author: "Author 3", + title: "Title 3", + topic: "Topic 3", + }, + { + id: 4, + image: "../image/event4.jpg", + author: "Author 4", + title: "Title 4", + topic: "Topic 4", + }, ]); const timeRunning = 1000; @@ -82,57 +132,83 @@ const Carousel = () => { useEffect(() => { const runNextAuto = setTimeout(() => { - showSlider('next'); + showSlider("next"); }, timeAutoNext); return () => clearTimeout(runNextAuto); }, [carouselItems]); const showSlider = (type) => { - if (type === 'next') { + if (type === "next") { setCarouselItems((prevItems) => [...prevItems.slice(1), prevItems[0]]); - carouselRef.current.classList.add('next'); + carouselRef.current.classList.add("next"); } else { - setCarouselItems((prevItems) => [prevItems[prevItems.length - 1], ...prevItems.slice(0, -1)]); - carouselRef.current.classList.add('prev'); + setCarouselItems((prevItems) => [ + prevItems[prevItems.length - 1], + ...prevItems.slice(0, -1), + ]); + carouselRef.current.classList.add("prev"); } clearTimeout(timeRef.current); timeRef.current = setTimeout(() => { - carouselRef.current.classList.remove('next'); - carouselRef.current.classList.remove('prev'); + carouselRef.current.classList.remove("next"); + carouselRef.current.classList.remove("prev"); }, timeRunning); }; return ( -
- {/* Title Section */} -
-

- devXsphere - -

-
- - {/* Carousel Section */} -
-
- {carouselItems.map((item, index) => ( -
- {`Carousel -
-
{item.author}
-
{item.title}
-
{item.topic}
-
-
- ))} +
+
+
+ {theme === "light" ? ( + Switch to Dark Mode toggleTheme("dark")} + className="w-12 h-12 cursor-pointer bg-none" + /> + ) : ( + Switch to Light Mode toggleTheme("light")} + className="w-12 h-12 cursor-pointer" + /> + )} +
+ {/* Title Section */} +
+

+ devXsphere + +

- {/* Carousel Controls */} -
- - + {/* Carousel Section */} +
+
+ {carouselItems.map((item, index) => ( +
+ {`Carousel +
+
{item.author}
+
{item.title}
+
{item.topic}
+
+
+ ))} +
+ + {/* Carousel Controls */} +
+ + +
diff --git a/frontend/components/Events.jsx b/frontend/components/Events.jsx index 9598511..ff0a6b6 100644 --- a/frontend/components/Events.jsx +++ b/frontend/components/Events.jsx @@ -18,10 +18,10 @@ const Events = () => {
Upcoming
-
+
Intro to React.js: Building Modern Web Apps
-
+
June 15, 2023 6:30 PM - 8:30 PM
@@ -39,10 +39,10 @@ const Events = () => {
Upcoming
-
+
Advanced React.js Workshop: State Management & Performance
-
+
July 10, 2023 5:00 PM - 7:00 PM
diff --git a/frontend/components/Footer.jsx b/frontend/components/Footer.jsx index 7e0fc1e..d3f4004 100644 --- a/frontend/components/Footer.jsx +++ b/frontend/components/Footer.jsx @@ -3,7 +3,7 @@ import { IconBrandLinkedin, IconBrandFacebook, IconBrandX, IconBrandInstagram, I export default function Footer() { return ( -
+
{/* Social Media Section */} @@ -12,32 +12,32 @@ export default function Footer() { {/* LinkedIn */} - + {/* Facebook */} - + {/* X (Twitter) */} - + {/* Instagram */} - + {/* Mastodon */} - + {/* Zulip */} - +
@@ -48,7 +48,7 @@ export default function Footer() { {/* Copyright Section */}
-

Copyright © 2024 devxsphere

+

Copyright © 2024 devxsphere

diff --git a/frontend/components/TeamSection.jsx b/frontend/components/TeamSection.jsx index 48ffe69..d0ee0bb 100644 --- a/frontend/components/TeamSection.jsx +++ b/frontend/components/TeamSection.jsx @@ -10,10 +10,10 @@ export default function TeamSection() {
-

{/* Text color to white */} +

{/* Text color to white */} Meet the Team

-

{/* Text color to light gray */} +

{/* Text color to light gray */} With over 100 years of combined experience, we've got a well-seasoned team at the helm.

@@ -29,19 +29,20 @@ export default function TeamSection() { 1024: { slidesPerView: 3 }, // 3 slides on large screens }} pagination={{ clickable: true }} + className="h-[30rem]" > {/* Team member 1 */} -
+
Team Member
-

{/* Text color to white */} +

{/* Text color to white */} Utkarsh Upadhyay

{/* Text color to light gray */} @@ -62,8 +63,8 @@ export default function TeamSection() {
- -
+ +
-

Saurabh Upadhyay

+

Saurabh Upadhyay

Founder & outreach
@@ -91,7 +92,7 @@ export default function TeamSection() { {/* Team member 2 */} -
+
-

Abhishek Sharma

+

Abhishek Sharma

Web lead
@@ -119,7 +120,7 @@ export default function TeamSection() { {/* Additional team members can be added here */} -
+
-

Aakash Mahajan

+

Aakash Mahajan

Web dev contributer
@@ -146,7 +147,7 @@ export default function TeamSection() { -
+
-

Rajveer Singh

+

Rajveer Singh

Community advocate
@@ -173,7 +174,7 @@ export default function TeamSection() { -
+
-

Ashika Gupta

+

Ashika Gupta

UI/UX team
- -
+ +
-

Kusum Kharayat

+

Kusum Kharayat

Community advocate
@@ -227,7 +228,7 @@ export default function TeamSection() { -
+
-

Yashdeep Singh

+

Yashdeep Singh

Social media
@@ -254,7 +255,7 @@ export default function TeamSection() { -
+
-

Vanshika Goel

+

Vanshika Goel

PR and social media
diff --git a/frontend/components/Testimonials.jsx b/frontend/components/Testimonials.jsx index 33a2429..3a16015 100644 --- a/frontend/components/Testimonials.jsx +++ b/frontend/components/Testimonials.jsx @@ -24,8 +24,8 @@ export default function Testimonials() { className="w-16 h-16 rounded-full mb-4" alt="User" /> -
Maria Smantha
-
Web Developer
+
Maria Smantha
+
Web Developer

"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quod eos id officiis hic tenetur quae quaerat ad velit ab hic."

@@ -40,8 +40,8 @@ export default function Testimonials() { className="w-16 h-16 rounded-full mb-4" alt="User" /> -
Lisa Cudrow
-
Graphic Designer
+
Lisa Cudrow
+
Graphic Designer

"Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid commodi."

@@ -56,8 +56,8 @@ export default function Testimonials() { className="w-16 h-16 rounded-full mb-4" alt="User" /> -
John Smith
-
Marketing Specialist
+
John Smith
+
Marketing Specialist

"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti."

@@ -72,8 +72,8 @@ export default function Testimonials() { className="w-16 h-16 rounded-full mb-4" alt="User" /> -
Anna Lee
-
Project Manager
+
Anna Lee
+
Project Manager

"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."

diff --git a/frontend/components/style/carousel.css b/frontend/components/style/carousel.css index fc281a4..4066a5e 100644 --- a/frontend/components/style/carousel.css +++ b/frontend/components/style/carousel.css @@ -7,7 +7,7 @@ body { margin: 0; - background-color: #000; + /* background-color: #000; */ color: #eee; font-family: Poppins; font-size: 12px; diff --git a/frontend/components/style/carousel2.css b/frontend/components/style/carousel2.css index e742be7..1d2cf63 100644 --- a/frontend/components/style/carousel2.css +++ b/frontend/components/style/carousel2.css @@ -1,10 +1,18 @@ /* carousel.css */ + .carousel-container { display: flex; flex-direction: column; align-items: center; - margin-top: 80px; /* Pushes the carousel down a bit */ + padding-top: 80px; /* Pushes the carousel down a bit */ + } + .toggle{ + position: absolute; + display: block; + color: white; + right: 20px; + top: 50px; } .title-container { @@ -16,7 +24,7 @@ font-family: 'Poppins', sans-serif; /* A clean font, feel free to use another */ font-size: 3rem; font-weight: bold; - color: white; + /* color: white; */ display: inline-flex; align-items: center; } diff --git a/frontend/public/image/moon-light.png b/frontend/public/image/moon-light.png new file mode 100644 index 0000000..cd80633 Binary files /dev/null and b/frontend/public/image/moon-light.png differ diff --git a/frontend/public/image/sun-light.png b/frontend/public/image/sun-light.png new file mode 100644 index 0000000..ab64dea Binary files /dev/null and b/frontend/public/image/sun-light.png differ diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 7ac1e89..cf3f78e 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -10,7 +10,7 @@ import Carousel from "../components/Carousel"; export default function App() { return ( -
+
{/*
*/} diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index 8442c18..e45a495 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -1,12 +1,14 @@ /** @type {import('tailwindcss').Config} */ export default { content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}','./components/**/*.{js,jsx}'], + darkMode: 'class', theme: { extend: { fontFamily: { generalsans: ['General Sans', 'sans-serif'], }, colors: { + darkBackground: '#010103', black: { DEFAULT: '#000', 100: '#010103',