/
demo.js
37 lines (29 loc) · 898 Bytes
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react'
import ReactDOM from 'react-dom'
import {createStore, combineReducers} from 'redux'
import {Provider} from 'react-redux'
import {
animations,
startAnimation,
AnimationControls,
AnimationStateVisualizer
} from '../src/main.js'
import {AnimationTester} from './test-component.js'
window.initial_state = {
test_state: {
text: 'Animate Me!',
style: {color: 'black'},
},
}
window.store = createStore(combineReducers({animations}))
window.time = startAnimation(window.store, window.initial_state)
ReactDOM.render(
<Provider store={window.store}>
<div>
<AnimationTester getTime={window.time.getWarpedTime.bind(window.time)} debug/>
<AnimationControls debug/>
<AnimationStateVisualizer path="test_state" debug/>
</div>
</Provider>,
document.getElementById('react'),
)