Skip to content

Commit

Permalink
feat(assets): update hero section images and components (#48)
Browse files Browse the repository at this point in the history
* feat(assets): update hero section images and components
- Added new image: all-excom.jpg
- Removed outdated image: duothan4.2.jpg
- Updated hero-section.tsx to reflect new content
- Modified vm-section.tsx for improved content structure

* feat: update carousel to fit viewport size on hero section

- Modified page.tsx and hero-section.tsx to make carousel dynamically adjust to the viewport size.
- Ensured images are responsive and fill available space with object-cover.
  • Loading branch information
nethmalds authored Nov 7, 2024
1 parent a295a80 commit 34e691d
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BranchCounsellors from "@/components/index/branch-counsellors";
import EventCard from "@/components/index/event-card";
import ExecutiveCommittee from "@/components/index/executive-committee";
import Fellowship from "@/components/index/fellowship";
import { HeroCarousel } from "@/components/index/hero-section";
import HeroCarousel from "@/components/index/hero-section";
import VisionMissionSection from "@/components/index/vm-section";

export default function Home() {
Expand Down
Binary file added src/assets/hero-images/all-excom.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 removed src/assets/hero-images/duothan4.2.jpg
Binary file not shown.
99 changes: 62 additions & 37 deletions src/components/index/hero-section.tsx
Original file line number Diff line number Diff line change
@@ -1,53 +1,78 @@
"use client";
import placeholder from "@/assets/placeholder.png";
import Autoplay from "embla-carousel-autoplay";
import Image from "next/image";
import * as React from "react";

import allexcom from "@/assets/hero-images/all-excom.jpg";
import duothanImg from "@/assets/hero-images/duothan4.0.jpg";
import duothanImg2 from "@/assets/hero-images/duothan4.1.jpg";
import duothanImg4 from "@/assets/hero-images/duothan4.3.jpg";
import skillshare from "@/assets/hero-images/skill-share.jpg";
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/ui/carousel";
import Autoplay from "embla-carousel-autoplay";
import Image from "next/image";
import * as React from "react";

export function HeroCarousel() {
const images = [
placeholder,
placeholder,
placeholder,
placeholder,
placeholder,
export default function HeroCarousel() {
const cimages = [
{
image: duothanImg,
text: "Discover a community where ideas meet innovation, and creativity knows no limits Where technology.",
},
{
image: duothanImg2,
text: "Empowering students to shape the future, one project at a time A place for curious minds and bold thinkers to connect and create.",
},
{
image: allexcom,
text: "Pushing boundaries, embracing challenges, and building a brighter future together. Innovation starts here, where students turn vision into reality.",
},
{
image: duothanImg4,
text: "Explore, create, and lead with a community that shares your drive Where every challenge is an opportunity to grow and inspire.",
},
{
image: skillshare,
text: "Building skills, making connections, and transforming ideas into action Redefining innovation through teamwork, passion, and dedication.",
},
];

const plugin = React.useRef(
Autoplay({ delay: 2000, stopOnInteraction: true }),
);

return (
<Carousel
plugins={[plugin.current]}
className="container mx-auto w-full"
onMouseEnter={plugin.current.stop}
onMouseLeave={plugin.current.reset}
>
<CarouselContent>
{images.map((image, index) => (
<CarouselItem key={index}>
<div className="aspect-video">
<Image
src={image}
alt={`carousel image ${index + 1}`}
width={1600}
height={900}
/>
</div>
</CarouselItem>
))}
</CarouselContent>
<CarouselPrevious />
<CarouselNext />
</Carousel>
<>
<Carousel plugins={[plugin.current]} className="w-full">
<CarouselContent>
{cimages.map((item, index) => (
<CarouselItem key={index} className="relative">
<div className="w-full xl:h-[85vh]">
<Image
src={item.image}
alt={`carousel image ${index + 1}`}
height={1080}
width={1920}
className="object-cover object-center aspect-video"
/>
<div className="absolute bottom-0 w-full h-[170px] bg-gradient-to-t from-primaryLight via-primaryLight">
<p className="absolute left-2 xl:left-10 bottom-0 text-xs xl:text-base text-white">
{item.text}
</p>
</div>
</div>
</CarouselItem>
))}
</CarouselContent>
<div>
<h1 className="absolute left-3 xl:left-10 xl:bottom-8 bottom-10 font-semibold text-white xl:text-3xl text-base">
Welcome to IEEE Student Branch of NSBM
</h1>
</div>
{/* <CarouselPrevious />
<CarouselNext /> */}
</Carousel>
<div className="bg-gradient-to-b mt-[-2px] from-primaryLight from-50% h-[50px]" />
</>
);
}
17 changes: 7 additions & 10 deletions src/components/index/vm-section.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
import Image from "next/image";
import React from "react";

import IeeeCsColorBlackImage from "@/assets/ieee-cs-colored-black.png";
import IeeeSbLogoImage from "@/assets/ieee-sb-new-colored.png";
import WieLogoImage from "@/assets/wie-colored.png";
import {
Card,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";

import Image from "next/image";
import React from "react";
import { FaEye } from "react-icons/fa";
import { TbTargetArrow } from "react-icons/tb";

import IeeeCsColorBlackImage from "@/assets/ieee-cs-colored-black.png";
import IeeeSbLogoImage from "@/assets/ieee-sb-new-colored.png";
import WieLogoImage from "@/assets/wie-colored.png";

const VisionMissionSection = () => {
return (
<div className="container mx-auto max-w-[1170px] flex flex-col justify-center items-center">
<div className="container mx-auto max-w-[1170px] flex flex-col mt-10 justify-center items-center">
<div className="max-w-[300px] sm:max-w-[900px] flex flex-col p-5 sm:flex-row justify-center gap-5 ">
<Card className="shadow-lg flex-1 bg-stone-100 border-none">
<CardHeader>
Expand Down Expand Up @@ -66,7 +63,7 @@ const VisionMissionSection = () => {
<Image src={WieLogoImage} alt="WIELogo" />
</div>

<div className="flex-1 w-1/3">
<div className="flex-1 w-4/5 sm:w-1/3">
<Image src={IeeeCsColorBlackImage} alt="IEEE CS Logo" />
</div>
</div>
Expand Down

0 comments on commit 34e691d

Please sign in to comment.