PageSourceSearch

https://marianagindlin.com/3d-falling-leaves.min.js

js marianagindlin.com collected 2026-10-10 02:14:01 UTC 3,198 bytes, 12 lines download raw bytes

1/*
2 * October Leaves plugin
3 *
4 * JavaScript API:
5 * $('body').octoberLeaves({...}) // First load with options
6 * $('body').octoberLeaves('stop') // Stop
7 * $('body').octoberLeaves('start') // Start again
8 *
9 * Dependences:
10 * - rotate3Di plugin (rotate3Di.min.js)
11 */
12+function (e) { "use strict"; var t = [], n = [], r = [], i = [], s = [], o = [], u = [], a = [], f = [], l = 0, c = []; var h = function (t, n) { var r = this; this.options = n; this.$el = e(t); this.timer = null; this.winWidth = e(window).width(); this.winHeight = e(window).height(); this.start() }; h.DEFAULTS = { leafStyles: 3, speedC: 2, rotation: 1, rotationTrue: 1, numberOfLeaves: 15, size: 40, cycleSpeed: 30 }; h.prototype.start = function () { if (this.timer !== null) return; for (var i = 0; i < this.options.numberOfLeaves; i++) { var l = Math.floor(Math.random() * this.options.leafStyles) + 1; f[i] = Math.round(Math.random() * this.options.size + 20); a[i] = Math.round(Math.random() * this.options.size + 20); if (f[i] > a[i] * 1.5 || a[i] > f[i] * 1.5) f[i] = a[i]; t[i] = -Math.random() * 500 - 40; n[i] = Math.round(Math.random() * this.winWidth - f[i] * 3); c[i] = .3; r[i] = Math.random() * this.options.speedC + 2; u[i] = Math.round(Math.random()) * this.options.rotation + r[i]; s[i] = 0; o[i] = Math.random() * .06 + .05; var h = e("<div />").attr("id", "octoberLeaf" + i).addClass("october-leaf leaf-style" + l).css({ top: t[i], left: n[i], height: a[i], width: f[i], opacity: c[i], backgroundSize: f[i] + "px " + a[i] * this.options.leafStyles + "px", backgroundPosition: "0 " + a[i] * (l - 1) + "px" }); e("body").append(h) } this.timer = setInterval(e.proxy(this.leafCycle, this), this.options.cycleSpeed) }; h.prototype.stop = function () { if (this.timer) { clearInterval(this.timer); this.timer = null; e(".october-leaf").fadeOut(500, function () { e(this).remove() }) } }; h.prototype.leafCycle = function () { for (var i = 0; i < this.options.numberOfLeaves; i++) { var l = r[i] * Math.sin(90 * Math.PI / 180), h = r[i] * Math.cos(s[i]); u[i] += this.options.rotation + r[i]; t[i] += l; n[i] += h; if (t[i] < 0) { c[i] = 1; e("#octoberLeaf" + i).css({ opacity: c[i] }) } if (t[i] > this.winHeight - a[i] * 4) { c[i] -= .05; e("#octoberLeaf" + i).css({ opacity: c[i] }) } if (t[i] > this.winHeight - (f[i] + a[i] / 2)) { t[i] = -50; n[i] = Math.round(Math.random() * this.winWidth - f[i] * 4); r[i] = Math.random() * this.options.speedC + 2 } if (this.options.rotationTrue == 1) { e("#octoberLeaf" + i).css({ top: t[i], left: n[i] }); e("#octoberLeaf" + i).rotate3Di(u[i], 0) } else if (this.options.rotationTrue == 0) { e("#octoberLeaf" + i).css({ top: t[i], left: n[i] }) } s[i] += o[i] } }; var p = e.fn.octoberLeaves; e.fn.octoberLeaves = function (t) { var n = Array.prototype.slice.call(arguments, 1); return this.each(function () { var r = e(this); var i = r.data("oc.leaves"); var s = e.extend({}, h.DEFAULTS, r.data(), typeof t == "object" && t); if (!i) r.data("oc.leaves", i = new h(this, s)); else if (typeof t == "string") i[t].apply(i, n) }) }; e.fn.octoberLeaves.Constructor = h; e.fn.octoberLeaves.noConflict = function () { e.fn.octoberLeaves = p; return this } }(window.jQuery)

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.