PageSourceSearch

https://gracious.in/js/wow.js

js gracious.in collected 2026-10-08 11:58:57 UTC 16,576 bytes, 514 lines download raw bytes

vendor: 16,576 bytes, lines 1-514
1(function() {�
2  var MutationObserver, Util, WeakMap, getComputedStyle, getComputedStyleRX,�
3    bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },�
4    indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };�
5�
6  Util = (function() {�
7    function Util() {}�
8�
9    Util.prototype.extend = function(custom, defaults) {�
10      var key, value;�
11      for (key in defaults) {�
12        value = defaults[key];�
13        if (custom[key] == null) {�
14          custom[key] = value;�
15        }�
16      }�
17      return custom;�
18    };�
19�
20    Util.prototype.isMobile = function(agent) {�
21      return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent);�
22    };�
23�
24    Util.prototype.createEvent = function(event, bubble, cancel, detail) {�
25      var customEvent;�
26      if (bubble == null) {�
27        bubble = false;�
28      }�
29      if (cancel == null) {�
30        cancel = false;�
31      }�
32      if (detail == null) {�
33        detail = null;�
34      }�
35      if (document.createEvent != null) {�
36        customEvent = document.createEvent('CustomEvent');�
37        customEvent.initCustomEvent(event, bubble, cancel, detail);�
38      } else if (document.createEventObject != null) {�
39        customEvent = document.createEventObject();�
40        customEvent.eventType = event;�
41      } else {�
42        customEvent.eventName = event;�
43      }�
44      return customEvent;�
45    };�
46�
47    Util.prototype.emitEvent = function(elem, event) {�
48      if (elem.dispatchEvent != null) {�
49        return elem.dispatchEvent(event);�
50      } else if (event in (elem != null)) {�
51        return elem[event]();�
52      } else if (("on" + event) in (elem != null)) {�
53        return elem["on" + event]();�
54      }�
55    };�
56�
57    Util.prototype.addEvent = function(elem, event, fn) {�
58      if (elem.addEventListener != null) {�
59        return elem.addEventListener(event, fn, false);�
60      } else if (elem.attachEvent != null) {�
61        return elem.attachEvent("on" + event, fn);�
62      } else {�
63        return elem[event] = fn;�
64      }�
65    };�
66�
67    Util.prototype.removeEvent = function(elem, event, fn) {�
68      if (elem.removeEventListener != null) {�
69        return elem.removeEventListener(event, fn, false);�
70      } else if (elem.detachEvent != null) {�
71        return elem.detachEvent("on" + event, fn);�
72      } else {�
73        return delete elem[event];�
74      }�
75    };�
76�
77    Util.prototype.innerHeight = function() {�
78      if ('innerHeight' in window) {�
79        return window.innerHeight;�
80      } else {�
81        return document.documentElement.clientHeight;�
82      }�
83    };�
84�
85    return Util;�
86�
87  })();�
88�
89  WeakMap = this.WeakMap || this.MozWeakMap || (WeakMap = (function() {�
90    function WeakMap() {�
91      this.keys = [];�
92      this.values = [];�
93    }�
94�
95    WeakMap.prototype.get = function(key) {�
96      var i, item, j, len, ref;�
97      ref = this.keys;�
98      for (i = j = 0, len = ref.length; j < len; i = ++j) {�
99        item = ref[i];�
100        if (item === key) {�
101          return this.values[i];�
102        }�
103      }�
104    };�
105�
106    WeakMap.prototype.set = function(key, value) {�
107      var i, item, j, len, ref;�
108      ref = this.keys;�
109      for (i = j = 0, len = ref.length; j < len; i = ++j) {�
110        item = ref[i];�
111        if (item === key) {�
112          this.values[i] = value;�
113          return;�
114        }�
115      }�
116      this.keys.push(key);�
117      return this.values.push(value);�
118    };�
119�
120    return WeakMap;�
121�
122  })());�
123�
124  MutationObserver = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (MutationObserver = (function() {�
125    function MutationObserver() {�
126      if (typeof console !== "undefined" && console !== null) {�
127        console.warn('MutationObserver is not supported by your browser.');�
128      }�
129      if (typeof console !== "undefined" && console !== null) {�
130        console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.');�
131      }�
132    }�
133�
134    MutationObserver.notSupported = true;�
135�
136    MutationObserver.prototype.observe = function() {};�
137�
138    return MutationObserver;�
139�
140  })());�
141�
142  getComputedStyle = this.getComputedStyle || function(el, pseudo) {�
143    this.getPropertyValue = function(prop) {�
144      var ref;�
145      if (prop === 'float') {�
146        prop = 'styleFloat';�
147      }�
148      if (getComputedStyleRX.test(prop)) {�
149        prop.replace(getComputedStyleRX, function(_, _char) {�
150          return _char.toUpperCase();�
151        });�
152      }�
153      return ((ref = el.currentStyle) != null ? ref[prop] : void 0) || null;�
154    };�
155    return this;�
156  };�
157�
158  getComputedStyleRX = /(\-([a-z]){1})/g;�
159�
160  this.WOW = (function() {�
161    WOW.prototype.defaults = {�
162      boxClass: 'wow',�
163      animateClass: 'animated',�
164      offset: 0,�
165      mobile: true,�
166      live: true,�
167      callback: null,�
168      scrollContainer: null�
169    };�
170�
171    function WOW(options) {�
172      if (options == null) {�
173        options = {};�
174      }�
175      this.scrollCallback = bind(this.scrollCallback, this);�
176      this.scrollHandler = bind(this.scrollHandler, this);�
177      this.resetAnimation = bind(this.resetAnimation, this);�
178      this.start = bind(this.start, this);�
179      this.scrolled = true;�
180      this.config = this.util().extend(options, this.defaults);�
181      if (options.scrollContainer != null) {�
182        this.config.scrollContainer = document.querySelector(options.scrollContainer);�
183      }�
184      this.animationNameCache = new WeakMap();�
185      this.wowEvent = this.util().createEvent(this.config.boxClass);�
186    }�
187�
188    WOW.prototype.init = function() {�
189      var ref;�
190      this.element = window.document.documentElement;�
191      if ((ref = document.readyState) === "interactive" || ref === "complete") {�
192        this.start();�
193      } else {�
194        this.util().addEvent(document, 'DOMContentLoaded', this.start);�
195      }�
196      return this.finished = [];�
197    };�
198�
199    WOW.prototype.start = function() {�
200      var box, j, len, ref;�
201      this.stopped = false;�
202      this.boxes = (function() {�
203        var j, len, ref, results;�
204        ref = this.element.querySelectorAll("." + this.config.boxClass);�
205        results = [];�
206        for (j = 0, len = ref.length; j < len; j++) {�
207          box = ref[j];�
208          results.push(box);�
209        }�
210        return results;�
211      }).call(this);�
212      this.all = (function() {�
213        var j, len, ref, results;�
214        ref = this.boxes;�
215        results = [];�
216        for (j = 0, len = ref.length; j < len; j++) {�
217          box = ref[j];�
218          results.push(box);�
219        }�
220        return results;�
221      }).call(this);�
222      if (this.boxes.length) {�
223        if (this.disabled()) {�
224          this.resetStyle();�
225        } else {�
226          ref = this.boxes;�
227          for (j = 0, len = ref.length; j < len; j++) {�
228            box = ref[j];�
229            this.applyStyle(box, true);�
230          }�
231        }�
232      }�
233      if (!this.disabled()) {�
234        this.util().addEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler);�
235        this.util().addEvent(window, 'resize', this.scrollHandler);�
236        this.interval = setInterval(this.scrollCallback, 50);�
237      }�
238      if (this.config.live) {�
239        return new MutationObserver((function(_this) {�
240          return function(records) {�
241            var k, len1, node, record, results;�
242            results = [];�
243            for (k = 0, len1 = records.length; k < len1; k++) {�
244              record = records[k];�
245              results.push((function() {�
246                var l, len2, ref1, results1;�
247                ref1 = record.addedNodes || [];�
248                results1 = [];�
249                for (l = 0, len2 = ref1.length; l < len2; l++) {�
250                  node = ref1[l];�
251                  results1.push(this.doSync(node));�
252                }�
253                return results1;�
254              }).call(_this));�
255            }�
256            return results;�
257          };�
258        })(this)).observe(document.body, {�
259          childList: true,�
260          subtree: true�
261        });�
262      }�
263    };�
264�
265    WOW.prototype.stop = function() {�
266      this.stopped = true;�
267      this.util().removeEvent(this.config.scrollContainer || window, 'scroll', this.scrollHandler);�
268      this.util().removeEvent(window, 'resize', this.scrollHandler);�
269      if (this.interval != null) {�
270        return clearInterval(this.interval);�
271      }�
272    };�
273�
274    WOW.prototype.sync = function(element) {�
275      if (MutationObserver.notSupported) {�
276        return this.doSync(this.element);�
277      }�
278    };�
279�
280    WOW.prototype.doSync = function(element) {�
281      var box, j, len, ref, results;�
282      if (element == null) {�
283        element = this.element;�
284      }�
285      if (element.nodeType !== 1) {�
286        return;�
287      }�
288      element = element.parentNode || element;�
289      ref = element.querySelectorAll("." + this.config.boxClass);�
290      results = [];�
291      for (j = 0, len = ref.length; j < len; j++) {�
292        box = ref[j];�
293        if (indexOf.call(this.all, box) < 0) {�
294          this.boxes.push(box);�
295          this.all.push(box);�
296          if (this.stopped || this.disabled()) {�
297            this.resetStyle();�
298          } else {�
299            this.applyStyle(box, true);�
300          }�
301          results.push(this.scrolled = true);�
302        } else {�
303          results.push(void 0);�
304        }�
305      }�
306      return results;�
307    };�
308�
309    WOW.prototype.show = function(box) {�
310      this.applyStyle(box);�
311      box.className = box.className + " " + this.config.animateClass;�
312      if (this.config.callback != null) {�
313        this.config.callback(box);�
314      }�
315      this.util().emitEvent(box, this.wowEvent);�
316      this.util().addEvent(box, 'animationend', this.resetAnimation);�
317      this.util().addEvent(box, 'oanimationend', this.resetAnimation);�
318      this.util().addEvent(box, 'webkitAnimationEnd', this.resetAnimation);�
319      this.util().addEvent(box, 'MSAnimationEnd', this.resetAnimation);�
320      return box;�
321    };�
322�
323    WOW.prototype.applyStyle = function(box, hidden) {�
324      var delay, duration, iteration;�
325      duration = box.getAttribute('data-wow-duration');�
326      delay = box.getAttribute('data-wow-delay');�
327      iteration = box.getAttribute('data-wow-iteration');�
328      return this.animate((function(_this) {�
329        return function() {�
330          return _this.customStyle(box, hidden, duration, delay, iteration);�
331        };�
332      })(this));�
333    };�
334�
335    WOW.prototype.animate = (function() {�
336      if ('requestAnimationFrame' in window) {�
337        return function(callback) {�
338          return window.requestAnimationFrame(callback);�
339        };�
340      } else {�
341        return function(callback) {�
342          return callback();�
343        };�
344      }�
345    })();�
346�
347    WOW.prototype.resetStyle = function() {�
348      var box, j, len, ref, results;�
349      ref = this.boxes;�
350      results = [];�
351      for (j = 0, len = ref.length; j < len; j++) {�
352        box = ref[j];�
353        results.push(box.style.visibility = 'visible');�
354      }�
355      return results;�
356    };�
357�
358    WOW.prototype.resetAnimation = function(event) {�
359      var target;�
360      if (event.type.toLowerCase().indexOf('animationend') >= 0) {�
361        target = event.target || event.srcElement;�
362        return target.className = target.className.replace(this.config.animateClass, '').trim();�
363      }�
364    };�
365�
366    WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) {�
367      if (hidden) {�
368        this.cacheAnimationName(box);�
369      }�
370      box.style.visibility = hidden ? 'hidden' : 'visible';�
371      if (duration) {�
372        this.vendorSet(box.style, {�
373          animationDuration: duration�
374        });�
375      }�
376      if (delay) {�
377        this.vendorSet(box.style, {�
378          animationDelay: delay�
379        });�
380      }�
381      if (iteration) {�
382        this.vendorSet(box.style, {�
383          animationIterationCount: iteration�
384        });�
385      }�
386      this.vendorSet(box.style, {�
387        animationName: hidden ? 'none' : this.cachedAnimationName(box)�
388      });�
389      return box;�
390�
391    };�
392�
393    WOW.prototype.vendors = ["moz", "webkit"];�
394�
395    WOW.prototype.vendorSet = function(elem, properties) {�
396      var name, results, value, vendor;�
397      results = [];�
398      for (name in properties) {�
399        value = properties[name];�
400        elem["" + name] = value;�
401        results.push((function() {�
402          var j, len, ref, results1;�
403          ref = this.vendors;�
404          results1 = [];�
405          for (j = 0, len = ref.length; j < len; j++) {�
406            vendor = ref[j];�
407            results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value);�
408          }�
409          return results1;�
410        }).call(this));�
411      }�
412      return results;�
413    };�
414�
415    WOW.prototype.vendorCSS = function(elem, property) {�
416      var j, len, ref, result, style, vendor;�
417      style = getComputedStyle(elem);�
418      result = style.getPropertyCSSValue(property);�
419      ref = this.vendors;�
420      for (j = 0, len = ref.length; j < len; j++) {�
421        vendor = ref[j];�
422        result = result || style.getPropertyCSSValue("-" + vendor + "-" + property);�
423      }�
424      return result;�
425    };�
426�
427    WOW.prototype.animationName = function(box) {�
428      var animationName;�
429      try {�
430        animationName = this.vendorCSS(box, 'animation-name').cssText;�
431      } catch (_error) {�
432        animationName = getComputedStyle(box).getPropertyValue('animation-name');�
433      }�
434      if (animationName === 'none') {�
435        return '';�
436      } else {�
437        return animationName;�
438      }�
439    };�
440�
441    WOW.prototype.cacheAnimationName = function(box) {�
442      return this.animationNameCache.set(box, this.animationName(box));�
443    };�
444�
445    WOW.prototype.cachedAnimationName = function(box) {�
446      return this.animationNameCache.get(box);�
447    };�
448�
449    WOW.prototype.scrollHandler = function() {�
450      return this.scrolled = true;�
451    };�
452�
453    WOW.prototype.scrollCallback = function() {�
454      var box;�
455      if (this.scrolled) {�
456        this.scrolled = false;�
457        this.boxes = (function() {�
458          var j, len, ref, results;�
459          ref = this.boxes;�
460          results = [];�
461          for (j = 0, len = ref.length; j < len; j++) {�
462            box = ref[j];�
463            if (!(box)) {�
464              continue;�
465            }�
466            if (this.isVisible(box)) {�
467              this.show(box);�
468              continue;�
469            }�
470            results.push(box);�
471          }�
472          return results;�
473        }).call(this);�
474        if (!(this.boxes.length || this.config.live)) {�
475          return this.stop();�
476        }�
477      }�
478    };�
479�
480    WOW.prototype.offsetTop = function(element) {�
481      var top;�
482      while (element.offsetTop === void 0) {�
483        element = element.parentNode;�
484      }�
485      top = element.offsetTop;�
486      while (element = element.offsetParent) {�
487        top += element.offsetTop;�
488      }�
489      return top;�
490    };�
491�
492    WOW.prototype.isVisible = function(box) {�
493      var bottom, offset, top, viewBottom, viewTop;�
494      offset = box.getAttribute('data-wow-offset') || this.config.offset;�
495      viewTop = (this.config.scrollContainer && this.config.scrollContainer.scrollTop) || window.pageYOffset;�
496      viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset;�
497      top = this.offsetTop(box);�
498      bottom = top + box.clientHeight;�
499      return top <= viewBottom && bottom >= viewTop;�
500    };�
501�
502    WOW.prototype.util = function() {�
503      return this._util != null ? this._util : this._util = new Util();�
504    };�
505�
506    WOW.prototype.disabled = function() {�
507      return !this.config.mobile && this.util().isMobile(navigator.userAgent);�
508    };�
509�
510    return WOW;�
511�
512  })();�
513�
514}).call(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.