CSS Animations are merged into Animations when they intersect.
321906
function(sortedInputEvents) {
      var animationEvents = this.modelHelper.browserHelper.
          getAllAsyncSlicesMatching(function(event) {
            return ((event.title === CSS_ANIMATION_TITLE) &&
                    (event.duration > 0));
      });

      var animationRanges = [];
      animationEvents.forEach(function(event) {
        animationRanges.push({
          min: event.start,
          max: event.end,
          event: event
        });
      });

      function merge(ranges) {
        var protoIR = new ProtoIR(ProtoIR.ANIMATION_TYPE, CSS_IR_NAME);
        ranges.forEach(function(range) {
          protoIR.pushEvent(range.event);
        });
        return protoIR;
      }

      return tr.b.mergeRanges(animationRanges,
                              ANIMATION_MERGE_THRESHOLD_MS,
                              merge);
    }
492345
function () {
    this.updateConfig();
    this.animation.began = true;
    this.time = 0;
    this.animationIsPlaying = true;
    this.stopRelatedAnimations();
    this.el.emit('animationbegin', this.eventDetail, false);
  }
317283
function Animation(gridSize) {
  // setup timeline

  // the timeline generates shader chunks where an animation step is baked into.
  // each prefab will execute the same animation, with in offset position and time (delay).
  var timeline = new BAS.Timeline();

  //// scale down
  timeline.add(1.0, {
    scale: {
      to: new THREE.Vector3(1.4, 0.4, 1.4),
      ease: 'easeCubicOut'
    }
  });
  // scale up
  timeline.add(0.5, {
    scale: {
      to: new THREE.Vector3(0.4, 3.0, 0.4),
      ease: 'easeCubicIn'
    }
  });
  // move up + rotate
  timeline.add(1.0, {
    translate: {
      to: new THREE.Vector3(0.0, 6.0, 0.0),
      ease: 'easeCubicOut'
    },
    rotate: {
      from: {
        axis: new THREE.Vector3(0, 1, 0),
        angle: 0,
      },
      to: {
        angle: Math.PI
      },
      ease: 'easeCubicIn'
    }
  });
  // move down
  timeline.add(0.5, {
    translate: {
      to: new THREE.Vector3(0.0, 0.0, 0.0),
      ease: 'easeCubicIn'
    }
  });
  // land + squish
  timeline.add(0.5, {
    scale: {
      to: new THREE.Vector3(1.4, 0.4, 1.4),
      ease: 'easeCubicOut'
    }
  });
  // un-squish
  timeline.add(1.5, {
    scale: {
      to: new THREE.Vector3(1.0, 1.0, 1.0),
      ease: 'easeBackOut'
    }
  });

  // setup prefab
  var prefabSize = 0.5;
  var prefab = new THREE.BoxGeometry(prefabSize, prefabSize, prefabSize);
  prefab.translate(0, prefabSize * 0.5, 0);

  // setup prefab geometry
  var prefabCount = gridSize * gridSize;
  var geometry = new BAS.PrefabBufferGeometry(prefab, prefabCount);

  var aPosition = geometry.createAttribute('aPosition', 3);
  var aDelayDuration = geometry.createAttribute('aDelayDuration', 2);
  var index = 0;
  var dataArray = [];
  var maxDelay = gridSize === 1 ? 0 : 4.0;

  this.totalDuration = timeline.duration + maxDelay;

  for (var i = 0; i < gridSize; i++) {
    for (var j = 0; j < gridSize; j++) {
      var x = THREE.Math.mapLinear(i, 0, gridSize, -gridSize * 0.5, gridSize * 0.5) + 0.5;
      var z = THREE.Math.mapLinear(j, 0, gridSize, -gridSize * 0.5, gridSize * 0.5) + 0.5;

      // position
      dataArray[0] = x;
      dataArray[1] = 0;
      dataArray[2] = z;
      geometry.setPrefabData(aPosition, index, dataArray);

      // animation
      dataArray[0] = maxDelay * Math.sqrt(x * x + z * z) / gridSize;
      dataArray[1] = timeline.duration;
      geometry.setPrefabData(aDelayDuration, index, dataArray);

      index++;
    }
  }

  var material = new BAS.StandardAnimationMaterial({
    flatShading: true,
    uniforms: {
      uTime: {value: 0}
    },
    uniformValues: {
      diffuse: new THREE.Color(0x888888),
      metalness: 1.0,
      roughness: 1.0
    },
    vertexFunctions: [
      // the eases used by the timeline defined above
      BAS.ShaderChunk['ease_cubic_in'],
      BAS.ShaderChunk['ease_cubic_out'],
      BAS.ShaderChunk['ease_cubic_in_out'],
      BAS.ShaderChunk['ease_back_out'],
      BAS.ShaderChunk['quaternion_rotation'],
      // getChunks outputs the shader chunks where the animation is baked into
    ].concat(timeline.compile()),
    vertexParameters: [
      'uniform float uTime;',

      'attribute vec3 aPosition;',
      'attribute vec2 aDelayDuration;'
    ],
    vertexPosition: [
      // calculate animation time for the prefab
      'float tTime = clamp(uTime - aDelayDuration.x, 0.0, aDelayDuration.y);',

      // apply timeline transformations based on 'tTime'
      timeline.getTransformCalls('scale'),
      timeline.getTransformCalls('rotate'),
      timeline.getTransformCalls('translate'),

      // translate the vertex by prefab position
      'transformed += aPosition;'
    ]
  });

  THREE.Mesh.call(this, geometry, material);

  this.frustumCulled = false;
}
301636
function (changes) {
            if (this.__isStopped) {
                this.__queuedChanges = changes.concat(this.__queuedChanges);
                return;
            }

            var sorted = this.__sortPaths();
            // var loaded = this.__textLoaded;
            var totalSelectors = 0;
            var styleBuilders = {};
            var utilsArray = ariaUtilsArray;

            for (var i = 0, len = sorted.length; i < len; i += 1) {
                var cssPath = sorted[i];
                var styleTagId = this.__styleTagAssociation[cssPath];

                if (!utilsArray.contains(changes, styleTagId)) {
                    // This tag shouldn't be updated
                    continue;
                } else if (!styleBuilders[styleTagId]) {
                    styleBuilders[styleTagId] = [];
                }

                styleBuilders[styleTagId].push("/**", cssPath, "**/", this.__textLoaded[cssPath].text);

                totalSelectors += this.__textLoaded[cssPath].lines || 0;
            }

            // IE only allows 4096 selectors, warn the user on any browser
            if (totalSelectors > 4000) {
                this.$logWarn(this.CSSTEMPLATE_MAX_SELECTORS_REACHED);
            }

            return this.__reloadStyleTags(styleBuilders);
            // returning something is important for unit tests
        }
