deku 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +6 -0
- data/Gemfile +5 -0
- data/LICENSE +25 -0
- data/README.md +28 -0
- data/Rakefile +1 -0
- data/deku.gemspec +23 -0
- data/deps/node_modules/deku.js +2 -0
- data/deps/node_modules/deku/.editorconfig +16 -0
- data/deps/node_modules/deku/.zuul.yml +15 -0
- data/deps/node_modules/deku/History.md +290 -0
- data/deps/node_modules/deku/LICENSE.md +7 -0
- data/deps/node_modules/deku/Makefile +91 -0
- data/deps/node_modules/deku/README.md +293 -0
- data/deps/node_modules/deku/index.js +4072 -0
- data/deps/node_modules/deku/lib/application.js +85 -0
- data/deps/node_modules/deku/lib/index.js +28 -0
- data/deps/node_modules/deku/lib/render.js +1300 -0
- data/deps/node_modules/deku/lib/stringify.js +105 -0
- data/deps/node_modules/deku/lib/svg.js +107 -0
- data/deps/node_modules/deku/lib/utils.js +18 -0
- data/deps/node_modules/deku/lib/virtual.js +247 -0
- data/deps/node_modules/deku/node_modules/array-flatten/LICENSE +21 -0
- data/deps/node_modules/deku/node_modules/array-flatten/README.md +43 -0
- data/deps/node_modules/deku/node_modules/array-flatten/array-flatten.js +57 -0
- data/deps/node_modules/deku/node_modules/array-flatten/package.json +62 -0
- data/deps/node_modules/deku/node_modules/component-emitter/History.md +63 -0
- data/deps/node_modules/deku/node_modules/component-emitter/LICENSE +24 -0
- data/deps/node_modules/deku/node_modules/component-emitter/Readme.md +74 -0
- data/deps/node_modules/deku/node_modules/component-emitter/index.js +161 -0
- data/deps/node_modules/deku/node_modules/component-emitter/package.json +174 -0
- data/deps/node_modules/deku/node_modules/component-raf/.npmignore +2 -0
- data/deps/node_modules/deku/node_modules/component-raf/History.md +26 -0
- data/deps/node_modules/deku/node_modules/component-raf/Makefile +11 -0
- data/deps/node_modules/deku/node_modules/component-raf/Readme.md +46 -0
- data/deps/node_modules/deku/node_modules/component-raf/component.json +16 -0
- data/deps/node_modules/deku/node_modules/component-raf/example.html +43 -0
- data/deps/node_modules/deku/node_modules/component-raf/index.js +34 -0
- data/deps/node_modules/deku/node_modules/component-raf/package.json +164 -0
- data/deps/node_modules/deku/node_modules/component-type/.npmignore +3 -0
- data/deps/node_modules/deku/node_modules/component-type/Makefile +14 -0
- data/deps/node_modules/deku/node_modules/component-type/Readme.md +37 -0
- data/deps/node_modules/deku/node_modules/component-type/component.json +13 -0
- data/deps/node_modules/deku/node_modules/component-type/index.js +34 -0
- data/deps/node_modules/deku/node_modules/component-type/package.json +120 -0
- data/deps/node_modules/deku/node_modules/component-type/test/index.html +17 -0
- data/deps/node_modules/deku/node_modules/component-type/test/mocha.css +231 -0
- data/deps/node_modules/deku/node_modules/component-type/test/mocha.js +5340 -0
- data/deps/node_modules/deku/node_modules/component-type/test/tests.js +72 -0
- data/deps/node_modules/deku/node_modules/dom-pool/.npmignore +1 -0
- data/deps/node_modules/deku/node_modules/dom-pool/Pool.js +52 -0
- data/deps/node_modules/deku/node_modules/dom-pool/README.md +42 -0
- data/deps/node_modules/deku/node_modules/dom-pool/authors.txt +4 -0
- data/deps/node_modules/deku/node_modules/dom-pool/bower.json +26 -0
- data/deps/node_modules/deku/node_modules/dom-pool/package.json +46 -0
- data/deps/node_modules/deku/node_modules/dom-pool/tests.html +16 -0
- data/deps/node_modules/deku/node_modules/dom-pool/tests.js +102 -0
- data/deps/node_modules/deku/node_modules/dom-walk/.npmignore +3 -0
- data/deps/node_modules/deku/node_modules/dom-walk/LICENCE +19 -0
- data/deps/node_modules/deku/node_modules/dom-walk/Makefile +2 -0
- data/deps/node_modules/deku/node_modules/dom-walk/README.md +23 -0
- data/deps/node_modules/deku/node_modules/dom-walk/example/index.js +5 -0
- data/deps/node_modules/deku/node_modules/dom-walk/example/static/bundle.js +211 -0
- data/deps/node_modules/deku/node_modules/dom-walk/example/static/index.html +16 -0
- data/deps/node_modules/deku/node_modules/dom-walk/index.js +24 -0
- data/deps/node_modules/deku/node_modules/dom-walk/package.json +57 -0
- data/deps/node_modules/deku/node_modules/fast.js/.jshintignore +7 -0
- data/deps/node_modules/deku/node_modules/fast.js/.jshintrc +80 -0
- data/deps/node_modules/deku/node_modules/fast.js/.npmignore +6 -0
- data/deps/node_modules/deku/node_modules/fast.js/.travis.yml +3 -0
- data/deps/node_modules/deku/node_modules/fast.js/LICENSE.md +21 -0
- data/deps/node_modules/deku/node_modules/fast.js/README.md +552 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/clone.js +21 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/concat.js +32 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/every.js +25 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/fill.js +29 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/filter.js +26 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/forEach.js +21 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/index.js +15 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/indexOf.js +33 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/lastIndexOf.js +29 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/map.js +24 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/pluck.js +24 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/reduce.js +35 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/reduceRight.js +35 -0
- data/deps/node_modules/deku/node_modules/fast.js/array/some.js +25 -0
- data/deps/node_modules/deku/node_modules/fast.js/bower.json +28 -0
- data/deps/node_modules/deku/node_modules/fast.js/clone.js +27 -0
- data/deps/node_modules/deku/node_modules/fast.js/dist/bench.html +15 -0
- data/deps/node_modules/deku/node_modules/fast.js/dist/bench.js +19900 -0
- data/deps/node_modules/deku/node_modules/fast.js/dist/fast.js +1450 -0
- data/deps/node_modules/deku/node_modules/fast.js/dist/fast.min.js +1 -0
- data/deps/node_modules/deku/node_modules/fast.js/filter.js +23 -0
- data/deps/node_modules/deku/node_modules/fast.js/forEach.js +22 -0
- data/deps/node_modules/deku/node_modules/fast.js/function/apply.js +19 -0
- data/deps/node_modules/deku/node_modules/fast.js/function/applyNoContext.js +29 -0
- data/deps/node_modules/deku/node_modules/fast.js/function/applyWithContext.js +29 -0
- data/deps/node_modules/deku/node_modules/fast.js/function/bind.js +71 -0
- data/deps/node_modules/deku/node_modules/fast.js/function/bindInternal3.js +11 -0
- data/deps/node_modules/deku/node_modules/fast.js/function/bindInternal4.js +11 -0
- data/deps/node_modules/deku/node_modules/fast.js/function/index.js +7 -0
- data/deps/node_modules/deku/node_modules/fast.js/function/partial.js +42 -0
- data/deps/node_modules/deku/node_modules/fast.js/function/partialConstructor.js +45 -0
- data/deps/node_modules/deku/node_modules/fast.js/function/try.js +35 -0
- data/deps/node_modules/deku/node_modules/fast.js/index.js +241 -0
- data/deps/node_modules/deku/node_modules/fast.js/map.js +23 -0
- data/deps/node_modules/deku/node_modules/fast.js/object/assign.js +34 -0
- data/deps/node_modules/deku/node_modules/fast.js/object/clone.js +25 -0
- data/deps/node_modules/deku/node_modules/fast.js/object/filter.js +28 -0
- data/deps/node_modules/deku/node_modules/fast.js/object/forEach.js +23 -0
- data/deps/node_modules/deku/node_modules/fast.js/object/index.js +11 -0
- data/deps/node_modules/deku/node_modules/fast.js/object/keys.js +17 -0
- data/deps/node_modules/deku/node_modules/fast.js/object/map.js +26 -0
- data/deps/node_modules/deku/node_modules/fast.js/object/reduce.js +37 -0
- data/deps/node_modules/deku/node_modules/fast.js/object/reduceRight.js +37 -0
- data/deps/node_modules/deku/node_modules/fast.js/object/values.js +20 -0
- data/deps/node_modules/deku/node_modules/fast.js/package.json +73 -0
- data/deps/node_modules/deku/node_modules/fast.js/reduce.js +24 -0
- data/deps/node_modules/deku/node_modules/fast.js/reduceRight.js +24 -0
- data/deps/node_modules/deku/node_modules/fast.js/string/index.js +3 -0
- data/deps/node_modules/deku/node_modules/fast.js/string/intern.js +56 -0
- data/deps/node_modules/deku/node_modules/get-uid/README.md +44 -0
- data/deps/node_modules/deku/node_modules/get-uid/index.js +6 -0
- data/deps/node_modules/deku/node_modules/get-uid/package.json +56 -0
- data/deps/node_modules/deku/node_modules/is-dom/HISTORY.md +2 -0
- data/deps/node_modules/deku/node_modules/is-dom/LICENSE +21 -0
- data/deps/node_modules/deku/node_modules/is-dom/README.md +32 -0
- data/deps/node_modules/deku/node_modules/is-dom/index.js +15 -0
- data/deps/node_modules/deku/node_modules/is-dom/package.json +62 -0
- data/deps/node_modules/deku/node_modules/object-path/.npmignore +7 -0
- data/deps/node_modules/deku/node_modules/object-path/.travis.yml +6 -0
- data/deps/node_modules/deku/node_modules/object-path/LICENSE +21 -0
- data/deps/node_modules/deku/node_modules/object-path/README.md +96 -0
- data/deps/node_modules/deku/node_modules/object-path/bower.json +17 -0
- data/deps/node_modules/deku/node_modules/object-path/component.json +22 -0
- data/deps/node_modules/deku/node_modules/object-path/index.js +269 -0
- data/deps/node_modules/deku/node_modules/object-path/package.json +89 -0
- data/deps/node_modules/deku/node_modules/object-path/test.js +510 -0
- data/deps/node_modules/deku/node_modules/per-frame/.npmignore +68 -0
- data/deps/node_modules/deku/node_modules/per-frame/History.md +32 -0
- data/deps/node_modules/deku/node_modules/per-frame/README.md +44 -0
- data/deps/node_modules/deku/node_modules/per-frame/component.json +13 -0
- data/deps/node_modules/deku/node_modules/per-frame/index.js +37 -0
- data/deps/node_modules/deku/node_modules/per-frame/package.json +143 -0
- data/deps/node_modules/deku/node_modules/per-frame/test/test.js +94 -0
- data/deps/node_modules/deku/node_modules/sliced/.npmignore +2 -0
- data/deps/node_modules/deku/node_modules/sliced/.travis.yml +4 -0
- data/deps/node_modules/deku/node_modules/sliced/History.md +30 -0
- data/deps/node_modules/deku/node_modules/sliced/LICENSE +22 -0
- data/deps/node_modules/deku/node_modules/sliced/Makefile +5 -0
- data/deps/node_modules/deku/node_modules/sliced/README.md +62 -0
- data/deps/node_modules/deku/node_modules/sliced/bench.js +95 -0
- data/deps/node_modules/deku/node_modules/sliced/component.json +14 -0
- data/deps/node_modules/deku/node_modules/sliced/index.js +1 -0
- data/deps/node_modules/deku/node_modules/sliced/lib/sliced.js +33 -0
- data/deps/node_modules/deku/node_modules/sliced/package.json +52 -0
- data/deps/node_modules/deku/node_modules/sliced/test/index.js +80 -0
- data/deps/node_modules/deku/package.json +67 -0
- data/lib/deku.rb +11 -0
- data/lib/deku/application.rb +16 -0
- data/lib/deku/component.rb +36 -0
- data/lib/deku/context.rb +38 -0
- data/lib/deku/element_node.rb +17 -0
- data/lib/deku/version.rb +4 -0
- metadata +278 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "component-emitter",
|
|
3
|
+
"description": "Event emitter",
|
|
4
|
+
"version": "1.2.0",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"devDependencies": {
|
|
7
|
+
"mocha": "*",
|
|
8
|
+
"should": "*"
|
|
9
|
+
},
|
|
10
|
+
"component": {
|
|
11
|
+
"scripts": {
|
|
12
|
+
"emitter/index.js": "index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"main": "index.js",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/component/emitter.git"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "make test"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"index.js",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"gitHead": "4d18307a2cdd2cec16d1fadf9e04f02351a8d62e",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/component/emitter/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/component/emitter",
|
|
32
|
+
"_id": "component-emitter@1.2.0",
|
|
33
|
+
"_shasum": "ccd113a86388d06482d03de3fc7df98526ba8efe",
|
|
34
|
+
"_from": "component-emitter@>=1.1.3 <2.0.0",
|
|
35
|
+
"_npmVersion": "2.5.1",
|
|
36
|
+
"_nodeVersion": "1.2.0",
|
|
37
|
+
"_npmUser": {
|
|
38
|
+
"name": "jongleberry",
|
|
39
|
+
"email": "jonathanrichardong@gmail.com"
|
|
40
|
+
},
|
|
41
|
+
"maintainers": [
|
|
42
|
+
{
|
|
43
|
+
"name": "tootallnate",
|
|
44
|
+
"email": "nathan@tootallnate.net"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "tjholowaychuk",
|
|
48
|
+
"email": "tj@vision-media.ca"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "rauchg",
|
|
52
|
+
"email": "rauchg@gmail.com"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "retrofox",
|
|
56
|
+
"email": "rdsuarez@gmail.com"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "coreh",
|
|
60
|
+
"email": "thecoreh@gmail.com"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "forbeslindesay",
|
|
64
|
+
"email": "forbes@lindesay.co.uk"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "kelonye",
|
|
68
|
+
"email": "kelonyemitchel@gmail.com"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "mattmueller",
|
|
72
|
+
"email": "mattmuelle@gmail.com"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "yields",
|
|
76
|
+
"email": "yields@icloud.com"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "anthonyshort",
|
|
80
|
+
"email": "antshort@gmail.com"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "jongleberry",
|
|
84
|
+
"email": "jonathanrichardong@gmail.com"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "ianstormtaylor",
|
|
88
|
+
"email": "ian@ianstormtaylor.com"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "cristiandouce",
|
|
92
|
+
"email": "cristian@gravityonmars.com"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "swatinem",
|
|
96
|
+
"email": "arpad.borsos@googlemail.com"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "stagas",
|
|
100
|
+
"email": "gstagas@gmail.com"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "amasad",
|
|
104
|
+
"email": "amjad.masad@gmail.com"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "juliangruber",
|
|
108
|
+
"email": "julian@juliangruber.com"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "shtylman",
|
|
112
|
+
"email": "shtylman@gmail.com"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "calvinfo",
|
|
116
|
+
"email": "calvin@calv.info"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "dominicbarnes",
|
|
120
|
+
"email": "dominic@dbarnes.info"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "blakeembrey",
|
|
124
|
+
"email": "hello@blakeembrey.com"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "timoxley",
|
|
128
|
+
"email": "secoif@gmail.com"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "jonathanong",
|
|
132
|
+
"email": "jonathanrichardong@gmail.com"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "queckezz",
|
|
136
|
+
"email": "fabian.eichenberger@gmail.com"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "nami-doc",
|
|
140
|
+
"email": "vendethiel@hotmail.fr"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "clintwood",
|
|
144
|
+
"email": "clint@anotherway.co.za"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "thehydroimpulse",
|
|
148
|
+
"email": "dnfagnan@gmail.com"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "stephenmathieson",
|
|
152
|
+
"email": "me@stephenmathieson.com"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "trevorgerhardt",
|
|
156
|
+
"email": "trevorgerhardt@gmail.com"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "timaschew",
|
|
160
|
+
"email": "timaschew@gmail.com"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "hughsk",
|
|
164
|
+
"email": "hughskennedy@gmail.com"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"dist": {
|
|
168
|
+
"shasum": "ccd113a86388d06482d03de3fc7df98526ba8efe",
|
|
169
|
+
"tarball": "http://registry.npmjs.org/component-emitter/-/component-emitter-1.2.0.tgz"
|
|
170
|
+
},
|
|
171
|
+
"directories": {},
|
|
172
|
+
"_resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.0.tgz",
|
|
173
|
+
"readme": "ERROR: No README data found!"
|
|
174
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
1.2.0 / 2014-09-14
|
|
3
|
+
==================
|
|
4
|
+
|
|
5
|
+
* remove never implemented -o and -ms prefixes (@darsain)
|
|
6
|
+
|
|
7
|
+
1.1.3 / 2014-02-11
|
|
8
|
+
==================
|
|
9
|
+
|
|
10
|
+
* package: rename to "component-raf"
|
|
11
|
+
* package: add "main" field
|
|
12
|
+
|
|
13
|
+
1.1.2 / 2013-07-12
|
|
14
|
+
==================
|
|
15
|
+
|
|
16
|
+
* fix .cancel() with fallback #4 @ilsken
|
|
17
|
+
|
|
18
|
+
1.1.1 / 2013-07-12
|
|
19
|
+
==================
|
|
20
|
+
|
|
21
|
+
* fix .cancel(), bitches when window is not the receiver...
|
|
22
|
+
|
|
23
|
+
1.1.0 / 2013-07-12
|
|
24
|
+
==================
|
|
25
|
+
|
|
26
|
+
* add .cancel(id)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
# raf
|
|
3
|
+
|
|
4
|
+
request animation frame
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
$ component install component/raf
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
Request the animation frame with `raf(fn)`, cancel with `raf.cancel(id)`.
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
var x = 0;
|
|
16
|
+
var y = 50;
|
|
17
|
+
var canvas = document.querySelector('canvas');
|
|
18
|
+
var ctx = canvas.getContext('2d');
|
|
19
|
+
var raf = require('raf');
|
|
20
|
+
|
|
21
|
+
function animate() {
|
|
22
|
+
raf(animate);
|
|
23
|
+
draw();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var prev = Date.now();
|
|
27
|
+
function draw() {
|
|
28
|
+
var curr = Date.now();
|
|
29
|
+
var diff = curr - prev;
|
|
30
|
+
var p = diff / 16;
|
|
31
|
+
ctx.clearRect(0, 0, 900, 300);
|
|
32
|
+
ctx.beginPath();
|
|
33
|
+
ctx.globalAlpha = .5;
|
|
34
|
+
ctx.arc(x, y, 10, 0, Math.PI * 2, false);
|
|
35
|
+
ctx.fill();
|
|
36
|
+
x += 2;
|
|
37
|
+
y += Math.sin(x/20) * 5;
|
|
38
|
+
prev = curr;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
animate();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
MIT
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "raf",
|
|
3
|
+
"repo": "component/raf",
|
|
4
|
+
"description": "request animation frame",
|
|
5
|
+
"version": "1.2.0",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"animate",
|
|
8
|
+
"requestAnimationFrame",
|
|
9
|
+
"performance"
|
|
10
|
+
],
|
|
11
|
+
"dependencies": {},
|
|
12
|
+
"development": {},
|
|
13
|
+
"scripts": [
|
|
14
|
+
"index.js"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
<style>
|
|
3
|
+
body {
|
|
4
|
+
padding: 50px;
|
|
5
|
+
}
|
|
6
|
+
canvas {
|
|
7
|
+
border: 1px solid #eee;
|
|
8
|
+
}
|
|
9
|
+
</style>
|
|
10
|
+
|
|
11
|
+
<script src="build/build.js"></script>
|
|
12
|
+
|
|
13
|
+
<canvas width=900 height=300></canvas>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
var x = 0;
|
|
17
|
+
var y = 50;
|
|
18
|
+
var canvas = document.querySelector('canvas');
|
|
19
|
+
var ctx = canvas.getContext('2d');
|
|
20
|
+
var raf = require('raf');
|
|
21
|
+
|
|
22
|
+
function animate() {
|
|
23
|
+
raf(animate);
|
|
24
|
+
draw();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var prev = Date.now();
|
|
28
|
+
function draw() {
|
|
29
|
+
var curr = Date.now();
|
|
30
|
+
var diff = curr - prev;
|
|
31
|
+
var p = diff / 16;
|
|
32
|
+
ctx.clearRect(0, 0, 900, 300);
|
|
33
|
+
ctx.beginPath();
|
|
34
|
+
ctx.globalAlpha = .5;
|
|
35
|
+
ctx.arc(x, y, 10, 0, Math.PI * 2, false);
|
|
36
|
+
ctx.fill();
|
|
37
|
+
x += 2;
|
|
38
|
+
y += Math.sin(x/20) * 5;
|
|
39
|
+
prev = curr;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
animate();
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expose `requestAnimationFrame()`.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
exports = module.exports = window.requestAnimationFrame
|
|
6
|
+
|| window.webkitRequestAnimationFrame
|
|
7
|
+
|| window.mozRequestAnimationFrame
|
|
8
|
+
|| fallback;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Fallback implementation.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var prev = new Date().getTime();
|
|
15
|
+
function fallback(fn) {
|
|
16
|
+
var curr = new Date().getTime();
|
|
17
|
+
var ms = Math.max(0, 16 - (curr - prev));
|
|
18
|
+
var req = setTimeout(fn, ms);
|
|
19
|
+
prev = curr;
|
|
20
|
+
return req;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Cancel.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
var cancel = window.cancelAnimationFrame
|
|
28
|
+
|| window.webkitCancelAnimationFrame
|
|
29
|
+
|| window.mozCancelAnimationFrame
|
|
30
|
+
|| window.clearTimeout;
|
|
31
|
+
|
|
32
|
+
exports.cancel = function(id){
|
|
33
|
+
cancel.call(window, id);
|
|
34
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "component-raf",
|
|
3
|
+
"description": "request animation frame",
|
|
4
|
+
"version": "1.2.0",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"animate",
|
|
7
|
+
"requestAnimationFrame",
|
|
8
|
+
"performance"
|
|
9
|
+
],
|
|
10
|
+
"dependencies": {},
|
|
11
|
+
"component": {
|
|
12
|
+
"scripts": {
|
|
13
|
+
"raf/index.js": "index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"main": "index.js",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/component/raf.git"
|
|
20
|
+
},
|
|
21
|
+
"gitHead": "248c5fbdc10d35caf0775ed8f1c283e7dab363b4",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/component/raf/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/component/raf",
|
|
26
|
+
"_id": "component-raf@1.2.0",
|
|
27
|
+
"scripts": {},
|
|
28
|
+
"_shasum": "b2bc72d43f1b014fde7a4b3c447c764bc73ccbaa",
|
|
29
|
+
"_from": "component-raf@>=1.2.0 <2.0.0",
|
|
30
|
+
"_npmVersion": "1.4.26",
|
|
31
|
+
"_npmUser": {
|
|
32
|
+
"name": "jongleberry",
|
|
33
|
+
"email": "jonathanrichardong@gmail.com"
|
|
34
|
+
},
|
|
35
|
+
"maintainers": [
|
|
36
|
+
{
|
|
37
|
+
"name": "tootallnate",
|
|
38
|
+
"email": "nathan@tootallnate.net"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "tjholowaychuk",
|
|
42
|
+
"email": "tj@vision-media.ca"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "rauchg",
|
|
46
|
+
"email": "rauchg@gmail.com"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "retrofox",
|
|
50
|
+
"email": "rdsuarez@gmail.com"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "coreh",
|
|
54
|
+
"email": "thecoreh@gmail.com"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "forbeslindesay",
|
|
58
|
+
"email": "forbes@lindesay.co.uk"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "kelonye",
|
|
62
|
+
"email": "kelonyemitchel@gmail.com"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "mattmueller",
|
|
66
|
+
"email": "mattmuelle@gmail.com"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "yields",
|
|
70
|
+
"email": "yields@icloud.com"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "anthonyshort",
|
|
74
|
+
"email": "antshort@gmail.com"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "jongleberry",
|
|
78
|
+
"email": "jonathanrichardong@gmail.com"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "ianstormtaylor",
|
|
82
|
+
"email": "ian@ianstormtaylor.com"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "cristiandouce",
|
|
86
|
+
"email": "cristian@gravityonmars.com"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "swatinem",
|
|
90
|
+
"email": "arpad.borsos@googlemail.com"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "stagas",
|
|
94
|
+
"email": "gstagas@gmail.com"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "amasad",
|
|
98
|
+
"email": "amjad.masad@gmail.com"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "juliangruber",
|
|
102
|
+
"email": "julian@juliangruber.com"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "shtylman",
|
|
106
|
+
"email": "shtylman@gmail.com"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "calvinfo",
|
|
110
|
+
"email": "calvin@calv.info"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "dominicbarnes",
|
|
114
|
+
"email": "dominic@dbarnes.info"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "timoxley",
|
|
118
|
+
"email": "secoif@gmail.com"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "jonathanong",
|
|
122
|
+
"email": "jonathanrichardong@gmail.com"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "queckezz",
|
|
126
|
+
"email": "fabian.eichenberger@gmail.com"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "nami-doc",
|
|
130
|
+
"email": "vendethiel@hotmail.fr"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "clintwood",
|
|
134
|
+
"email": "clint@anotherway.co.za"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "thehydroimpulse",
|
|
138
|
+
"email": "dnfagnan@gmail.com"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "stephenmathieson",
|
|
142
|
+
"email": "me@stephenmathieson.com"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "trevorgerhardt",
|
|
146
|
+
"email": "trevorgerhardt@gmail.com"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "timaschew",
|
|
150
|
+
"email": "timaschew@gmail.com"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "hughsk",
|
|
154
|
+
"email": "hughskennedy@gmail.com"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"dist": {
|
|
158
|
+
"shasum": "b2bc72d43f1b014fde7a4b3c447c764bc73ccbaa",
|
|
159
|
+
"tarball": "http://registry.npmjs.org/component-raf/-/component-raf-1.2.0.tgz"
|
|
160
|
+
},
|
|
161
|
+
"directories": {},
|
|
162
|
+
"_resolved": "https://registry.npmjs.org/component-raf/-/component-raf-1.2.0.tgz",
|
|
163
|
+
"readme": "ERROR: No README data found!"
|
|
164
|
+
}
|