Skip to content

Commit d354f9e

Browse files
committed
start new parallax example
1 parent e8c02dd commit d354f9e

File tree

21 files changed

+2259
-101
lines changed

21 files changed

+2259
-101
lines changed

examples/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import HelloWorld from './components/HelloWorld';
3+
import { ParallaxExample } from 'components';
44

55
import 'react-scroll-parallax/libs/ParallaxScrollListener';
66

77
const root = document.getElementById('root');
88

9-
ReactDOM.render(<HelloWorld />, root);
9+
ReactDOM.render(<ParallaxExample />, root);

examples/components/HelloWorld.js

Lines changed: 0 additions & 92 deletions
This file was deleted.

examples/components/Intro/Intro.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React from 'react';
2+
import style from './Intro.scss';
3+
import { Svg } from 'components';
4+
import { Parallax } from 'react-scroll-parallax';
5+
import ring from '!!raw-loader!./ring-of-dots.svg';
6+
import hemispheres from '!!raw-loader!./hemispheres.svg';
7+
8+
const Intro = () => (
9+
<div className={style.root}>
10+
<div className={style.container}>
11+
<Parallax
12+
offsetYMin={-100}
13+
offsetYMax={100}
14+
className={style.ring}
15+
>
16+
<Svg svg={ring} />
17+
</Parallax>
18+
<Parallax
19+
offsetYMin={-50}
20+
offsetYMax={50}
21+
className={style.circle}
22+
>
23+
<div />
24+
</Parallax>
25+
<Svg
26+
className={style.hemispheres}
27+
svg={hemispheres}
28+
/>
29+
</div>
30+
</div>
31+
);
32+
33+
export default Intro;
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//
2+
// Intro
3+
// ---------------------------
4+
5+
@import '../../styles/colors';
6+
7+
:local(.root) {
8+
display: flex;
9+
flex-flow: row wrap;
10+
align-items: center;
11+
justify-content: center;
12+
padding-top: 50vh;
13+
height: 50vh;
14+
}
15+
16+
:local(.container) {
17+
position: relative;
18+
width: 25em;
19+
}
20+
21+
:local(.ring) {
22+
position: relative;
23+
z-index: 2;
24+
}
25+
26+
:local(.circle) {
27+
position: absolute;
28+
top: 15%;
29+
left: 15%;
30+
width: 70%;
31+
height: 70%;
32+
z-index: 1;
33+
34+
div {
35+
position: absolute;
36+
top: 0;
37+
left: 0;
38+
width: 100%;
39+
height: 100%;
40+
border: 3px solid $plum;
41+
border-radius: 50%;
42+
}
43+
}
44+
45+
:local(.hemispheres) {
46+
position: absolute;
47+
top: 25%;
48+
left: 25%;
49+
width: 50%;
50+
}
Lines changed: 7 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)