1156123
function () {
            if (!this.domElement) {
                return;
            }

            if (this.conf.animateOut) {
                this._startAnimation(this.conf.animateOut, {
                    from : this.domElement,
                    type : 1
                }, true);
            } else {
                this.domElement.style.cssText = "position:absolute;display:none;overflow:auto;";
            }

            if (this.modalMaskDomElement) {

                // if there was was an animation defined we need to fade out the background for model popups
                if (this.conf.animateIn) {
                    this._getMaskAnimator().start("fade reverse", {
                        from : this.modalMaskDomElement,
                        type : 1
                    });
                } else {
                    this.modalMaskDomElement.style.cssText = "position:absolute;display:none";
                }

                if (this._containerOverflow != -1) {
                    this.popupContainer.changeContainerOverflow(this._containerOverflow);
                    this._containerOverflow = -1;
                }
            }
        }
516078
function() {
        if (this.options.animation === 'fade') {
            return;
        }

        var dimension = this._dimension, // height or width
            containerSize = 0,
            sizes = [];

        this.container.removeAttr('style');

        this.items.each(function() {
            var item = $(this).removeAttr('style'),
                size = item[dimension](),
                marginStart = parseInt(item.css('margin-' + (dimension === 'width' ? 'left' : 'top')), 10),
                marginEnd = parseInt(item.css('margin-' + (dimension === 'width' ? 'right' : 'bottom')), 10),
                totalSize = size + marginStart + marginEnd;

            containerSize += totalSize;

            sizes.push({
                size: size,
                totalSize: totalSize,
                marginStart: marginStart,
                marginEnd: marginEnd,
                clone: item.hasClass('is-cloned')
            });

            // Set the size of the item explicitly
            item.css(dimension, size);
        });

        // Store the sizes
        this._sizes = sizes;

        // Set the container width/height
        this.container.css(dimension, containerSize);
    }
