Skip to content
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

Events page updated #4

Open
wants to merge 3 commits into
base: master-readable
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"react-dom": "^17.0.2",
"react-event-timeline": "^1.6.2",
"react-google-sheets": "^0.4.0",
"react-icons": "^4.3.1",
"react-motion": "^0.5.2",
"react-particles-js": "^2.7.1",
"react-router": "^4.3.1",
Expand All @@ -29,6 +30,7 @@
"react-scroll": "^1.7.10",
"react-scroll-to-element": "^0.2.0",
"react-sticky": "^6.0.3",
"react-swipeable": "^7.0.0",
"tabletop": "^1.5.2"
},
"scripts": {
Expand Down
31 changes: 31 additions & 0 deletions src/Components/Events/EventData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export const OnGoingEventsData = [
{
image: 'https://images.pexels.com/photos/170811/pexels-photo-170811.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
//image: 'https://i.imgur.com/Wdv7tQ5.png',
title: 'TECH CLUB TALKS 1',
details: 'Internships, projects, resumes....too overwhelming? Allow us to break it down for you! Look out for this online workshop series where various speakers talk about their journey and also tips from your seniors on how to go about these. The first talk is on 12th November, mark your calendars!'
},
{
image: 'https://media.istockphoto.com/photos/red-generic-sedan-car-isolated-on-white-background-3d-illustration-picture-id1189903200?k=20&m=1189903200&s=612x612&w=0&h=L2bus_XVwK5_yXI08X6RaprdFKF1U9YjpN_pVYPgS0o=',
//image: 'https://i.imgur.com/Wdv7tQ5.png',
title: 'TECH CLUB TALKS 2',
details: 'Internships, projects, resumes....too overwhelming? Allow us to break it down for you! Look out for this online workshop series where various speakers talk about their journey and also tips from your seniors on how to go about these. The first talk is on 12th November, mark your calendars!'
},
{
image: 'https://i.imgur.com/Wdv7tQ5.png',
title: 'TECH CLUB TALKS 3',
details: 'Internships, projects, resumes....too overwhelming? Allow us to break it down for you! Look out for this online workshop series where various speakers talk about their journey and also tips from your seniors on how to go about these. The first talk is on 12th November, mark your calendars!'
},
{
image: 'https://images.pexels.com/photos/116675/pexels-photo-116675.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500',
//image: 'https://i.imgur.com/Wdv7tQ5.png',
title: 'TECH CLUB TALKS 4',
details: 'Internships, projects, resumes....too overwhelming? Allow us to break it down for you! Look out for this online workshop series where various speakers talk about their journey and also tips from your seniors on how to go about these. The first talk is on 12th November, mark your calendars!'
},
{
image: 'https://i.imgur.com/Wdv7tQ5.png',
//image: 'https://i.imgur.com/Wdv7tQ5.png',
title: 'TECH CLUB TALKS 5',
details: 'Internships, projects, resumes....too overwhelming? Allow us to break it down for you! Look out for this online workshop series where various speakers talk about their journey and also tips from your seniors on how to go about these. The first talk is on 12th November, mark your calendars!'
},
]
52 changes: 52 additions & 0 deletions src/Components/Events/EventSlider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React, {useEffect, useState} from "react";
import { OnGoingEventsData } from "./EventData";
import {IoIosArrowBack, IoIosArrowForward} from 'react-icons/io';
import './Events.css'

const EventSlider = ({slides}) => {
const length = slides.length
const [x, setX] = useState(0);
const nextSlide = () => {
x === -100*(length-1) ? setX(0) : setX(x-100)
}

const prevSlide = () => {
x === 0 ? setX(-100*(length-1)) : setX(x+100)
}

if(!Array.isArray(slides) || slides.length <= 0){
return null;
}


return(
<div className="carousel">
<IoIosArrowBack className="left-arrow" onClick={prevSlide}/>
<IoIosArrowForward className="right-arrow" onClick={nextSlide}/>
{OnGoingEventsData.map((slide, index) => {
return (
<div className="slide" key={index} style={{transform:`translateX(${x}%)`}}>
<div className="event">
<div className="left-content">
<img src={slide.image} alt="content image" className="event-img"/>
</div>
<div className="right-content">
<div className="event-title">{slide.title}</div>
<div className="event-info">{slide.details}</div>
<div className="event-button">
<button className="primary-button">
<a href="https://forms.gle/MUK6ozrtosZZsKEM7" rel="noopener noreferrer" target="_blank">
Register Now
</a>
</button>
</div>
</div>
</div>
</div>
)
})}
</div>
);
}

export default EventSlider
115 changes: 108 additions & 7 deletions src/Components/Events/Events.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,35 @@
--padding-h-small: 8vw;
}

.navbar.navbar-inverse.navbar-fixed-top{
margin-right: 22px;
}

a {
text-decoration: none;
color: white;
}

