|
1 | 1 | import React, { Component } from 'react';
|
2 |
| -import Parallax from 'react-springy-parallax' |
3 |
| -import { Link } from 'react-router-dom' |
| 2 | +import Parallax from 'react-springy-parallax'; |
| 3 | +import { Link } from 'react-router-dom'; |
4 | 4 |
|
5 |
| -import Header from './Header' |
6 |
| -import stars from '../../static/img/Endless-Constellation.svg' |
7 |
| -import Coding from '../../static/img/coding.png' |
8 |
| -import DryRun from '../../static/img/code.png' |
9 |
| -import Screen from '../../static/img/screen.png' |
10 |
| -import './HomeComponent.css' |
| 5 | +import Header from './Header'; |
| 6 | +import stars from '../../static/img/Endless-Constellation.svg'; |
| 7 | +import Coding from '../../static/img/coding.png'; |
| 8 | +import DryRun from '../../static/img/code.png'; |
| 9 | +import Screen from '../../static/img/screen.png'; |
| 10 | +import './HomeComponent.css'; |
11 | 11 |
|
12 | 12 | export default class HomeComponent extends Component {
|
13 |
| - render() { |
14 |
| - const styles = { |
15 |
| - fontFamily: 'Menlo-Regular, Menlo, monospace', |
16 |
| - lineHeight: '10px', |
17 |
| - display: 'flex', alignItems: 'center', justifyContent: 'center' |
18 |
| - } |
19 |
| - |
20 |
| - return ( |
21 |
| - <Parallax ref="parallax" pages={3} style={{ backgroundImage: `url(${stars})` }}> |
22 |
| - <Parallax.Layer offset={0} speed={1} style={{ backgroundColor: '#243B4A', opacity: '0.5' }} /> |
23 |
| - <Parallax.Layer offset={1} speed={1} style={{ backgroundColor: '#805E73', opacity: '0.5' }} /> |
24 |
| - <Parallax.Layer offset={2} speed={1} style={{ backgroundColor: '#87BCDE', opacity: '0.5' }} /> |
25 |
| - |
26 |
| - <Parallax.Layer |
27 |
| - offset={0} |
28 |
| - style={styles} |
29 |
| - speed={0.5} |
30 |
| - onClick={() => this.refs.parallax.scrollTo(1)}> |
31 |
| - <Header /> |
32 |
| - </Parallax.Layer> |
33 |
| - |
34 |
| - <Parallax.Layer |
35 |
| - offset={1.05} |
36 |
| - style={{ pointerEvents: 'none' }} |
37 |
| - speed={-0.3}> |
38 |
| - <img alt="text-editor" className='image-text-editor' src={Coding} /> |
39 |
| - </Parallax.Layer> |
40 |
| - |
41 |
| - <Parallax.Layer |
42 |
| - offset={1} |
43 |
| - style={styles} |
44 |
| - speed={1} |
45 |
| - onClick={() => this.refs.parallax.scrollTo(2)}> |
46 |
| - <h2 className='middle-container-heading'>Explore the <br />'Ocean of Data Structures and Algorithms'</h2> |
47 |
| - </Parallax.Layer> |
48 |
| - |
49 |
| - <Parallax.Layer |
50 |
| - offset={1.75} |
51 |
| - speed={1.6}> |
52 |
| - <img alt="file_1" src={DryRun} style={{ opacity: '0.4', width: '20%', marginLeft: '10%' }} /> |
53 |
| - <img alt="file_2" src={DryRun} style={{ opacity: '0.4', width: '20%', marginLeft: '40%' }} /> |
54 |
| - </Parallax.Layer> |
55 |
| - |
56 |
| - <Parallax.Layer |
57 |
| - offset={2.2} |
58 |
| - speed={+0.6}> |
59 |
| - <img alt="laptop" src={Screen} className='footer-image' /> |
60 |
| - </Parallax.Layer> |
61 |
| - |
62 |
| - <Parallax.Layer |
63 |
| - offset={2} |
64 |
| - style={styles} |
65 |
| - speed={1} |
66 |
| - onClick={() => this.refs.parallax.scrollTo(0)}> |
67 |
| - <div> |
68 |
| - <h4 className='footer-heading'>Hola Guys!</h4> |
69 |
| - <h5 className='footer-link'><Link to='/home'>Visit the Home page</Link></h5> |
70 |
| - </div> |
71 |
| - </Parallax.Layer> |
72 |
| - </Parallax> |
73 |
| - ) |
74 |
| - } |
| 13 | + render() { |
| 14 | + const styles = { |
| 15 | + fontFamily: 'Menlo-Regular, Menlo, monospace', |
| 16 | + lineHeight: '10px', |
| 17 | + display: 'flex', |
| 18 | + alignItems: 'center', |
| 19 | + justifyContent: 'center', |
| 20 | + }; |
| 21 | + |
| 22 | + return ( |
| 23 | + <Parallax ref="parallax" pages={3} style={{ backgroundImage: `url(${stars})` }}> |
| 24 | + <Parallax.Layer offset={0} speed={1} style={{ backgroundColor: '#243B4A', opacity: '0.5' }} /> |
| 25 | + <Parallax.Layer offset={1} speed={1} style={{ backgroundColor: '#805E73', opacity: '0.5' }} /> |
| 26 | + <Parallax.Layer offset={2} speed={1} style={{ backgroundColor: '#87BCDE', opacity: '0.5' }} /> |
| 27 | + |
| 28 | + <Parallax.Layer offset={0} style={styles} speed={0.5} onClick={() => this.refs.parallax.scrollTo(1)}> |
| 29 | + <Header /> |
| 30 | + </Parallax.Layer> |
| 31 | + |
| 32 | + <Parallax.Layer offset={1.05} style={{ pointerEvents: 'none' }} speed={-0.3}> |
| 33 | + <img alt="text-editor" className="image-text-editor" src={Coding} /> |
| 34 | + </Parallax.Layer> |
| 35 | + |
| 36 | + <Parallax.Layer offset={1} style={styles} speed={1} onClick={() => this.refs.parallax.scrollTo(2)}> |
| 37 | + <h2 className="middle-container-heading"> |
| 38 | + Explore the <br /> |
| 39 | + 'Ocean of Data Structures and Algorithms' |
| 40 | + </h2> |
| 41 | + </Parallax.Layer> |
| 42 | + |
| 43 | + <Parallax.Layer offset={1.75} speed={1.6}> |
| 44 | + <img alt="file_1" src={DryRun} style={{ opacity: '0.4', width: '20%', marginLeft: '10%' }} /> |
| 45 | + <img alt="file_2" src={DryRun} style={{ opacity: '0.4', width: '20%', marginLeft: '40%' }} /> |
| 46 | + </Parallax.Layer> |
| 47 | + |
| 48 | + <Parallax.Layer offset={2.2} speed={+0.6}> |
| 49 | + <img alt="laptop" src={Screen} className="footer-image" /> |
| 50 | + </Parallax.Layer> |
| 51 | + |
| 52 | + <Parallax.Layer offset={2} style={styles} speed={1} onClick={() => this.refs.parallax.scrollTo(0)}> |
| 53 | + <div> |
| 54 | + <h4 className="footer-heading">Hola Guys!</h4> |
| 55 | + <h5 className="footer-link"> |
| 56 | + <Link to="/home">Visit the Home page</Link> |
| 57 | + </h5> |
| 58 | + </div> |
| 59 | + </Parallax.Layer> |
| 60 | + </Parallax> |
| 61 | + ); |
| 62 | + } |
75 | 63 | }
|
0 commit comments