195401
function () {
        if (u.hasClass(this._header, this._CssClasses.IS_COMPACT)) {
            u.removeClass(this._header, this._CssClasses.IS_COMPACT);
            u.addClass(this._header, this._CssClasses.IS_ANIMATING);
        }
    }
445686
function(animation) {

		var template = this._templates_by_animation_guid[animation.guid];

		if (animation.isReversed()) {

			this._onRemovalComplete(animation, template);
			this._fire('removal_complete', template);

		} else {

			this._onInsertionComplete(animation, template);
			this._fire('insertion_complete', template);

		}

		delete this._templates_by_animation_guid[animation.guid];
		delete this._animations_by_template_guid[template.guid];

	}
177372
function () {
		var options = this.options,
			loadingDiv = this.loadingDiv;

		if (loadingDiv) {
			animate(loadingDiv, {
				opacity: 0
			}, {
				duration: options.loading.hideDuration || 100,
				complete: function () {
					css(loadingDiv, { display: NONE });
				}
			});
		}
		this.loadingShown = false;
	}
984569
function collides(element_one, element_two) {

	var result,
	    rect1,
	    rect2;

	if (element_one.nodeName) {
		rect1 = element_one.getBoundingClientRect();
	} else {
		rect1 = element_one;
	}

	if (element_two.nodeName) {
		rect2 = element_two.getBoundingClientRect();
	} else {
		rect2 = element_two;
	}

	result = !(
		rect1.top    > rect2.bottom ||
		rect1.right  < rect2.left ||
		rect1.bottom < rect2.top ||
		rect1.left   > rect2.right
	);

	return result;
}
241989
function animateElement(element, animation = '', callback = false) {
    if (!element || animation === '') {
        return false;
    }
    if (animation == 'none') {
        if (utils.isFunction(callback))
            callback()
        return false;
    }
    const animationNames = animation.split(' ')
    each(animationNames, (name) => {
        addClass(element, 'g'+name)
    })
    addEvent(animationEnd, {
        onElement: element,
        avoidDuplicate: false,
        once: true,
        withCallback: (event, target) => {
            each(animationNames, (name) => {
                removeClass(target, 'g' + name)
            })
            if (utils.isFunction(callback))
                callback()
        }
    })
}
545170
function destructShorthand(css) {
    css.walkDecls(PATTERN_BACKGROUND, (decl) => {
        if (!isNodeIgnored(decl)) {
            const value = decl.value;
            const hasURL = PATTERN_URL.test(value);

            if (hasURL) {
                let valueStartBgColor = '';
                let valueEndBgColor = '';
                const layers = value
                    .replace(PATTERN_START_BACKGROUND_COLOR, (match) => {
                        valueStartBgColor = match;

                        return '';
                    })
                    .replace(PATTERN_END_BACKGROUND_COLOR, (match) => {
                        valueEndBgColor = match;

                        return '';
                    })
                    .split(/,/)
                    .reduce((result, subLine, index) => {
                        if (index === 0) {
                            return [
                                subLine,
                            ];
                        }

                        const indexLast = result.length - 1;
                        const subLineLast = result[indexLast];

                        if ((subLineLast.match(/\(/g) || []).length !== (subLineLast.match(/\)/g) || []).length) {
                            const lastItem = `${result[indexLast]},${subLine}`;

                            return [
                                ...result.slice(0, -1),
                                lastItem,
                            ];
                        }

                        return [
                            ...result,
                            subLine,
                        ];
                    }, []);
                const isMultiple = layers.length > 1;

                // Calculate 'background-image' value
                const valueURL = layers
                    .map((layer) => {
                        const hasURLValue = PATTERN_URL.test(layer);
                        const valueGradient = layer.match(PATTERN_GRADIENT) ? layer.match(PATTERN_GRADIENT)[0] : null;

                        if (hasURLValue) {
                            return layer
                                .replace(/(?:[^\s]+[\s]+)*(url\([^)]*\))(?:[\s]+[^\s]+)*/ig, '$1');
                        }

                        if (valueGradient) {
                            return layer
                                .replace(/([^\s]+(?:[\s]+[^\s]+)*)/ig, valueGradient);
                        }

                        return layer
                            .replace(/[^\s]+(?:[\s]+[^\s]+)*/ig, 'initial');
                    })
                    .join(',');

                decl.cloneAfter({
                    prop: 'background-image',
                    value: valueURL.trim(),
                });

                // Calculate 'background' value
                const valueRest = layers
                    .map((layer) => {
                        const hasURLValue = PATTERN_URL.test(layer);

                        if (!hasURLValue) {
                            return layer;
                        }

                        return layer
                            .replace(
                                /([^\s]+[\s]+)*(?:url\([^)]*\)(?:[\s]+(?=[^\s]))?)([^\s]+[\s]*[^\s]+)*/ig,
                                (match, group1, group2) => {
                                    const startPart = group1 || '';
                                    const endPart = group2 || '';
                                    const result = (`${startPart}${endPart}`);

                                    if (isMultiple && !result.trim()) {
                                        return `${startPart}initial${endPart}`;
                                    }

                                    return result;
                                }
                            );
                    })
                    .join(',');

                if (
                    !valueStartBgColor.trim() &&
                    !valueEndBgColor.trim() &&
                    !valueRest.replace(/(?:initial)|[\s,]+/ig, '')
                ) {
                    decl.remove();
                } else {
                    decl.replaceWith(decl.clone({
                        value: `${valueStartBgColor}${valueRest}${valueEndBgColor}`.trim(),
                    }));
                }
            }
        }
    });
}
1330079
function () {
        if (u.hasClass(this._header, this._CssClasses.IS_ANIMATING)) {
            return;
        }

        if (this._content.scrollTop > 0 && !u.hasClass(this._header, this._CssClasses.IS_COMPACT)) {
            u.addClass(this._header, this._CssClasses.CASTING_SHADOW)
                .addClass(this._header, this._CssClasses.IS_COMPACT)
                .addClass(this._header, this._CssClasses.IS_ANIMATING);
        } else if (this._content.scrollTop <= 0 && u.hasClass(this._header, this._CssClasses.IS_COMPACT)) {
            u.removeClass(this._header, this._CssClasses.CASTING_SHADOW)
                .removeClass(this._header, this._CssClasses.IS_COMPACT)
                .addClass(this._header, this._CssClasses.IS_ANIMATING);
        }
    }