img {
.img{
height: 100%;
width: 100%;
object-fit: contain;
}

.wrapper{
width: 100%;
height: 100vh;
overflow-y: scroll;
overflow-x: hidden;
scroll-snap-type: y mandatory;
}

section{
width: 100%;
height: 100vh;
scroll-snap-align: start;
}

body {
/* padding: var(--padding-v-big) var(--padding-h-big); */
font-family: "Raleway";
Expand Down Expand Up @@ -124,22 +142,76 @@ body {
align-items: center;
animation: content-intro 2s ease-in-out;
}
.slide-left {
/* .slide-left {
height: 10vh;
display: none;
}
.slide-right {
height: 10vh;
display: none;
} */

/* for testing */

.right-arrow{
position: absolute;
right: 32px;
top: 40%;
font-size: 3rem;
color: #fff;
z-index: 10;
cursor: pointer;
user-select: none;
}

.left-arrow{
position: absolute;
left: 32px;
top: 40%;
font-size: 3rem;
color: #fff;
z-index: 10;
cursor: pointer;
user-select: none;
}

.left-arrow:hover{
transform: scale(1.5);
transition-duration: 0.5s;
}

.right-arrow:hover{
transform: scale(1.5);
transition-duration: 0.5s;
}

.event {
padding: 0 12vw;
display: flex;
/* align-items: center; */
align-items: center;
justify-content: flex-start;
}

.slide{
min-width: 100%;
transition: 1s;
}

.slide-item {
padding: 5%;
transition: 0.5s;
}

.slide-main {
margin-right: auto;
margin-left: auto;
transform: scale(1.2);
}

.slide-preview {
opacity: 0.2;
}

.right-content {
padding: 0 0 0 20px;
color: white;
Expand All @@ -157,11 +229,33 @@ body {
}

.event-img {
height: 26vw;
width: 26vw;
border: 1px solid wheat;
width: 20vw;
height: 20vw;
border-radius: 10px;
object-fit: fill;
}
/* controlling previous events window size for larger window */
.small-window{
display: none;
}

.threeWindow {
display: flex;
opacity: 0;
}

.threeWindow.active{
display: flex;
opacity: 1;
}

.centerImage{
margin-right: auto;
margin-left: auto;
transform: scale(1.2);
}


@media only screen and (max-width: 576px) {
body {
/* padding: var(--padding-v-small) var(--padding-h-small); */
Expand All @@ -173,7 +267,6 @@ body {

.event {
flex-direction: column;
align-items: center;
}

.event-title {
Expand Down Expand Up @@ -209,6 +302,14 @@ body {
.dm2 {
position: absolute;
}

.large-window{
display: none;
}

.small-window{
display: flex;
}
}

@media only screen and (max-width: 1000px) {
Expand Down
65 changes: 24 additions & 41 deletions src/Components/Events/Events.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from "react";
import React, {useEffect, useState} from "react";
// import { useState, useEffect, useRef } from "react";
import "./Events.css";
import Dm from '../../Images/dcm2.png';
import { OnGoingEventsData } from "./EventData";
import EventSlider from "./EventSlider";
import PastEventsSlider from "./PastEvents";


// function useOnScreen(ref, rootMargin = "0px") {
// const [isIntersecting, setIntersecting] = useState(false);
Expand All @@ -20,51 +24,30 @@ import Dm from '../../Images/dcm2.png';
// }, []);
// return isIntersecting;
// }

const Events = () => {
return (
<div className="upcoming-events">
<div className="title">
{/*Upcoming */}<span className="title-span">Events</span>
</div>

<div className="carousel">
<div className="slide-left">
{/*<img src="./left-button.svg" alt="" />*/}
</div>

<div className="event">
<div className="left-content">
<div className="event-img">
{/* <img src="./Events_Workshop.png" alt="" /> */}
<img
src="https://i.imgur.com/Wdv7tQ5.png"
alt="Interships 101"
/>
</div>
</div>
<div className="right-content">
<div className="event-title">Tech Club Talks</div>
<div className="event-info">
Internships, projects, resumes....too overwhelming? Allow us to
break it down for you! Look out for this online workshop series
where various speakers talk about their journey and also tips from
your seniors on how to go about these. The first talk is on 12th
November, mark your calendars!
</div>
<div className="event-button">
{/*<button className="primary-button">
<a href="https://forms.gle/MUK6ozrtosZZsKEM7" rel="noopener noreferrer" target="_blank">
Register Now
</a>
</button>*/}
{/*<img className='dm2' src={Dm} alt='dm2' />*/}
</div>
</div>
return (
<div className="wrapper">
<section className="upcoming-events" >
<div className="title">
Ongoing <span className="title-span">Events</span>
</div>
<EventSlider slides={OnGoingEventsData}/>
</section>
<section className="upcoming-events">
<div className="title">
Upcoming <span className="title-span">Events</span>
</div>
<div className="slide-right">
{/*<img src="./right-button.svg" alt="" />*/}
<EventSlider slides={OnGoingEventsData}/>
</section>
<section className="upcoming-events">
<div className="title">
Past Events & <span className="title-span">Workshops</span>
</div>
</div>
<PastEventsSlider slides={OnGoingEventsData}/>
</section>
</div>

// <div className="teams-page">
Expand Down
Loading