Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 80 additions & 33 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"pure-react-carousel": "^1.30.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.7.1",
"react-multi-carousel": "^2.8.2",
"react-responsive-carousel": "^3.2.23"
},
Expand Down
4 changes: 3 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useState } from "react";
import "./App.css";
import { Maintenance } from "./pages/Maintenance/Maintenance";
import { Navbar } from "./components/Navbar/Navbar";
import { HeaderCarousel } from "./components/HeaderCarousel/HeaderCarousel";

// import Form from "./pages/Form/Form";

Expand All @@ -11,7 +12,8 @@ function App() {
<>
<Navbar/>
<Maintenance/>
{/* <Form /> */}
{/* <Form /> */}
{/* <HeaderCarousel /> */}
</>
);
}
Expand Down
73 changes: 73 additions & 0 deletions src/components/HeaderCarousel/HeaderCarousel.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
.carousel-wrapper {
display: flex;
justify-content: center;
align-items: center;
margin: 2rem 4rem;
}

.carousel {
height: 22rem;
width: 65rem;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}

.carousel-image {
object-fit: cover;
}

.carousel-btn {
background-color: rgba(226, 226, 226, 0.495);
color: rgb(244, 7, 7);
width: 2rem;
height: 2rem;
border-radius: 50%;
align-items: center;
}

.carousel-btn:hover {
background-color: rgb(255, 255, 255);
transition: .3s;
}

.icon {
align-items: center;
margin: 0 auto;
}

.prev {
position: absolute;
left: 0;
top: 50;
}

.next {
position: absolute;
right: 0;
top: 50;
}

@media only screen and (max-width: 500px) {
.carousel-wrapper {
margin: 1rem 2rem;
}

.carousel {
height: 20rem;
width: 50rem;
}
}

@media only screen and (max-width: 768px) {
.carousel-wrapper {
margin: 2rem 2rem;
}

.carousel {
width: 80rem;
}

}
60 changes: 60 additions & 0 deletions src/components/HeaderCarousel/HeaderCarousel.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import React, { useEffect, useState } from "react";
import "./HeaderCarousel.css";

import { FcPrevious } from "react-icons/fc";
import { FcNext } from "react-icons/fc";

import image1 from "../../images/header/image1.jpg";
import image2 from "../../images/header/image2.jpg";
import image3 from "../../images/header/image3.jpg";
import image4 from "../../images/header/image4.jpg";
import image5 from "../../images/header/image5.jpg";

const images = [image1, image2, image3, image4, image5];

export const HeaderCarousel = () => {
const [selectedImage, setSelectedImage] = useState(0);
const [allImages, setAllImages] = useState(images);

useEffect(() => {
const intervalId = setInterval(() => {
setSelectedImage((selectedImage) =>
selectedImage < allImages.length - 1 ? selectedImage + 1 : 0
);
}, 3000);

return () => clearInterval(intervalId);
}, []);

return (
<div className="carousel-wrapper">
<div className="carousel">
<img
className="carousel-image"
src={allImages[selectedImage]}
alt={selectedImage}
/>
<button
className="carousel-btn prev"
onClick={() => {
if (selectedImage > 0) setSelectedImage(selectedImage - 1);
}}
>
<FcPrevious className="icon" />
</button>
<button
className="carousel-btn next"
onClick={() => {
selectedImage < allImages.length - 1
? setSelectedImage(selectedImage + 1)
: setSelectedImage(0);
}}
>
<FcNext className="icon" />
</button>
</div>
</div>
);
};

// export default HeaderCarousel;
6 changes: 3 additions & 3 deletions src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const Navbar = () => {
setIsActive(current => !current);
};


return (
<>
<header>
Expand All @@ -28,10 +28,10 @@ export const Navbar = () => {
<a className='nav-link' href="/">SQUAD</a
></li>
<li className='nav-item'>
<a hre className='nav-link' href="/">GALLERY</a>
<a className='nav-link' href="/">GALLERY</a>
</li>
<li className='nav-item'>
<a hre className='nav-link' href="/">FACULTY</a>
<a className='nav-link' href="/">FACULTY</a>
</li>
<li className='nav-item'>
<a className='nav-link' href="/">APPLY</a>
Expand Down
Binary file added src/images/header/image1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/header/image2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/header/image3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/header/image4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/header/image5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/pages/Form/Form.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from "react";
import Footer from "../../components/Footer/Footer";
import HeaderCarousel from "../../components/HeaderCarousel/HeaderCarousel";
import MailForm from "../../components/MailForm";
import { Navbar } from "../../components/Navbar/Navbar";

function Form() {
return (
<div>
<Navbar />
<HeaderCarousel />
<MailForm />
<Footer/>
</div>
Expand Down