We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29f3976 commit f8c310fCopy full SHA for f8c310f
www/static/js/snow.js
@@ -1,6 +1,11 @@
1
(function() {
2
+ var requestAnimationFrame = window.requestAnimationFrame ||
3
+ window.webkitRequestAnimationFrame ||
4
+ window.mozRequestAnimationFrame ||
5
+ function(func) { setTimeout(func, 17); };
6
+
7
var html = document.documentElement;
-
8
9
function Snowflake(maxX) {
10
var rand = Math.random();
11
var sizeRand;
@@ -122,6 +127,7 @@
122
127
context.closePath();
123
128
context.fill();
124
129
}
130
+ requestAnimationFrame(frame);
125
131
126
132
133
if (context) {
@@ -144,7 +150,7 @@
144
150
// add it to the page & start animating
145
151
document.body.appendChild(canvas);
146
152
document.body.appendChild(settleCanvas);
147
- setInterval(frame, 1000 / assumedFps);
153
148
154
149
155
})();
156
0 commit comments