Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Webpack support #684

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions scrollmagic/uncompressed/plugins/animation.gsap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* The javascript library for magical scroll interactions.
* (c) 2015 Jan Paepke (@janpaepke)
* Project Website: http://scrollmagic.io
*
*
* @version 2.0.5
* @license Dual licensed under MIT license and GPL.
* @author Jan Paepke - [email protected]
Expand All @@ -15,25 +15,24 @@
* Greensock License info at http://www.greensock.com/licensing/
*/
/**
* This plugin is meant to be used in conjunction with the Greensock Animation Plattform.
* This plugin is meant to be used in conjunction with the Greensock Animation Plattform.
* It offers an easy API to trigger Tweens or synchronize them to the scrollbar movement.
*
* Both the `lite` and the `max` versions of the GSAP library are supported.
* Both the `lite` and the `max` versions of the GSAP library are supported.
* The most basic requirement is `TweenLite`.
*
*
* To have access to this extension, please include `plugins/animation.gsap.js`.
* @requires {@link http://greensock.com/gsap|GSAP ~1.14.x}
* @mixin animation.GSAP
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ScrollMagic', 'TweenMax', 'TimelineMax'], factory);
define(['scrollmagic', 'gsap/TweenMax', 'gsap/TimelineMax'], factory);
} else if (typeof exports === 'object') {
// CommonJS
// Loads whole gsap package onto global scope.
require('gsap');
factory(require('scrollmagic'), TweenMax, TimelineMax);
factory(require('scrollmagic'), require('gsap/TweenMax'), require('gsap/TimelineMax'));
} else {
// Browser globals
factory(root.ScrollMagic || (root.jQuery && root.jQuery.ScrollMagic), root.TweenMax || root.TweenLite, root.TimelineMax || root.TimelineLite);
Expand All @@ -59,24 +58,24 @@
* ----------------------------------------------------------------
*/
/**
* Every instance of ScrollMagic.Scene now accepts an additional option.
* Every instance of ScrollMagic.Scene now accepts an additional option.
* See {@link ScrollMagic.Scene} for a complete list of the standard options.
* @memberof! animation.GSAP#
* @method new ScrollMagic.Scene(options)
* @example
* var scene = new ScrollMagic.Scene({tweenChanges: true});
*
* @param {object} [options] - Options for the Scene. The options can be updated at any time.
* @param {boolean} [options.tweenChanges=false] - Tweens Animation to the progress target instead of setting it.
* @param {boolean} [options.tweenChanges=false] - Tweens Animation to the progress target instead of setting it.
Does not affect animations where duration is `0`.
*/
/**
* **Get** or **Set** the tweenChanges option value.
* This only affects scenes with a duration. If `tweenChanges` is `true`, the progress update when scrolling will not be immediate, but instead the animation will smoothly animate to the target state.
* **Get** or **Set** the tweenChanges option value.
* This only affects scenes with a duration. If `tweenChanges` is `true`, the progress update when scrolling will not be immediate, but instead the animation will smoothly animate to the target state.
* For a better understanding, try enabling and disabling this option in the [Scene Manipulation Example](../examples/basic/scene_manipulation.html).
* @memberof! animation.GSAP#
* @method Scene.tweenChanges
*
*
* @example
* // get the current tweenChanges option
* var tweenChanges = scene.tweenChanges();
Expand Down Expand Up @@ -157,11 +156,11 @@
};

/**
* Add a tween to the scene.
* If you want to add multiple tweens, add them into a GSAP Timeline object and supply it instead (see example below).
*
* If the scene has a duration, the tween's duration will be projected to the scroll distance of the scene, meaning its progress will be synced to scrollbar movement.
* For a scene with a duration of `0`, the tween will be triggered when scrolling forward past the scene's trigger position and reversed, when scrolling back.
* Add a tween to the scene.
* If you want to add multiple tweens, add them into a GSAP Timeline object and supply it instead (see example below).
*
* If the scene has a duration, the tween's duration will be projected to the scroll distance of the scene, meaning its progress will be synced to scrollbar movement.
* For a scene with a duration of `0`, the tween will be triggered when scrolling forward past the scene's trigger position and reversed, when scrolling back.
* To gain better understanding, check out the [Simple Tweening example](../examples/basic/simple_tweening.html).
*
* Instead of supplying a tween this method can also be used as a shorthand for `TweenMax.to()` (see example below).
Expand Down Expand Up @@ -209,7 +208,7 @@
// wrap Tween into a Timeline Object if available to include delay and repeats in the duration and standardize methods.
if (Timeline) {
newTween = new Timeline({
smoothChildTiming: true
smoothChildTiming: true,
}).add(TweenObject);
} else {
newTween = TweenObject;
Expand Down Expand Up @@ -278,7 +277,7 @@
};

/**
* Remove the tween from the scene.
* Remove the tween from the scene.
* This will terminate the control of the Scene over the tween.
*
* Using the reset option you can decide if the tween should remain in the current state or be rewound to set the target elements back to the state they were in before the tween was added to the scene.
Expand Down Expand Up @@ -307,4 +306,4 @@
};

});
}));
}));
20 changes: 10 additions & 10 deletions scrollmagic/uncompressed/plugins/animation.velocity.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* The javascript library for magical scroll interactions.
* (c) 2015 Jan Paepke (@janpaepke)
* Project Website: http://scrollmagic.io
*
*
* @version 2.0.5
* @license Dual licensed under MIT license and GPL.
* @author Jan Paepke - [email protected]
Expand All @@ -15,20 +15,20 @@
* Velocity is published under MIT license.
*/
/**
* This plugin is meant to be used in conjunction with the Velocity animation framework.
* This plugin is meant to be used in conjunction with the Velocity animation framework.
* It offers an easy API to __trigger__ Velocity animations.
*
* With the current version of Velocity scrollbound animations (scenes with duration) are not supported.
* With the current version of Velocity scrollbound animations (scenes with duration) are not supported.
* This feature will be added as soon as Velocity provides the appropriate API.
*
*
* To have access to this extension, please include `plugins/animation.velocity.js`.
* @requires {@link http://julian.com/research/velocity/|Velocity ~1.2.0}
* @mixin animation.Velocity
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ScrollMagic', 'velocity'], factory);
define(['scrollmagic', 'velocity'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('scrollmagic'), require('velocity'));
Expand Down Expand Up @@ -84,7 +84,7 @@
// set reverse values
if (!velocity.Utilities.data(elem, _dataID)) {
velocity.Utilities.data(elem, _dataID, {
reverseProps: _util.css(elem, Object.keys(_properties))
reverseProps: _util.css(elem, Object.keys(_properties)),
});
}
// animate
Expand Down Expand Up @@ -136,7 +136,7 @@
};

/**
* Add a Velocity animation to the scene.
* Add a Velocity animation to the scene.
* The method accepts the same parameters as Velocity, with the first parameter being the target element.
*
* To gain better understanding, check out the [Velocity example](../examples/basic/simple_velocity.html).
Expand Down Expand Up @@ -186,7 +186,7 @@
return Scene;
};
/**
* Remove the animation from the scene.
* Remove the animation from the scene.
* This will stop the scene from triggering the animation.
*
* Using the reset option you can decide if the animation should remain in the current state or be rewound to set the target elements back to the state they were in before the animation was added to the scene.
Expand All @@ -210,7 +210,7 @@
}
if (reset) {
reverse(_elems, {
duration: 0
duration: 0,
});
}

Expand All @@ -222,4 +222,4 @@
return Scene;
};
});
}));
}));
46 changes: 23 additions & 23 deletions scrollmagic/uncompressed/plugins/debug.addIndicators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* The javascript library for magical scroll interactions.
* (c) 2015 Jan Paepke (@janpaepke)
* Project Website: http://scrollmagic.io
*
*
* @version 2.0.5
* @license Dual licensed under MIT license and GPL.
* @author Jan Paepke - [email protected]
Expand All @@ -21,7 +21,7 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ScrollMagic'], factory);
define(['scrollmagic'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('scrollmagic'));
Expand Down Expand Up @@ -67,7 +67,7 @@
};

/**
* Add visual indicators for a ScrollMagic.Scene.
* Add visual indicators for a ScrollMagic.Scene.
* @memberof! debug.addIndicators#
*
* @example
Expand All @@ -78,7 +78,7 @@
* scene.addIndicators({name: "pin scene", colorEnd: "#FFFFFF"});
*
* @param {object} [options] - An object containing one or more options for the indicators.
* @param {(string|object)} [options.parent=undefined] - A selector, DOM Object or a jQuery object that the indicators should be added to.
* @param {(string|object)} [options.parent=undefined] - A selector, DOM Object or a jQuery object that the indicators should be added to.
If undefined, the controller's container will be used.
* @param {number} [options.name=""] - This string will be displayed at the start and end indicators of the scene for identification purposes. If no name is supplied an automatic index will be used.
* @param {number} [options.indent=0] - Additional position offset for the indicators (useful, when having multiple scenes starting at the same position).
Expand Down Expand Up @@ -143,7 +143,7 @@
*/
// add option to globally auto-add indicators to scenes
/**
* Every ScrollMagic.Controller instance now accepts an additional option.
* Every ScrollMagic.Controller instance now accepts an additional option.
* See {@link ScrollMagic.Controller} for a complete list of the standard options.
* @memberof! debug.addIndicators#
* @method new ScrollMagic.Controller(options)
Expand All @@ -167,7 +167,7 @@
_isDocument = _info.isDocument,
_vertical = _info.vertical,
_indicators = { // container for all indicators and methods
groups: []
groups: [],
};

var log = function () {
Expand Down Expand Up @@ -215,7 +215,7 @@
this._indicators.updateBoundsPositions = function (specificIndicator) {
var // constant for all bounds
groups = specificIndicator ? [_util.extend({}, specificIndicator.triggerGroup, {
members: [specificIndicator]
members: [specificIndicator],
})] : // create a group with only one element
_indicators.groups,
// use all
Expand Down Expand Up @@ -244,7 +244,7 @@
container = _isDocument ? document.body : _container,
containerOffset = _isDocument ? {
top: 0,
left: 0
left: 0,
} : _util.get.offset(container, true),
edge = _vertical ? _util.get.width(_container) - EDGE_OFFSET : _util.get.height(_container) - EDGE_OFFSET,
paramDimension = _vertical ? "width" : "height",
Expand All @@ -260,12 +260,12 @@

_util.css(elem, {
top: containerOffset.top + (_vertical ? pos : edge - group.members[0].options.indent),
left: containerOffset.left + (_vertical ? edge - group.members[0].options.indent : pos)
left: containerOffset.left + (_vertical ? edge - group.members[0].options.indent : pos),
});
_util.css(elem.firstChild.firstChild, {
"-ms-transform": transform,
"-webkit-transform": transform,
"transform": transform
"transform": transform,
});
}
};
Expand Down Expand Up @@ -359,7 +359,7 @@
if (!isDocument && _util.css(_boundsContainer, "position") === 'static') {
// position mode needed for correct positioning of indicators
_util.css(_boundsContainer, {
position: "relative"
position: "relative",
});
}

Expand Down Expand Up @@ -443,7 +443,7 @@
"right": v ? options.indent : "",
"bottom": v ? "" : options.indent,
"left": v ? "" : "100%",
"padding": v ? "0 8px" : "2px 4px"
"padding": v ? "0 8px" : "2px 4px",
});
// append
_boundsContainer.appendChild(_elemBounds);
Expand All @@ -464,7 +464,7 @@
css[_vertical ? "height" : "width"] = Scene.duration();
_util.css(_elemBounds, css);
_util.css(_elemEnd, {
display: Scene.duration() > 0 ? "" : "none"
display: Scene.duration() > 0 ? "" : "none",
});
};

Expand All @@ -482,13 +482,13 @@
css[_vertical ? "border-top-width" : "border-left-width"] = 1;
_util.css(triggerElem.firstChild, css);
_util.css(triggerElem.firstChild.firstChild, {
padding: _vertical ? "0 8px 3px 8px" : "3px 4px"
padding: _vertical ? "0 8px 3px 8px" : "3px 4px",
});
document.body.appendChild(triggerElem); // directly add to body
var newGroup = {
triggerHook: Scene.triggerHook(),
element: triggerElem,
members: [Indicator]
members: [Indicator],
};
_ctrl._indicators.groups.push(newGroup);
Indicator.triggerGroup = newGroup;
Expand All @@ -504,7 +504,7 @@
};

// updates the trigger group -> either join existing or add new one
/*
/*
* Logic:
* 1 if a trigger group exist, check if it's in sync with Scene settings – if so, nothing else needs to happen
* 2 try to find an existing one that matches Scene parameters
Expand Down Expand Up @@ -598,15 +598,15 @@
"border-width": 0,
"border-style": "solid",
color: color,
"border-color": color
"border-color": color,
});
var e = document.createElement('div');
// wrapper
_util.css(e, {
position: "absolute",
overflow: "visible",
width: 0,
height: 0
height: 0,
});
e.appendChild(inner);
return e;
Expand All @@ -620,7 +620,7 @@
"border-width": 0,
"border-style": "solid",
color: color,
"border-color": color
"border-color": color,
});
return e;
},
Expand All @@ -631,7 +631,7 @@
overflow: "visible",
"white-space": "nowrap",
"pointer-events": "none",
"font-size": FONT_SIZE
"font-size": FONT_SIZE,
});
e.style.zIndex = ZINDEX;
return e;
Expand All @@ -651,7 +651,7 @@
"border-width": 0,
"border-style": "solid",
color: color,
"border-color": color
"border-color": color,
});
w.appendChild(inner);
// wrapper
Expand All @@ -661,12 +661,12 @@
overflow: "visible",
"white-space": "nowrap",
"pointer-events": "none",
"font-size": FONT_SIZE
"font-size": FONT_SIZE,
});
e.style.zIndex = ZINDEX;
e.appendChild(w);
return e;
},
};

}));
}));