Skip to content

Commit be8fb1d

Browse files
committed
Add animation slide and horizontal scroll
1 parent 9bea767 commit be8fb1d

File tree

12 files changed

+288
-32
lines changed

12 files changed

+288
-32
lines changed

Diff for: package-lock.json

+130-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"@oberon-amsterdam/horizontal": "^1.0.2",
67
"@svgr/core": "^4.3.3",
78
"fb-sdk-wrapper": "^1.0.4",
89
"moment": "^2.24.0",
910
"react": "^16.11.0",
1011
"react-dom": "^16.11.0",
1112
"react-feather": "^2.0.3",
12-
"react-horizontal-scrolling-menu": "^0.7.5",
1313
"react-moment": "^0.9.7",
1414
"react-plx": "^1.3.14",
1515
"react-scripts": "3.2.0",

Diff for: src/assets/img/slide-3.jpg

625 KB
Loading

Diff for: src/assets/img/slide-4.jpg

65.3 KB
Loading

Diff for: src/components/Header.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const Slide = () => {
2323
</div>
2424
{/* <Parallax className="header__slider" y={[-20, 30]} tagOuter="figure"> */}
2525
<div className="header__slider">
26-
<img src={Foto} alt="" className="header__slider__img" />
26+
<div className="header__slider__img" />
2727
</div>
2828
{/* </Parallax> */}
2929
</header>

Diff for: src/components/Mentors.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ import React from 'react';
22
import MentorCard from './MentorCard';
33
import hexagon from '../assets/img/parallax-hexagon.svg';
44
import { Parallax } from 'react-scroll-parallax';
5+
import { useState } from 'react';
6+
import useHorizontal from '@oberon-amsterdam/horizontal/hook';
57

6-
7-
const Mentors = ({mentorList, selected}) => {
8+
const Mentors = ({mentorList}) => {
9+
const [container, setContainer] = useState();
10+
useHorizontal({ container: container });
811
const mapMentorsList = () => (
912
mentorList.map(mentor => {
1013
const { name, lastName, photo } = mentor;
11-
const onClick = () => console.log('original onClick ', name);
1214
return (
1315
<MentorCard name={name} lastName={lastName}
14-
photo={photo} key={name} selected={selected} onClick={onClick} />
16+
photo={photo} key={name}/>
1517
);
1618
})
1719
);
@@ -21,7 +23,7 @@ const mapMentorsList = () => (
2123
<h2 className="heading-secondary heading-secondary--white u-align-center u-margin-top-big u-margin-bottom-big">
2224
Mentores
2325
</h2>
24-
<div className="section-mentors__box">
26+
<div className="section-mentors__box container" ref={ref => { setContainer(ref); }}>
2527
{mapMentorsList()}
2628
</div>
2729
</div>

Diff for: src/css/style.css

+58-9
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,20 @@
2525
position: absolute;
2626
top: 100px;
2727
right: 0%;
28-
height: 720px;
29-
width: 1080px;
30-
background-color: #FFF800;
28+
height: 95vh;
29+
width: 66vw;
3130
z-index: -1000;
3231
overflow: hidden; }
3332
.header__slider__img {
3433
width: 100%;
35-
object-fit: cover;
36-
mix-blend-mode: darken;
37-
transition: All ease-in-out 0.3s; }
34+
background-blend-mode: darken;
35+
background-image: linear-gradient(#FFF800, #FFF800), url("../assets/img/slide-1.jpg");
36+
background-size: cover;
37+
background-repeat: no-repeat;
38+
animation-name: example;
39+
animation-timing-function: linear;
40+
animation-duration: 10s;
41+
animation-iteration-count: infinite; }
3842

3943
*,
4044
*::after,
@@ -47,7 +51,10 @@ html {
4751
font-size: 62.5%; }
4852

4953
body {
50-
box-sizing: border-box; }
54+
box-sizing: border-box;
55+
scrollbar-color: #7f7f7f white;
56+
/* thumb and track color */
57+
scrollbar-width: thin; }
5158

5259
.u-underline {
5360
text-decoration: underline;
@@ -202,6 +209,40 @@ body {
202209
opacity: 1;
203210
transform: translate(0); } }
204211

212+
@keyframes example {
213+
0% {
214+
background-image: linear-gradient(#FFF800, #FFF800), url("../assets/img/slide-1.jpg");
215+
transform: skew(0deg, 0deg) scale(1) rotate(0deg);
216+
transform-origin: 80% 80%; }
217+
2% {
218+
background-image: linear-gradient(#FFF800, #FFF800), url("../assets/img/slide-2.jpg");
219+
transform: scale(4, 3) rotate(-30deg);
220+
transform-origin: 80% 80%; }
221+
3% {
222+
background-image: linear-gradient(#FFF800, #FFF800), url("../assets/img/slide-2.jpg");
223+
transform: scale(4, 4) rotate(-60deg);
224+
transform-origin: 80% 80%; }
225+
4% {
226+
background-image: linear-gradient(#FFF800, #FFF800), url("../assets/img/slide-2.jpg");
227+
transform: scale(1) rotate(-90deg);
228+
transform-origin: 80% 80%; }
229+
5% {
230+
background-image: linear-gradient(#FFF800, #FFF800), url("../assets/img/slide-2.jpg");
231+
transform: scale(1) rotate(-90deg);
232+
transform-origin: 80% 80%; }
233+
100% {
234+
background-image: linear-gradient(#FFF800, #FFF800), url("../assets/img/slide-2.jpg");
235+
transform: scale(1) rotate(-90deg);
236+
transform-origin: 80% 80%; } }
237+
238+
@keyframes chamaleon {
239+
0% {
240+
background-color: red; }
241+
25% {
242+
background-color: green; }
243+
100% {
244+
background-color: white; } }
245+
205246
.slides {
206247
display: flex;
207248
position: absolute;
@@ -485,7 +526,10 @@ body {
485526
overflow-y: scroll;
486527
overflow: -moz-scrollbars-none;
487528
flex-wrap: wrap;
488-
-ms-overflow-style: none; }
529+
-ms-overflow-style: none;
530+
scrollbar-color: transparent transparent;
531+
/* thumb and track color */
532+
scrollbar-width: thin; }
489533
.section-events__event-gallery::-webkit-scrollbar {
490534
display: none; }
491535

@@ -514,7 +558,12 @@ body {
514558
flex-direction: row;
515559
align-items: flex-start;
516560
justify-content: flex-start;
517-
z-index: 5; }
561+
z-index: 5;
562+
scrollbar-color: transparent transparent;
563+
/* thumb and track color */
564+
scrollbar-width: thin; }
565+
.section-mentors__box::-webkit-scrollbar {
566+
width: 0px; }
518567
.section-mentors__box .card__mentor:last-child::after {
519568
right: -8em;
520569
width: calc(100% + 16em); }

Diff for: src/pages/home/Home.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ const mentorList = [
4545
console.log(mentorList[2])
4646
class Home extends React.Component {
4747

48-
constructor() {
49-
super();
48+
constructor(props) {
49+
super(props);
5050
this.state = {
5151
data: []
5252
}
53+
// this.menu = null;
54+
// this.menuItems = Mentors(mentorList.slice(0, mentorList.length), this.state.selected);
5355
}
5456

5557

0 commit comments

Comments
 (0)