331076
public boolean mergeCSSFrom(CSSClassManager other) throws CSSNamingConflict {
    for (CSSClass clss : other.getClasses()) {
      this.addClass(clss);
    }
    return true;
  }
995879
function() {
			//merge initial options
			_opt = merge(_def, opt);
			_opt.bgColor = hexToRgb(_opt.bgColor);
			_opt.textColor = hexToRgb(_opt.textColor);
			_opt.position = _opt.position.toLowerCase();
			_opt.animation = (animation.types['' + _opt.animation]) ? _opt.animation : _def.animation;

			var isUp = _opt.position.indexOf('up') > -1;
			var isLeft = _opt.position.indexOf('left') > -1;

			//transform animation
			if (isUp || isLeft) {
				for (var i = 0; i < animation.types['' + _opt.animation].length; i++) {
					var step = animation.types['' + _opt.animation][i];

					if (isUp) {
						if (step.y < 0.6) {
							step.y = step.y - 0.4;
						} else {
							step.y = step.y - 2 * step.y + (1 - step.w);
						}
					}

					if (isLeft) {
						if (step.x < 0.6) {
							step.x = step.x - 0.4;
						} else {
							step.x = step.x - 2 * step.x + (1 - step.h);
						}
					}

					animation.types['' + _opt.animation][i] = step;
				}
			}
			_opt.type = (type['' + _opt.type]) ? _opt.type : _def.type;
			try {
				_orig = link.getIcon();
				//create temp canvas
				_canvas = document.createElement('canvas');
				//create temp image
				_img = document.createElement('img');
				if (_orig.hasAttribute('href')) {
					_img.setAttribute('src', _orig.getAttribute('href'));
					//get width/height
					_img.onload = function() {
						_h = (_img.height > 0) ? _img.height : 32;
						_w = (_img.width > 0) ? _img.width : 32;
						_canvas.height = _h;
						_canvas.width = _w;
						_context = _canvas.getContext('2d');
						icon.ready();
					};
				} else {
					_img.setAttribute('src', '');
					_h = 32;
					_w = 32;
					_img.height = _h;
					_img.width = _w;
					_canvas.height = _h;
					_canvas.width = _w;
					_context = _canvas.getContext('2d');
					icon.ready();
				}
			} catch(e) {
				throw 'Error initializing favico. Message: ' + e.message;
			}

		}
