PageSourceSearch

https://bayalagbuteegch.mn/js/skycons.js

js bayalagbuteegch.mn collected 2026-10-04 13:27:56 UTC 18,582 bytes, 714 lines download raw bytes

1var Skycons;
2
3(function(global) {
4  "use strict";
5
6  /* Set up a RequestAnimationFrame shim so we can animate efficiently FOR
7   * GREAT JUSTICE. */
8  var requestInterval, cancelInterval;
9
10  (function() {
11    var raf = global.requestAnimationFrame       ||
12              global.webkitRequestAnimationFrame ||
13              global.mozRequestAnimationFrame    ||
14              global.oRequestAnimationFrame      ||
15              global.msRequestAnimationFrame     ,
16        caf = global.cancelAnimationFrame        ||
17              global.webkitCancelAnimationFrame  ||
18              global.mozCancelAnimationFrame     ||
19              global.oCancelAnimationFrame       ||
20              global.msCancelAnimationFrame      ;
21
22    if(raf && caf) {
23      requestInterval = function(fn, delay) {
24        var handle = {value: null};
25
26        function loop() {
27          handle.value = raf(loop);
28          fn();
29        }
30
31        loop();
32        return handle;
33      };
34
35      cancelInterval = function(handle) {
36        caf(handle.value);
37      };
38    }
39
40    else {
41      requestInterval = setInterval;
42      cancelInterval = clearInterval;
43    }
44  }());
45
46  /* Catmull-rom spline stuffs. */
47  /*
48  function upsample(n, spline) {
49    var polyline = [],
50        len = spline.length,
51        bx  = spline[0],
52        by  = spline[1],
53        cx  = spline[2],
54        cy  = spline[3],
55        dx  = spline[4],
56        dy  = spline[5],
57        i, j, ax, ay, px, qx, rx, sx, py, qy, ry, sy, t;
58
59    for(i = 6; i !== spline.length; i += 2) {
60      ax = bx;
61      bx = cx;
62      cx = dx;
63      dx = spline[i    ];
64      px = -0.5 * ax + 1.5 * bx - 1.5 * cx + 0.5 * dx;
65      qx =        ax - 2.5 * bx + 2.0 * cx - 0.5 * dx;
66      rx = -0.5 * ax            + 0.5 * cx           ;
67      sx =                   bx                      ;
68
69      ay = by;
70      by = cy;
71      cy = dy;
72      dy = spline[i + 1];
73      py = -0.5 * ay + 1.5 * by - 1.5 * cy + 0.5 * dy;
74      qy =        ay - 2.5 * by + 2.0 * cy - 0.5 * dy;
75      ry = -0.5 * ay            + 0.5 * cy           ;
76      sy =                   by                      ;
77
78      for(j = 0; j !== n; ++j) {
79        t = j / n;
80
81        polyline.push(
82          ((px * t + qx) * t + rx) * t + sx,
83          ((py * t + qy) * t + ry) * t + sy
84        );
85      }
86    }
87
88    polyline.push(
89      px + qx + rx + sx,
90      py + qy + ry + sy
91    );
92
93    return polyline;
94  }
95
96  function downsample(n, polyline) {
97    var len = 0,
98        i, dx, dy;
99
100    for(i = 2; i !== polyline.length; i += 2) {
101      dx = polyline[i    ] - polyline[i - 2];
102      dy = polyline[i + 1] - polyline[i - 1];
103      len += Math.sqrt(dx * dx + dy * dy);
104    }
105
106    len /= n;
107
108    var small = [],
109        target = len,
110        min = 0,
111        max, t;
112
113    small.push(polyline[0], polyline[1]);
114
115    for(i = 2; i !== polyline.length; i += 2) {
116      dx = polyline[i    ] - polyline[i - 2];
117      dy = polyline[i + 1] - polyline[i - 1];
118      max = min + Math.sqrt(dx * dx + dy * dy);
119
120      if(max > target) {
121        t = (target - min) / (max - min);
122
123        small.push(
124          polyline[i - 2] + dx * t,
125          polyline[i - 1] + dy * t
126        );
127
128        target += len;
129      }
130
131      min = max;
132    }
133
134    small.push(polyline[polyline.length - 2], polyline[polyline.length - 1]);
135
136    return small;
137  }
138  */
139
140  /* Define skycon things. */
141  /* FIXME: I'm *really really* sorry that this code is so gross. Really, I am.
142   * I'll try to clean it up eventually! Promise! */
143  var KEYFRAME = 500,
144      STROKE = 0.08,
145      TWO_PI = 2.0 * Math.PI,
146      TWO_OVER_SQRT_2 = 2.0 / Math.sqrt(2);
147
148  function circle(ctx, x, y, r) {
149    ctx.beginPath();
150    ctx.arc(x, y, r, 0, TWO_PI, false);
151    ctx.fill();
152  }
153
154  function line(ctx, ax, ay, bx, by) {
155    ctx.beginPath();
156    ctx.moveTo(ax, ay);
157    ctx.lineTo(bx, by);
158    ctx.stroke();
159  }
160
161  function puff(ctx, t, cx, cy, rx, ry, rmin, rmax) {
162    var c = Math.cos(t * TWO_PI),
163        s = Math.sin(t * TWO_PI);
164
165    rmax -= rmin;
166
167    circle(
168      ctx,
169      cx - s * rx,
170      cy + c * ry + rmax * 0.5,
171      rmin + (1 - c * 0.5) * rmax
172    );
173  }
174
175  function puffs(ctx, t, cx, cy, rx, ry, rmin, rmax) {
176    var i;
177
178    for(i = 5; i--; )
179      puff(ctx, t + i / 5, cx, cy, rx, ry, rmin, rmax);
180  }
181
182  function cloud(ctx, t, cx, cy, cw, s, color) {
183    t /= 30000;
184
185    var a = cw * 0.21,
186        b = cw * 0.12,
187        c = cw * 0.24,
188        d = cw * 0.28;
189
190    ctx.fillStyle = color;
191    puffs(ctx, t, cx, cy, a, b, c, d);
192
193    ctx.globalCompositeOperation = 'destination-out';
194    puffs(ctx, t, cx, cy, a, b, c - s, d - s);
195    ctx.globalCompositeOperation = 'source-over';
196  }
197
198  function sun(ctx, t, cx, cy, cw, s, color) {
199    t /= 120000;
200
201    var a = cw * 0.25 - s * 0.5,
202        b = cw * 0.32 + s * 0.5,
203        c = cw * 0.50 - s * 0.5,
204        i, p, cos, sin;
205
206    ctx.strokeStyle = color;
207    ctx.lineWidth = s;
208    ctx.lineCap = "round";
209    ctx.lineJoin = "round";
210
211    ctx.beginPath();
212    ctx.arc(cx, cy, a, 0, TWO_PI, false);
213    ctx.stroke();
214
215    for(i = 8; i--; ) {
216      p = (t + i / 8) * TWO_PI;
217      cos = Math.cos(p);
218      sin = Math.sin(p);
219      line(ctx, cx + cos * b, cy + sin * b, cx + cos * c, cy + sin * c);
220    }
221  }
222
223  function moon(ctx, t, cx, cy, cw, s, color) {
224    t /= 15000;
225
226    var a = cw * 0.29 - s * 0.5,
227        b = cw * 0.05,
228        c = Math.cos(t * TWO_PI),
229        p = c * TWO_PI / -16;
230
231    ctx.strokeStyle = color;
232    ctx.lineWidth = s;
233    ctx.lineCap = "round";
234    ctx.lineJoin = "round";
235
236    cx += c * b;
237
238    ctx.beginPath();
239    ctx.arc(cx, cy, a, p + TWO_PI / 8, p + TWO_PI * 7 / 8, false);
240    ctx.arc(cx + Math.cos(p) * a * TWO_OVER_SQRT_2, cy + Math.sin(p) * a * TWO_OVER_SQRT_2, a, p + TWO_PI * 5 / 8, p + TWO_PI * 3 / 8, true);
241    ctx.closePath();
242    ctx.stroke();
243  }
244
245  function rain(ctx, t, cx, cy, cw, s, color) {
246    t /= 1350;
247
248    var a = cw * 0.16,
249        b = TWO_PI * 11 / 12,
250        c = TWO_PI *  7 / 12,
251        i, p, x, y;
252
253    ctx.fillStyle = color;
254
255    for(i = 4; i--; ) {
256      p = (t + i / 4) % 1;
257      x = cx + ((i - 1.5) / 1.5) * (i === 1 || i === 2 ? -1 : 1) * a;
258      y = cy + p * p * cw;
259      ctx.beginPath();
260      ctx.moveTo(x, y - s * 1.5);
261      ctx.arc(x, y, s * 0.75, b, c, false);
262      ctx.fill();
263    }
264  }
265
266  function sleet(ctx, t, cx, cy, cw, s, color) {
267    t /= 750;
268
269    var a = cw * 0.1875,
270        b = TWO_PI * 11 / 12,
271        c = TWO_PI *  7 / 12,
272        i, p, x, y;
273
274    ctx.strokeStyle = color;
275    ctx.lineWidth = s * 0.5;
276    ctx.lineCap = "round";
277    ctx.lineJoin = "round";
278
279    for(i = 4; i--; ) {
280      p = (t + i / 4) % 1;
281      x = Math.floor(cx + ((i - 1.5) / 1.5) * (i === 1 || i === 2 ? -1 : 1) * a) + 0.5;
282      y = cy + p * cw;
283      line(ctx, x, y - s * 1.5, x, y + s * 1.5);
284    }
285  }
286
287  function snow(ctx, t, cx, cy, cw, s, color) {
288    t /= 3000;
289
290    var a  = cw * 0.16,
291        b  = s * 0.75,
292        u  = t * TWO_PI * 0.7,
293        ux = Math.cos(u) * b,
294        uy = Math.sin(u) * b,
295        v  = u + TWO_PI / 3,
296        vx = Math.cos(v) * b,
297        vy = Math.sin(v) * b,
298        w  = u + TWO_PI * 2 / 3,
299        wx = Math.cos(w) * b,
300        wy = Math.sin(w) * b,
301        i, p, x, y;
302
303    ctx.strokeStyle = color;
304    ctx.lineWidth = s * 0.5;
305    ctx.lineCap = "round";
306    ctx.lineJoin = "round";
307
308    for(i = 4; i--; ) {
309      p = (t + i / 4) % 1;
310      x = cx + Math.sin((p + i / 4) * TWO_PI) * a;
311      y = cy + p * cw;
312
313      line(ctx, x - ux, y - uy, x + ux, y + uy);
314      line(ctx, x - vx, y - vy, x + vx, y + vy);
315      line(ctx, x - wx, y - wy, x + wx, y + wy);
316    }
317  }
318
319  function fogbank(ctx, t, cx, cy, cw, s, color) {
320    t /= 30000;
321
322    var a = cw * 0.21,
323        b = cw * 0.06,
324        c = cw * 0.21,
325        d = cw * 0.28;
326
327    ctx.fillStyle = color;
328    puffs(ctx, t, cx, cy, a, b, c, d);
329
330    ctx.globalCompositeOperation = 'destination-out';
331    puffs(ctx, t, cx, cy, a, b, c - s, d - s);
332    ctx.globalCompositeOperation = 'source-over';
333  }
334
335  /*
336  var WIND_PATHS = [
337        downsample(63, upsample(8, [
338          -1.00, -0.28,
339          -0.75, -0.18,
340          -0.50,  0.12,
341          -0.20,  0.12,
342          -0.04, -0.04,
343          -0.07, -0.18,
344          -0.19, -0.18,
345          -0.23, -0.05,
346          -0.12,  0.11,
347           0.02,  0.16,
348           0.20,  0.15,
349           0.50,  0.07,
350           0.75,  0.18,
351           1.00,  0.28
352        ])),
353        downsample(31, upsample(16, [
354          -1.00, -0.10,
355          -0.75,  0.00,
356          -0.50,  0.10,
357          -0.25,  0.14,
358           0.00,  0.10,
359           0.25,  0.00,
360           0.50, -0.10,
361           0.75, -0.14,
362           1.00, -0.10
363        ]))
364      ];
365  */
366
367  var WIND_PATHS = [
368        [
369          -0.7500, -0.1800, -0.7219, -0.1527, -0.6971, -0.1225,
370          -0.6739, -0.0910, -0.6516, -0.0588, -0.6298, -0.0262,
371          -0.6083,  0.0065, -0.5868,  0.0396, -0.5643,  0.0731,
372          -0.5372,  0.1041, -0.5033,  0.1259, -0.4662,  0.1406,
373          -0.4275,  0.1493, -0.3881,  0.1530, -0.3487,  0.1526,
374          -0.3095,  0.1488, -0.2708,  0.1421, -0.2319,  0.1342,
375          -0.1943,  0.1217, -0.1600,  0.1025, -0.1290,  0.0785,
376          -0.1012,  0.0509, -0.0764,  0.0206, -0.0547, -0.0120,
377          -0.0378, -0.0472, -0.0324, -0.0857, -0.0389, -0.1241,
378          -0.0546, -0.1599, -0.0814, -0.1876, -0.1193, -0.1964,
379          -0.1582, -0.1935, -0.1931, -0.1769, -0.2157, -0.1453,
380          -0.2290, -0.1085, -0.2327, -0.0697, -0.2240, -0.0317,
381          -0.2064,  0.0033, -0.1853,  0.0362, -0.1613,  0.0672,
382          -0.1350,  0.0961, -0.1051,  0.1213, -0.0706,  0.1397,
383          -0.0332,  0.1512,  0.0053,  0.1580,  0.0442,  0.1624,
384           0.0833,  0.1636,  0.1224,  0.1615,  0.1613,  0.1565,
385           0.1999,  0.1500,  0.2378,  0.1402,  0.2749,  0.1279,
386           0.3118,  0.1147,  0.3487,  0.1015,  0.3858,  0.0892,
387           0.4236,  0.0787,  0.4621,  0.0715,  0.5012,  0.0702,
388           0.5398,  0.0766,  0.5768,  0.0890,  0.6123,  0.1055,
389           0.6466,  0.1244,  0.6805,  0.1440,  0.7147,  0.1630,
390           0.7500,  0.1800
391        ],
392        [
393          -0.7500,  0.0000, -0.7033,  0.0195, -0.6569,  0.0399,
394          -0.6104,  0.0600, -0.5634,  0.0789, -0.5155,  0.0954,
395          -0.4667,  0.1089, -0.4174,  0.1206, -0.3676,  0.1299,
396          -0.3174,  0.1365, -0.2669,  0.1398, -0.2162,  0.1391,
397          -0.1658,  0.1347, -0.1157,  0.1271, -0.0661,  0.1169,
398          -0.0170,  0.1046,  0.0316,  0.0903,  0.0791,  0.0728,
399           0.1259,  0.0534,  0.1723,  0.0331,  0.2188,  0.0129,
400           0.2656, -0.0064,  0.3122, -0.0263,  0.3586, -0.0466,
401           0.4052, -0.0665,  0.4525, -0.0847,  0.5007, -0.1002,
402           0.5497, -0.1130,  0.5991, -0.1240,  0.6491, -0.1325,
403           0.6994, -0.1380,  0.7500, -0.1400
404        ]
405      ],
406      WIND_OFFSETS = [
407        {start: 0.36, end: 0.11},
408        {start: 0.56, end: 0.16}
409      ];
410
411  function leaf(ctx, t, x, y, cw, s, color) {
412    var a = cw / 8,
413        b = a / 3,
414        c = 2 * b,
415        d = (t % 1) * TWO_PI,
416        e = Math.cos(d),
417        f = Math.sin(d);
418
419    ctx.fillStyle = color;
420    ctx.strokeStyle = color;
421    ctx.lineWidth = s;
422    ctx.lineCap = "round";
423    ctx.lineJoin = "round";
424
425    ctx.beginPath();
426    ctx.arc(x        , y        , a, d          , d + Math.PI, false);
427    ctx.arc(x - b * e, y - b * f, c, d + Math.PI, d          , false);
428    ctx.arc(x + c * e, y + c * f, b, d + Math.PI, d          , true );
429    ctx.globalCompositeOperation = 'destination-out';
430    ctx.fill();
431    ctx.globalCompositeOperation = 'source-over';
432    ctx.stroke();
433  }
434
435  function swoosh(ctx, t, cx, cy, cw, s, index, total, color) {
436    t /= 2500;
437
438    var path = WIND_PATHS[index],
439        a = (t + index - WIND_OFFSETS[index].start) % total,
440        c = (t + index - WIND_OFFSETS[index].end  ) % total,
441        e = (t + index                            ) % total,
442        b, d, f, i;
443
444    ctx.strokeStyle = color;
445    ctx.lineWidth = s;
446    ctx.lineCap = "round";
447    ctx.lineJoin = "round";
448
449    if(a < 1) {
450      ctx.beginPath();
451
452      a *= path.length / 2 - 1;
453      b  = Math.floor(a);
454      a -= b;
455      b *= 2;
456      b += 2;
457
458      ctx.moveTo(
459        cx + (path[b - 2] * (1 - a) + path[b    ] * a) * cw,
460        cy + (path[b - 1] * (1 - a) + path[b + 1] * a) * cw
461      );
462
463      if(c < 1) {
464        c *= path.length / 2 - 1;
465        d  = Math.floor(c);
466        c -= d;
467        d *= 2;
468        d += 2;
469
470        for(i = b; i !== d; i += 2)
471          ctx.lineTo(cx + path[i] * cw, cy + path[i + 1] * cw);
472
473        ctx.lineTo(
474          cx + (path[d - 2] * (1 - c) + path[d    ] * c) * cw,
475          cy + (path[d - 1] * (1 - c) + path[d + 1] * c) * cw
476        );
477      }
478
479      else
480        for(i = b; i !== path.length; i += 2)
481          ctx.lineTo(cx + path[i] * cw, cy + path[i + 1] * cw);
482
483      ctx.stroke();
484    }
485
486    else if(c < 1) {
487      ctx.beginPath();
488
489      c *= path.length / 2 - 1;
490      d  = Math.floor(c);
491      c -= d;
492      d *= 2;
493      d += 2;
494
495      ctx.moveTo(cx + path[0] * cw, cy + path[1] * cw);
496
497      for(i = 2; i !== d; i += 2)
498        ctx.lineTo(cx + path[i] * cw, cy + path[i + 1] * cw);
499
500      ctx.lineTo(
501        cx + (path[d - 2] * (1 - c) + path[d    ] * c) * cw,
502        cy + (path[d - 1] * (1 - c) + path[d + 1] * c) * cw
503      );
504
505      ctx.stroke();
506    }
507
508    if(e < 1) {
509      e *= path.length / 2 - 1;
510      f  = Math.floor(e);
511      e -= f;
512      f *= 2;
513      f += 2;
514
515      leaf(
516        ctx,
517        t,
518        cx + (path[f - 2] * (1 - e) + path[f    ] * e) * cw,
519        cy + (path[f - 1] * (1 - e) + path[f + 1] * e) * cw,
520        cw,
521        s,
522        color
523      );
524    }
525  }
526
527  Skycons = function(opts) {
528    this.list        = [];
529    this.interval    = null;
530    this.color       = opts && opts.color ? opts.color : "black";
531    this.resizeClear = !!(opts && opts.resizeClear);
532  };
533
534  Skycons.CLEAR_DAY = function(ctx, t, color) {
535    var w = ctx.canvas.width,
536        h = ctx.canvas.height,
537        s = Math.min(w, h);
538
539    sun(ctx, t, w * 0.5, h * 0.5, s, s * STROKE, color);
540  };
541
542  Skycons.CLEAR_NIGHT = function(ctx, t, color) {
543    var w = ctx.canvas.width,
544        h = ctx.canvas.height,
545        s = Math.min(w, h);
546
547    moon(ctx, t, w * 0.5, h * 0.5, s, s * STROKE, color);
548  };
549
550  Skycons.PARTLY_CLOUDY_DAY = function(ctx, t, color) {
551    var w = ctx.canvas.width,
552        h = ctx.canvas.height,
553        s = Math.min(w, h);
554
555    sun(ctx, t, w * 0.625, h * 0.375, s * 0.75, s * STROKE, color);
556    cloud(ctx, t, w * 0.375, h * 0.625, s * 0.75, s * STROKE, color);
557  };
558
559  Skycons.PARTLY_CLOUDY_NIGHT = function(ctx, t, color) {
560    var w = ctx.canvas.width,
561        h = ctx.canvas.height,
562        s = Math.min(w, h);
563
564    moon(ctx, t, w * 0.667, h * 0.375, s * 0.75, s * STROKE, color);
565    cloud(ctx, t, w * 0.375, h * 0.625, s * 0.75, s * STROKE, color);
566  };
567
568  Skycons.CLOUDY = function(ctx, t, color) {
569    var w = ctx.canvas.width,
570        h = ctx.canvas.height,
571        s = Math.min(w, h);
572
573    cloud(ctx, t, w * 0.5, h * 0.5, s, s * STROKE, color);
574  };
575
576  Skycons.RAIN = function(ctx, t, color) {
577    var w = ctx.canvas.width,
578        h = ctx.canvas.height,
579        s = Math.min(w, h);
580
581    rain(ctx, t, w * 0.5, h * 0.37, s * 0.9, s * STROKE, color);
582    cloud(ctx, t, w * 0.5, h * 0.37, s * 0.9, s * STROKE, color);
583  };
584
585  Skycons.SLEET = function(ctx, t, color) {
586    var w = ctx.canvas.width,
587        h = ctx.canvas.height,
588        s = Math.min(w, h);
589
590    sleet(ctx, t, w * 0.5, h * 0.37, s * 0.9, s * STROKE, color);
591    cloud(ctx, t, w * 0.5, h * 0.37, s * 0.9, s * STROKE, color);
592  };
593
594  Skycons.SNOW = function(ctx, t, color) {
595    var w = ctx.canvas.width,
596        h = ctx.canvas.height,
597        s = Math.min(w, h);
598
599    snow(ctx, t, w * 0.5, h * 0.37, s * 0.9, s * STROKE, color);
600    cloud(ctx, t, w * 0.5, h * 0.37, s * 0.9, s * STROKE, color);
601  };
602
603  Skycons.WIND = function(ctx, t, color) {
604    var w = ctx.canvas.width,
605        h = ctx.canvas.height,
606        s = Math.min(w, h);
607
608    swoosh(ctx, t, w * 0.5, h * 0.5, s, s * STROKE, 0, 2, color);
609    swoosh(ctx, t, w * 0.5, h * 0.5, s, s * STROKE, 1, 2, color);
610  };
611
612  Skycons.FOG = function(ctx, t, color) {
613    var w = ctx.canvas.width,
614        h = ctx.canvas.height,
615        s = Math.min(w, h),
616        k = s * STROKE;
617
618    fogbank(ctx, t, w * 0.5, h * 0.32, s * 0.75, k, color);
619
620    t /= 5000;
621
622    var a = Math.cos((t       ) * TWO_PI) * s * 0.02,
623        b = Math.cos((t + 0.25) * TWO_PI) * s * 0.02,
624        c = Math.cos((t + 0.50) * TWO_PI) * s * 0.02,
625        d = Math.cos((t + 0.75) * TWO_PI) * s * 0.02,
626        n = h * 0.936,
627        e = Math.floor(n - k * 0.5) + 0.5,
628        f = Math.floor(n - k * 2.5) + 0.5;
629
630    ctx.strokeStyle = color;
631    ctx.lineWidth = k;
632    ctx.lineCap = "round";
633    ctx.lineJoin = "round";
634
635    line(ctx, a + w * 0.2 + k * 0.5, e, b + w * 0.8 - k * 0.5, e);
636    line(ctx, c + w * 0.2 + k * 0.5, f, d + w * 0.8 - k * 0.5, f);
637  };
638
639  Skycons.prototype = {
640    add: function(el, draw) {
641      var obj;
642
643      if(typeof el === "string")
644        el = document.getElementById(el);
645
646      obj = {
647        element: el,
648        context: el.getContext("2d"),
649        drawing: draw
650      };
651
652      this.list.push(obj);
653      this.draw(obj, KEYFRAME);
654    },
655    set: function(el, draw) {
656      var i;
657
658      if(typeof el === "string")
659        el = document.getElementById(el);
660
661      for(i = this.list.length; i--; )
662        if(this.list[i].element === el) {
663          this.list[i].drawing = draw;
664          this.draw(this.list[i], KEYFRAME);
665          return;
666        }
667
668      this.add(el, draw);
669    },
670    remove: function(el) {
671      var i;
672
673      if(typeof el === "string")
674        el = document.getElementById(el);
675
676      for(i = this.list.length; i--; )
677        if(this.list[i].element === el) {
678          this.list.splice(i, 1);
679          return;
680        }
681    },
682    draw: function(obj, time) {
683      var canvas = obj.context.canvas;
684
685      if(this.resizeClear)
686        canvas.width = canvas.width;
687
688      else
689        obj.context.clearRect(0, 0, canvas.width, canvas.height);
690
691      obj.drawing(obj.context, time, this.color);
692    },
693    play: function() {
694      var self = this;
695
696      this.pause();
697      this.interval = requestInterval(function() {
698        var now = Date.now(),
699            i;
700
701        for(i = self.list.length; i--; )
702          self.draw(self.list[i], now);
703      }, 1000 / 60);
704    },
705    pause: function() {
706      var i;
707
708      if(this.interval) {
709        cancelInterval(this.interval);
710        this.interval = null;
711      }
712    }
713  };
714}(this));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.