PageSourceSearch

https://lcxw.cn/asset/js/wow.js

js lcxw.cn collected 2026-10-02 08:33:38 UTC 14,019 bytes, 457 lines download raw bytes

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

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.