summaryrefslogtreecommitdiff
path: root/client/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/index.js')
-rw-r--r--client/index.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/client/index.js b/client/index.js
index 5e36d341..c09aece7 100644
--- a/client/index.js
+++ b/client/index.js
@@ -2,6 +2,7 @@ import React from 'react'
import ReactDOM from 'react-dom'
import { AppContainer } from 'react-hot-loader'
import { Provider } from 'react-redux'
+import 'waypoints/lib/noframework.waypoints.min.js';
import { toArray } from './util'
import Applet from './applet'
@@ -112,6 +113,24 @@ function runApplets() {
}
}
+function buildWaypoints() {
+ const element = document.querySelector('.content section:nth-child(2)')
+ if (element) {
+ var waypoint = new Waypoint({
+ element,
+ handler: function(direction) {
+ if (direction === 'down') {
+ document.body.classList.add('scrolled')
+ } else {
+ document.body.classList.remove('scrolled')
+ }
+ // console.log(direction)
+ // console.log('Scrolled to waypoint!')
+ }
+ })
+ }
+}
+
function main() {
const paras = document.querySelectorAll('section p')
// if (paras.length) {
@@ -123,6 +142,7 @@ function main() {
}
})
runApplets()
+ buildWaypoints()
}
main()