Skip to content

Commit

Permalink
add eslintrc and cleanup package.json, recompile staticfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
pirate committed Jul 10, 2017
1 parent 013f939 commit c39bddc
Show file tree
Hide file tree
Showing 14 changed files with 6,394 additions and 6,648 deletions.
9 changes: 9 additions & 0 deletions .eslintrc
@@ -0,0 +1,9 @@
{
"parser": "babel-eslint",
"globals": {
"window": true
},
"plugins": [
"babel"
]
}
1 change: 1 addition & 0 deletions .npmignore
@@ -1 +1,2 @@
examples/
node_modules/
23 changes: 14 additions & 9 deletions examples/ball.js
Expand Up @@ -4,12 +4,17 @@ import ReactDOM from 'react-dom'
import {createStore, combineReducers} from 'redux'
import {Provider, connect} from 'react-redux'

import {animations, startAnimation} from '../reducers.js'
import {AnimationControls} from '../controls.js'
import {Become, Animate, Translate, RepeatSequence} from '../animations.js'
import {AnimationStateVisualizer} from '../state-visualizer.js'
import {ExpandableSection} from 'monadical-react-components'

import {
animations,
startAnimation,
AnimationControls,
AnimationStateVisualizer
} from '../src/main.js'

import {Become, Animate, Translate, RepeatSequence} from '../src/animations.js'

import {ExpandableSection} from '../section.js'


const SOURCE = "https://github.com/Monadical-SAS/redux-time/blob/master/examples/ball.js"
Expand All @@ -30,7 +35,7 @@ window.initial_state = {
}
}
window.store = createStore(combineReducers({animations}))
const getWarpedTime = startAnimation(window.store, window.initial_state)
window.time = startAnimation(window.store, window.initial_state)

const BOUNCE_ANIMATION = (start_time) =>
RepeatSequence([
Expand All @@ -40,8 +45,8 @@ const BOUNCE_ANIMATION = (start_time) =>
amt: {top: -200, left: 0},
duration: 500,
curve: 'easeOutQuad',
// start_time: getWarpedTime(), // optional, defaults to now
// unit: 'px', // optional, defaults to px
// start_time: window.time.getWarpedTime(), // optional, defaults to now
// unit: 'px', // optional, defaults to px
}),
Translate({
path: '/ball',
Expand Down Expand Up @@ -129,7 +134,7 @@ const Ball = connect(mapStateToProps, mapDispatchToProps)(BallComponent)
ReactDOM.render(
<Provider store={window.store}>
<div>
<Ball getTime={getWarpedTime} expanded/>
<Ball getTime={window.time.getWarpedTime.bind(window.time)} expanded/>
<AnimationControls debug expanded/>
<AnimationStateVisualizer debug/>
</div>
Expand Down
14 changes: 9 additions & 5 deletions examples/demo.js
Expand Up @@ -4,11 +4,15 @@ import ReactDOM from 'react-dom'
import {createStore, combineReducers} from 'redux'
import {Provider} from 'react-redux'

import {AnimationControls} from '../controls.js'
import {AnimationStateVisualizer} from '../state-visualizer.js'
import {
animations,
startAnimation,
AnimationControls,
AnimationStateVisualizer
} from '../src/main.js'

import {AnimationTester} from './test-component.js'

import {animations, startAnimation} from '../reducers.js'


window.initial_state = {
Expand All @@ -19,12 +23,12 @@ window.initial_state = {
}

window.store = createStore(combineReducers({animations}))
const getWarpedTime = startAnimation(window.store, window.initial_state)
window.time = startAnimation(window.store, window.initial_state)

ReactDOM.render(
<Provider store={window.store}>
<div>
<AnimationTester getTime={getWarpedTime} debug/>
<AnimationTester getTime={window.time.getWarpedTime.bind(window.time)} debug/>
<AnimationControls debug/>
<AnimationStateVisualizer path="test_state" debug/>
</div>
Expand Down

0 comments on commit c39bddc

Please sign in to comment.