3244
function Animation(modelGeometry) {
  var geometry = new BAS.ModelBufferGeometry(modelGeometry);

  var i, j;

  var aOffsetAmplitude = geometry.createAttribute('aOffsetAmplitude', 2);
  var positionBuffer = geometry.getAttribute('position').array;
  var x, y, distance;

  for (i = 0; i < aOffsetAmplitude.array.length; i += 12) { // 6 * 2
    var offset = THREE.Math.randFloat(1, 4);
    var amplitude = THREE.Math.randFloat(0.5, 1.0);

    x = 0;
    y = 0;

    // x/y position of the corresponding vertex from the position buffer
    for (j = 0; j < 6; j += 2) {
      x += positionBuffer[(i + j) / 2 * 3];
      y += positionBuffer[(i + j) / 2 * 3 + 1];
    }

    x /= 3;
    y /= 3;

    distance = Math.sqrt(x * x + y * y);

    for (j = 0; j < 12; j += 2) {
      aOffsetAmplitude.array[i + j]     = (distance + offset) * (1.0 + THREE.Math.randFloatSpread(0.0125));
      aOffsetAmplitude.array[i + j + 1] = amplitude;
    }
  }

  var aColor = geometry.createAttribute('color', 3);
  var color = new THREE.Color();

  for (i = 0; i < aColor.array.length; i += 18) { // 6 * 3
    color.setHSL(0, 0, THREE.Math.randFloat(0.5, 1.0));

    for (j = 0; j < 18; j += 3) {
      aColor.array[i + j]     = color.r;
      aColor.array[i + j + 1] = color.g;
      aColor.array[i + j + 2] = color.b;
    }
  }

  var material = new BAS.StandardAnimationMaterial({
    flatShading: true,
    vertexColors: THREE.VertexColors,
    transparent: true,
    side: THREE.DoubleSide,
    uniforms: {
      uTime: {value: 0},
      uD: {value: 4.4},
      uA: {value: 3.2}
    },
    uniformValues: {
      diffuse: new THREE.Color(0x9B111E),
      roughness: 0.2,
      metalness: 0.8,
      opacity: 0.8
    },
    vertexFunctions: [
      BAS.ShaderChunk['ease_cubic_in_out']
    ],
    vertexParameters: [
      'uniform float uTime;',
      'uniform float uD;',
      'uniform float uA;',
      'attribute vec2 aOffsetAmplitude;'
    ],
    vertexPosition: [
      'float tProgress = sin(uTime + aOffsetAmplitude.x / uD);',
      'tProgress = easeCubicInOut(tProgress);',
      'transformed.z += aOffsetAmplitude.y * uA * tProgress;'
    ]
  });

  geometry.computeVertexNormals();

  THREE.Mesh.call(this, geometry, material);

  this.frustumCulled = false;
}
624570
function Animation() {
  const startPositionGeometry = new THREE.TorusKnotGeometry(100, 50, 128, 32, 1, 2)
  const endPositionGeometry = new THREE.TorusKnotGeometry(100, 50, 128, 32, 1, 8)

  const prefab = new THREE.TorusKnotBufferGeometry(4, 0.5);
  const prefabCount = startPositionGeometry.vertices.length;
  const geometry = new BAS.InstancedPrefabBufferGeometry(prefab, prefabCount);

  const duration = 1.0;
  const maxPrefabDelay = 0.5;

  // used in the Animation.animate function below
  this.totalDuration = duration + maxPrefabDelay;

  geometry.createAttribute('aDelayDuration', 2, function(data) {
    data[0] = Math.random() * maxPrefabDelay;
    data[1] = duration;
  });

  const aStartPosition = geometry.createAttribute('aStartPosition', 3);
  const aEndPosition = geometry.createAttribute('aEndPosition', 3);
  const prefabData = [];

  for (let i = 0; i < prefabCount; i++) {
    geometry.setPrefabData(aStartPosition, i, startPositionGeometry.vertices[i].toArray(prefabData));
    geometry.setPrefabData(aEndPosition, i, endPositionGeometry.vertices[i].toArray(prefabData));
  }

  const axis = new THREE.Vector3();

  geometry.createAttribute('aAxisAngle', 4, function(data) {
    axis.x = THREE.Math.randFloatSpread(2);
    axis.y = THREE.Math.randFloatSpread(2);
    axis.z = THREE.Math.randFloatSpread(2);
    axis.normalize();
    axis.toArray(data);

    data[3] = Math.PI * 4;
  });

  const material = new BAS.ToonAnimationMaterial({
    uniforms: {
      uTime: {value: 0}
    },
    uniformValues: {
      gradientMap: new THREE.TextureLoader().load('../_tex/fox_gradient_map.png')
    },
    vertexFunctions: [
      BAS.ShaderChunk['ease_cubic_in_out'],
      BAS.ShaderChunk['ease_quad_out'],
      BAS.ShaderChunk['quaternion_rotation']
    ],
    vertexParameters: [
      'uniform float uTime;',
      'attribute vec2 aDelayDuration;',
      'attribute vec3 aStartPosition;',
      'attribute vec3 aEndPosition;',
      'attribute vec4 aAxisAngle;'
    ],
    vertexInit: [
      'float tProgress = clamp(uTime - aDelayDuration.x, 0.0, aDelayDuration.y) / aDelayDuration.y;',
      'tProgress = easeCubicInOut(tProgress);',
      'vec4 tQuat = quatFromAxisAngle(aAxisAngle.xyz, aAxisAngle.w * tProgress);'
    ],
    vertexNormal: [
      'objectNormal = rotateVector(tQuat, objectNormal);'
    ],
    vertexPosition: [
      'transformed = rotateVector(tQuat, transformed);',
      'transformed += mix(aStartPosition, aEndPosition, tProgress);',
    ]
  });

  geometry.computeVertexNormals();

  THREE.Mesh.call(this, geometry, material);

  this.frustumCulled = false;
}