New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Board Member card with swiperjs #71
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* eslint-disable */ | ||
import { useState, useEffect } from "react"; | ||
|
||
export default function useWindowDimensions() { | ||
const hasWindow = typeof window !== "undefined"; | ||
|
||
function getWindowDimensions() { | ||
const width = hasWindow ? window.innerWidth : null; | ||
const height = hasWindow ? window.innerHeight : null; | ||
return { | ||
width, | ||
height, | ||
}; | ||
} | ||
|
||
const [windowDimensions, setWindowDimensions] = useState( | ||
getWindowDimensions() | ||
); | ||
|
||
useEffect(() => { | ||
if (hasWindow) { | ||
function handleResize() { | ||
setWindowDimensions(getWindowDimensions()); | ||
} | ||
|
||
window.addEventListener("resize", handleResize); | ||
return () => window.removeEventListener("resize", handleResize); | ||
} | ||
}, [hasWindow]); | ||
|
||
return windowDimensions; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Image from "next/future/image"; | ||
|
||
/* eslint-disable */ | ||
const Boardmembercard = ({ givenName, img, role, color }) => { | ||
return ( | ||
<div className="bg-white opacity-100 z-50 h-[20rem] w-[15rem] rounded-3xl shadow-lg m-4 flex flex-col justify-center items-center"> | ||
<Image | ||
src={img} | ||
className="p-6 rounded-full" | ||
alt="" | ||
width={400} | ||
height={400} | ||
/> | ||
<div className="flex flex-col items-center justify-center p-4 pt-0 mb-5 space-x-2"> | ||
<p className="font-bold text-lg">{givenName}</p> | ||
<p style={{ color: color }} className={`text-xl text-center`}> | ||
{role} | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Boardmembercard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* eslint-disable */ | ||
import { Swiper, SwiperSlide } from "swiper/react"; | ||
import "swiper/css"; | ||
import "swiper/css/navigation"; | ||
import { Navigation } from "swiper"; | ||
import Boardmembercard from "./Boardmembercard"; | ||
import useWindowDimensions from "../Hooks/useWindowDimension"; | ||
import data from "../data/Boardmember.json"; | ||
import Link from "next/link"; | ||
|
||
const Boardmembers = () => { | ||
const { width } = useWindowDimensions(); | ||
|
||
return ( | ||
<div className="font-productSans h-full relative w-full flex flex-col space-y-10 mt-10 mb-5"> | ||
<div className="flex flex-col justify-center items-center space-y-6 text-gray-700 z-10"> | ||
<h1 className="text-center text-6xl font-bold">The Board</h1> | ||
<p className="text-center text-xl">2022-23</p> | ||
<p className="text-xl z-50 text-gray-500 text-center max-w-xl md:max-w-2xl"> | ||
Our Team comprised of g-fuel drinking developers, aesthetic obsessed | ||
desginers and managers that love nothing but perfection | ||
</p> | ||
<div className="bg-urbanFinishing scale-y-[-1] md:h-[40rem] bg-cover h-[26rem] w-full absolute opacity-30 translate-y-[23rem] -z-50"> | ||
{/* <img src={`/Icons/urban-finishing-tape-1.png`} className="opacity-20 absolute rotate-[25deg] translate-y-80 -z-50" alt="" /> */} | ||
</div> | ||
</div> | ||
<div className="md:m-24 md:ml-44 md:mr-44 ml-2 mr-2 z-50"> | ||
{/* Card */} | ||
<Swiper | ||
slidesPerView={width < 1267 ? 1 : 3} | ||
spaceBetween={2} | ||
navigation={true} | ||
mousewheel={true} | ||
modules={[Navigation]} | ||
className="mySwiper" | ||
> | ||
{data.map(({ name, image, description, role, color }) => { | ||
return ( | ||
<SwiperSlide className="" key={name}> | ||
<Boardmembercard | ||
givenName={name} | ||
img={image} | ||
desc={description} | ||
role={role} | ||
color={color} | ||
/> | ||
</SwiperSlide> | ||
); | ||
})} | ||
</Swiper> | ||
|
||
{/* Card */} | ||
</div> | ||
<div | ||
className="flex justify-center items-center w-full animate-bounce bg-transparent z-50" | ||
style={{ marginTop: "3rem" }} | ||
> | ||
<Link href={`/`}> | ||
<img | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
src={`/Icons/down-arrow.png`} | ||
className="w-10 h-10 cursor-pointer" | ||
alt="" | ||
/> | ||
Comment on lines
+59
to
+63
Check warning Code scanning / ESLint Prevent usage of `<img>` element to prevent layout shift.
Do not use `<img>` element. Use `<Image />` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element
|
||
</Link> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Boardmembers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Image from "next/future/image"; | ||
import Link from "next/link"; | ||
|
||
const Eventcard = ({ eventname, date, img, link, type }) => { | ||
return ( | ||
<div | ||
className="w-full md:w-full h-full flex rounded-2xl p-4 items-center justify-center space-x-4 border-2 border-gray-200" | ||
style={{ boxShadow: "0px 4px 2px gray" }} | ||
> | ||
<Image width={100} height={200} src={`/Icons/${img}`} alt="" /> | ||
<div className="flex flex-col space-y-2 justify-start items-start"> | ||
<h1 className="font-bold text-gray-700"> | ||
{eventname.length > 15 ? eventname.slice(0, 17) + "..." : eventname} | ||
</h1> | ||
<p className="text-gray-500 text-sm">{date}</p> | ||
{type == "past" ? ( | ||
<Link href={link}> | ||
<button className="rounded-3xl bg-gray-500 hover:bg-gray-700 text-white font-bold py-2 px-4 w-full text-sm"> | ||
Conducted | ||
</button> | ||
</Link> | ||
) : ( | ||
<Link href={link}> | ||
<button className="rounded-3xl bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 w-full text-sm"> | ||
Learn More | ||
</button> | ||
</Link> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Eventcard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import Link from "next/link"; | ||
import events from "../data/events.json"; | ||
import Eventcard from "./Eventcard"; | ||
import "swiper/css"; | ||
import "swiper/css/navigation"; | ||
import Image from "next/future/image"; | ||
|
||
const Events = () => { | ||
return ( | ||
<> | ||
<div | ||
className="font-productSans h-full relative w-full flex flex-col space-y-10 mt-10 mb-5" | ||
id="events" | ||
> | ||
<Image | ||
width={100} | ||
height={100} | ||
src={`/Icons/kingdom-72.png`} | ||
className="opacity-20 absolute top-[13rem] right-[3rem] md:right-8 h-[30rem] w-[30rem] md:-translate-y-[10rem] -translate-y-[23rem] rotate-[-40deg] md:rotate-[-10deg] md:h-[30rem] md:w-[23rem]" | ||
alt="" | ||
/> | ||
<div className="flex flex-col justify-center items-center ml-7 mr-0 space-y-6 text-gray-600"> | ||
<h1 className="text-center text-6xl font-bold">Events</h1> | ||
</div> | ||
<p className="font-semibold text-2xl text-left ml-5 md:ml-44 text-gray-500"> | ||
New Event | ||
</p> | ||
<div | ||
className={`md:m-24 md:ml-44 md:mr-44 ml-5 mr-5 grid grid-cols-2 md:grid-cols-3 gap-6`} | ||
> | ||
{/* Card */} | ||
{events.map(({ name, date, link, type, img }) => { | ||
return type == "new" ? ( | ||
<div className="" key={name}> | ||
<Eventcard | ||
eventname={name} | ||
date={date} | ||
link={link} | ||
type={type} | ||
img={img} | ||
/> | ||
</div> | ||
) : null; | ||
})} | ||
{/* Card */} | ||
</div> | ||
<p className="w-screen font-semibold text-2xl ml-5 md:ml-44 text-left text-gray-500"> | ||
Past Event | ||
</p> | ||
<div | ||
className={`md:m-24 md:ml-44 md:mr-44 ml-5 mr-5 grid grid-cols-2 md:grid-cols-3 gap-6`} | ||
> | ||
{/* Card */} | ||
{events.map(({ name, date, link, type, img }) => { | ||
return type == "past" ? ( | ||
<div className="" key={name}> | ||
<Eventcard | ||
eventname={name} | ||
date={date} | ||
link={link} | ||
type={type} | ||
img={img} | ||
/> | ||
</div> | ||
) : null; | ||
})} | ||
|
||
{/* Card */} | ||
</div> | ||
<div className="flex justify-center items-center w-full animate-bounce"> | ||
<Link href={`/`}> | ||
<img | ||
src={`/Icons/down-arrow.png`} | ||
className="w-10 h-10 cursor-pointer" | ||
alt="" | ||
/> | ||
|
||
</Link> | ||
</div> | ||
{/* | ||
bg-[#adc7f0c3] p-2 font-bold text-[#4285F4] rounded w-[88%] flex justify-center items-center | ||
bg-[#acecc6] p-2 font-bold text-[#0f9d58d4] rounded w-[88%] flex justify-center items-center | ||
*/} | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default Events; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[ | ||
{ | ||
"name": "Fidal Mathew", | ||
"image": "https://avatars.githubusercontent.com/u/84982038?v=4", | ||
"role": "Open Source Lead", | ||
"description": "Web Developer | Learning :)", | ||
"github": "https://github.com/FidalMathew", | ||
"linkedIn": "https://www.linkedin.com/in/fidalmathew/", | ||
"color": "#4b916c" | ||
}, | ||
{ | ||
"name": "Narayan Subramanian", | ||
"image": "https://media-exp1.licdn.com/dms/image/C4D03AQGw1ZZLOexy-Q/profile-displayphoto-shrink_800_800/0/1657260532292?e=1671667200&v=beta&t=2v4GchH7mZCfuAyL92zijo1WQXnaxUe5tK5bD3gCXm4", | ||
"role": "Blockchain Lead", | ||
"description": "Enthusiastic Web Developer", | ||
"github": "", | ||
"linkedIn": "https://www.linkedin.com/in/narayan-subramanian/", | ||
"color": "#4b916c" | ||
}, | ||
{ | ||
"name": "Vigya Sharma", | ||
"image": "https://media-exp1.licdn.com/dms/image/C4D03AQF_ujtq41alwg/profile-displayphoto-shrink_800_800/0/1659076002033?e=1671667200&v=beta&t=VZQJwKIvcRnyCTZtOPzXd4LtN6QXhqq3oF2SDOHYB9Y", | ||
"role": "Marketing Lead", | ||
"description": "Web Developer | Learning :)", | ||
"github": "", | ||
"linkedIn": "linkedin.com/in/vigya-sharma-1540bb217/", | ||
"color": "#4b916c" | ||
}, | ||
{ | ||
"name": "Manas Tiwari", | ||
"image": "https://media-exp1.licdn.com/dms/image/C4D03AQG1qGz9YxXtlw/profile-displayphoto-shrink_800_800/0/1655475397913?e=1671667200&v=beta&t=KU8eOxRwG57RqxnFSXzhFPHLQ0mywFerV4qtKSfWrGM", | ||
"role": "Competitive Programming Lead", | ||
"description": "Enthusiastic Web Developer", | ||
"github": "", | ||
"linkedIn": "https://www.linkedin.com/in/manas-tiwari-5631a31b6/", | ||
"color": "#4b916c" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[ | ||
{ | ||
"name": "Revelation", | ||
"date": "11th to 14th Nov, 2021", | ||
"link": "https://www.google.com/", | ||
"type": "new", | ||
"img": "icons8-android-os-100.png" | ||
}, | ||
{ | ||
"name": "Revelation", | ||
"date": "11th to 14th Nov, 2021", | ||
"link": "https://www.google.com/", | ||
"type": "past", | ||
"img": "icons8-android-os-100.png" | ||
}, | ||
{ | ||
"name": "Revelation", | ||
"date": "11th to 14th Nov, 2021", | ||
"link": "https://www.google.com/", | ||
"type": "new", | ||
"img": "icons8-android-os-100.png" | ||
}, | ||
{ | ||
"name": "Crypto Decrypted", | ||
"date": "19th Nov, 2021", | ||
"link": "https://www.google.com/", | ||
"type": "past", | ||
"img": "icons8-android-os-100.png" | ||
}, | ||
{ | ||
"name": "Doorway to Web Development", | ||
"date": "26th to 27th Sep, 2021", | ||
"link": "https://www.google.com/", | ||
"type": "past", | ||
"img": "icons8-android-os-100.png" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / ESLint
verifies the list of dependencies for Hooks like useEffect and similar