Skip to content
This repository has been archived by the owner on Feb 17, 2019. It is now read-only.

Integrate fullPage.js #92

Merged
merged 13 commits into from
Dec 29, 2018
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@fullpage/react-fullpage": "^0.1.10",
"firebase": "^4.10.0",
"firebaseui": "^2.6.1",
"lodash": "^4.17.5",
Expand Down
47 changes: 36 additions & 11 deletions src/components/eventList/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { Fragment } from 'react';
import {connect} from 'react-redux';

import Panel from "../Panel";
Expand All @@ -7,17 +7,42 @@ import './styles.css';
class EventList extends React.Component {

render() {
return (
<div className={'uk-container event-list'}>
<div className={'uk-text-center uk-margin-large-bottom'}>
<span className={'event-list-heading'}>PAST</span>
{' '}
<span className={'event-list-heading'}>EVENTS</span>
</div>
<div uk-grid="true" className={'uk-grid-large uk-child-width-expand@s'}>
{this.props.event.events.map((event, idx) => <Panel key={idx} event={event}/>)}

let listEventsJsx = []

if ( this.props.event ) {
let events = this.props.event.events;
let listEvents = [];
while (events.length !== 0) {
let arr = [...events.splice(0, 3)]
arr = arr.filter(a => a !== undefined)
listEvents.push(arr)
}

const listEventsLength = listEvents.length

listEventsJsx = listEvents.map((chunk, i) => {
return <div key={i} className='uk-container event-list section'>
<div className={'uk-text-center uk-margin-large-bottom'}>
<span className={'event-list-heading'}>PAST</span>
{' '}
<span className={'event-list-heading'}>EVENTS</span>
{' '}
<span className={'event-list-heading'}>{`${i+1}/${listEventsLength}`}</span>
</div>
<div uk-grid="true" className={'uk-grid-large uk-child-width-expand@s'}>
{chunk.map(c => {
return (<Panel key={c.id} event={c}/>)
})}
</div>
</div>
</div>
})
}

return (
<Fragment>
{listEventsJsx ? listEventsJsx : (<div style={{color: 'white'}} className='section'>Loading...</div>)}
</Fragment>
);
}
}
Expand Down
144 changes: 25 additions & 119 deletions src/components/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import {connect} from 'react-redux';
import Particles from 'react-particles-js';
import ReactFullpage from '@fullpage/react-fullpage';

import Countdown from './Countdown';
import EventList from './eventList';
Expand All @@ -9,126 +10,31 @@ class Home extends React.Component {
componentDidMount() {
document.body.scrollTop = 0;
}

render() {
return <div>
{/*<img className="absolute triangle" src="https://firebasestorage.googleapis.com/v0/b/cerebro-2018-f1052.appspot.com/o/triangle.png?alt=media&token=f3cbbbed-2d31-4201-a051-8d123d594156" alt=""/>*/}
{/*<img className="absolute square" src="https://firebasestorage.googleapis.com/v0/b/cerebro-2018-f1052.appspot.com/o/square.png?alt=media&token=8979df90-1eaf-466e-9ef9-94546eec3e90" alt=""/>*/}
{/*<div className={'absolute triangle'}/>*/}
{/*<div className={'absolute square'} />*/}
<Countdown/>
<Particles params={{
"particles": {
"number": {
"value": 160,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
"value": "#ffffff"
},
"shape": {
"type": "circle",
"stroke": {
"width": 0,
"color": "#000000"
},
"polygon": {
"nb_sides": 5
},
"image": {
"src": "img/github.svg",
"width": 100,
"height": 100
}
},
"opacity": {
"value": 0.4,
"random": true,
"anim": {
"enable": true,
"speed": 1,
"opacity_min": 0,
"sync": false
}
},
"size": {
"value": 3,
"random": true,
"anim": {
"enable": false,
"speed": 4,
"size_min": 0.3,
"sync": false
}
},
"line_linked": {
"enable": false,
"distance": 150,
"color": "#ffffff",
"opacity": 0.4,
"width": 1
},
"move": {
"enable": true,
"speed": 1,
"direction": "none",
"random": true,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {
"enable": false,
"rotateX": 600,
"rotateY": 600
}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {
"enable": true,
"mode": "bubble"
},
"onclick": {
"enable": true,
"mode": "repulse"
},
"resize": true
},
"modes": {
"grab": {
"distance": 400,
"line_linked": {
"opacity": 1
}
},
"bubble": {
"distance": 250,
"size": 0,
"duration": 2,
"opacity": 0,
"speed": 3
},
"repulse": {
"distance": 400,
"duration": 0.4
},
"push": {
"particles_nb": 4
},
"remove": {
"particles_nb": 2
}
}
},
"retina_detect": true
}}/>
<EventList/>
</div>
return (
<ReactFullpage
render={({ state, fullpageApi }) => {
return (
<ReactFullpage.Wrapper>
<div className="section">
<Countdown/>
</div>
<EventList />
</ReactFullpage.Wrapper>
);
}}
></ReactFullpage>
)
}
}

const mapStateToProps = state => {
return {
loading: state.event.loadingEvents
}
}

export default connect()(Home);
export default connect(mapStateToProps)(Home);


2 changes: 1 addition & 1 deletion src/reducers/eventReducer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {actionTypes} from "../actions/eventActions";

const initialState = {events: [], loadingEvents: false};
const initialState = {events: [], loadingEvents: true};

export const eventReducer = (state = initialState, action) => {
switch (action.type) {
Expand Down
85 changes: 84 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@
version "0.2.6"
resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.2.6.tgz#a4b81ca8cdeb1acbc7923289a4a514f61b59db86"

"@fullpage/react-fullpage@^0.1.10":
version "0.1.10"
resolved "https://registry.yarnpkg.com/@fullpage/react-fullpage/-/react-fullpage-0.1.10.tgz#c7c15ea2cff8cd7f58b8ba3ac0e75d76ce3b83e1"
integrity sha512-VDgrIsmntMvHVo+p+UcO60UY3/pQfPDipqbY31uJK7CzeTslGY1TqIe/XPfzH1dDr3HgXvG2gPQMGOh07Xko/A==
dependencies:
fullpage.js "^3.0.4"

"@types/lodash.clonedeep@^4.5.3":
version "4.5.3"
resolved "https://registry.yarnpkg.com/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.3.tgz#d42cfba3d929a4e1177a775142ce2a9444e384cf"
Expand Down Expand Up @@ -2404,6 +2411,11 @@ eslint-config-react-app@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-2.1.0.tgz#23c909f71cbaff76b945b831d2d814b8bde169eb"

eslint-config-standard@^12.0.0:
version "12.0.0"
resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz#638b4c65db0bd5a41319f96bba1f15ddad2107d9"
integrity sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ==

eslint-import-resolver-node@^0.3.1:
version "0.3.2"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a"
Expand All @@ -2428,6 +2440,22 @@ eslint-module-utils@^2.1.1:
debug "^2.6.8"
pkg-dir "^1.0.0"

eslint-module-utils@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746"
integrity sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=
dependencies:
debug "^2.6.8"
pkg-dir "^1.0.0"

eslint-plugin-es@^1.3.1:
version "1.4.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-1.4.0.tgz#475f65bb20c993fc10e8c8fe77d1d60068072da6"
integrity sha512-XfFmgFdIUDgvaRAlaXUkxrRg5JSADoRC8IkKLc/cISeR3yHVMefFHQZpcyXXEUUPHfy5DwviBcrfqlyqEwlQVw==
dependencies:
eslint-utils "^1.3.0"
regexpp "^2.0.1"

[email protected]:
version "2.39.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.39.1.tgz#b5624622a0388bcd969f4351131232dcb9649cd5"
Expand All @@ -2449,6 +2477,22 @@ [email protected]:
minimatch "^3.0.3"
read-pkg-up "^2.0.0"

eslint-plugin-import@^2.14.0:
version "2.14.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8"
integrity sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g==
dependencies:
contains-path "^0.1.0"
debug "^2.6.8"
doctrine "1.5.0"
eslint-import-resolver-node "^0.3.1"
eslint-module-utils "^2.2.0"
has "^1.0.1"
lodash "^4.17.4"
minimatch "^3.0.3"
read-pkg-up "^2.0.0"
resolve "^1.6.0"

[email protected]:
version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.1.1.tgz#5c96bb5186ca14e94db1095ff59b3e2bd94069b1"
Expand All @@ -2461,6 +2505,23 @@ [email protected]:
emoji-regex "^6.1.0"
jsx-ast-utils "^1.4.0"

eslint-plugin-node@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-8.0.0.tgz#fb9e8911f4543514f154bb6a5924b599aa645568"
integrity sha512-Y+ln8iQ52scz9+rSPnSWRaAxeWaoJZ4wIveDR0vLHkuSZGe44Vk1J4HX7WvEP5Cm+iXPE8ixo7OM7gAO3/OKpQ==
dependencies:
eslint-plugin-es "^1.3.1"
eslint-utils "^1.3.1"
ignore "^5.0.2"
minimatch "^3.0.4"
resolve "^1.8.1"
semver "^5.5.0"

eslint-plugin-promise@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.0.1.tgz#2d074b653f35a23d1ba89d8e976a985117d1c6a2"
integrity sha512-Si16O0+Hqz1gDHsys6RtFRrW7cCTB6P7p3OJmKp3Y3dxpQE2qwOA7d3xnV+0mBmrPoi0RBnxlCKvqu70te6wjg==

[email protected]:
version "7.4.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.4.0.tgz#300a95861b9729c087d362dd64abcc351a74364a"
Expand All @@ -2470,6 +2531,11 @@ [email protected]:
jsx-ast-utils "^2.0.0"
prop-types "^15.5.10"

eslint-plugin-standard@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.0.0.tgz#f845b45109c99cd90e77796940a344546c8f6b5c"
integrity sha512-OwxJkR6TQiYMmt1EsNRMe5qG3GsbjlcOhbGUBY4LtavF9DsLaTcoR+j2Tdjqi23oUwKNUqX7qcn5fPStafMdlA==

eslint-scope@^3.7.1:
version "3.7.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
Expand All @@ -2485,7 +2551,7 @@ eslint-scope@^4.0.0:
esrecurse "^4.1.0"
estraverse "^4.1.1"

eslint-utils@^1.3.1:
eslint-utils@^1.3.0, eslint-utils@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512"
integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==
Expand Down Expand Up @@ -3058,6 +3124,11 @@ fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2:
mkdirp ">=0.5 0"
rimraf "2"

fullpage.js@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/fullpage.js/-/fullpage.js-3.0.4.tgz#bb3eb1af7ecb5706866abf64ffc7b2535cec39b7"
integrity sha512-GWpud0Gvr8i4k3QySoajFevO18UBKMJ9znU3o4uaXZkKYqLtS8d1BSQoAARmYwYgBLOw3YrKAG+4LoaIokO1UA==

function-bind@^1.0.2, function-bind@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
Expand Down Expand Up @@ -3550,6 +3621,11 @@ ignore@^4.0.6:
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==

ignore@^5.0.2:
version "5.0.4"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.0.4.tgz#33168af4a21e99b00c5d41cbadb6a6cb49903a45"
integrity sha512-WLsTMEhsQuXpCiG173+f3aymI43SXa+fB1rSfbzyP4GkPP+ZFVuO0/3sFUGNBtifisPeDcl/uD/Y2NxZ7xFq4g==

import-lazy@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
Expand Down Expand Up @@ -6172,6 +6248,13 @@ resolve@^1.3.2, resolve@^1.5.0:
dependencies:
path-parse "^1.0.5"

resolve@^1.6.0, resolve@^1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26"
integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==
dependencies:
path-parse "^1.0.5"

restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
Expand Down