Skip to content

Commit

Permalink
Comment updates and and changes doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Rycochet committed Feb 1, 2018
1 parent 5182912 commit e26106a
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 38 deletions.
6 changes: 3 additions & 3 deletions README.md
@@ -1,9 +1,9 @@
# Velocity 2.0.0
# Velocity 2.0.0 beta

# This is a dev branch - files are *not* available on CDN
# This is a public beta - files are *not* available on CDN

## Docs
[http://VelocityJS.org](http://velocityjs.org)
[https://github.com/julianshapiro/velocity/wiki](https://github.com/julianshapiro/velocity/wiki)

## News
WhatsApp, Tumblr, Windows, Samsung, Uber, and thousands of other companies rely on Velocity. Visit [Libscore.com](http://libscore.com/#$.Velocity) to see which sites use Velocity on their homepage.
Expand Down
22 changes: 22 additions & 0 deletions V2_CHANGES.md
@@ -0,0 +1,22 @@
# Major Changes in Velocity V2

* Transforms - Use these directly within CSS, don't try the old shortcuts as they don't exist.
* Colors - All web colors are supported internally.
* SVG - All SVG attributes are supported internally, though they must be placed on the correct type of element.
* Loop - This no longer copies the animation call, it calls it multiple times.
* Repeat - This is almost identical to loop, but only runs one way.
* Chaining - Chaining is awesome, use it. Chained commands are designed to operate on the chained animation, not on the elements within it.
* Styles - Use `element.velocity("style", "propertyName"[, value])`, the old .Hook has gone.
* Per-element - Animations are now copied per-element, and not one a one-animation-per-array basis as in other libraries (and old Velocity v1).
* Sync - You can now de-sync animations so they start immediately per-element, rather than waiting for all to be ready.
* Speed - You can control the speed of the animation playback.
* Delay - You can pass a negative number to start inside the animation rather than just having a delay before it.
* There are APIs for extending Velocity - see the various register* commands.
* Display - This is a property, no longer an option.
* Visibility - This is a property, no longer an option.

# Currently disabled / not updated:

* UI-Pack
* Reverse
* Scroll (working, but not happy with interface - it's a property if people want to play, alias of scrollTop, there's also scrollLeft)
18 changes: 12 additions & 6 deletions index.d.ts
Expand Up @@ -738,12 +738,15 @@ interface VelocityExtended<TNode extends Node = HTMLorSVGElement> {
// Action: Finish //
////////////////////
interface Velocity {
(action: "finish", queue?: string): VelocityResult;
(elements: VelocityElements, action: "finish", queue?: string): VelocityResult;
(action: "finish", stopAll?: true): VelocityResult;
(action: "finish", queue?: string | false, stopAll?: true): VelocityResult;
(elements: VelocityElements, action: "finish", stopAll?: true): VelocityResult;
(elements: VelocityElements, action: "finish", queue?: string | false, stopAll?: true): VelocityResult;
}

interface VelocityChain {
(action: "finish", queue?: string): VelocityResult;
(action: "finish", stopAll?: true): VelocityResult;
(action: "finish", queue?: string | false, stopAll?: true): VelocityResult;
}

////////////////////
Expand Down Expand Up @@ -801,12 +804,15 @@ interface VelocityChain {
// Action: Stop //
//////////////////
interface Velocity {
(action: "stop", queue?: string): VelocityResult;
(elements: VelocityElements, action: "stop", queue?: string): VelocityResult;
(action: "stop", stopAll?: true): VelocityResult;
(action: "stop", queue?: string | false, stopAll?: true): VelocityResult;
(elements: VelocityElements, action: "stop", stopAll?: true): VelocityResult;
(elements: VelocityElements, action: "stop", queue?: string | false, stopAll?: true): VelocityResult;
}

interface VelocityChain {
(action: "stop", queue?: string): VelocityResult;
(action: "stop", stopAll?: true): VelocityResult;
(action: "stop", queue?: string | false, stopAll?: true): VelocityResult;
}

///////////////////
Expand Down
14 changes: 12 additions & 2 deletions src/Velocity/actions/finish.ts
Expand Up @@ -55,8 +55,18 @@ namespace VelocityStatic {
}

/**
* Clear the currently-active delay on each targeted element.
* @param {HTMLorSVGElement[]} elements The velocity elements
* When the finish action is triggered, the elements' currently active call is
* immediately finished. When an element is finished, the next item in its
* animation queue is immediately triggered. If passed via a chained call
* then this will only target the animations in that call, and not the
* elements linked to it.
*
* A queue name may be passed in to specify that only animations on the
* named queue are finished. The default queue is named "". In addition the
* value of `false` is allowed for the queue name.
*
* An final argument may be passed in to clear an element's remaining queued
* calls. This may only be the value `true`.
*/
function finish(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise): void {
const queueName: string | false = validateQueue(args[0], true),
Expand Down
27 changes: 16 additions & 11 deletions src/Velocity/actions/stop.ts
Expand Up @@ -22,17 +22,22 @@ namespace VelocityStatic {
}

/**
* When the stop action is triggered, the elements' currently active call is immediately stopped. The active call might have
* been applied to multiple elements, in which case all of the call's elements will be stopped. When an element
* is stopped, the next item in its animation queue is immediately triggered.
* An additional argument may be passed in to clear an element's remaining queued calls. Either true (which defaults to the "fx" queue)
* or a custom queue string can be passed in.
* Note: The stop command runs prior to Velocity's Queueing phase since its behavior is intended to take effect *immediately*,
* regardless of the element's current queue state.
* @param {any[]} args
* @param {VelocityResult} elements
* @param {VelocityPromise} promiseHandler
* @param {string} action
* When the stop action is triggered, the elements' currently active call is
* immediately stopped. When an element is stopped, the next item in its
* animation queue is immediately triggered. If passed via a chained call
* then this will only target the animations in that call, and not the
* elements linked to it.
*
* A queue name may be passed in to specify that only animations on the
* named queue are stopped. The default queue is named "". In addition the
* value of `false` is allowed for the queue name.
*
* An final argument may be passed in to clear an element's remaining queued
* calls. This may only be the value `true`.
*
* Note: The stop command runs prior to Velocity's Queueing phase since its
* behavior is intended to take effect *immediately*, regardless of the
* element's current queue state.
*/
function stop(args: any[], elements: VelocityResult, promiseHandler?: VelocityPromise, action?: string): void {
const queueName: string | false = validateQueue(args[0], true),
Expand Down
41 changes: 28 additions & 13 deletions velocity.js
Expand Up @@ -437,8 +437,18 @@ var VelocityStatic;
}
}
/**
* Clear the currently-active delay on each targeted element.
* @param {HTMLorSVGElement[]} elements The velocity elements
* When the finish action is triggered, the elements' currently active call is
* immediately finished. When an element is finished, the next item in its
* animation queue is immediately triggered. If passed via a chained call
* then this will only target the animations in that call, and not the
* elements linked to it.
*
* A queue name may be passed in to specify that only animations on the
* named queue are finished. The default queue is named "". In addition the
* value of `false` is allowed for the queue name.
*
* An final argument may be passed in to clear an element's remaining queued
* calls. This may only be the value `true`.
*/
function finish(args, elements, promiseHandler) {
var queueName = validateQueue(args[0], true), defaultQueue = VelocityStatic.defaults.queue, finishAll = args[queueName === undefined ? 0 : 1] === true;
Expand Down Expand Up @@ -730,17 +740,22 @@ var VelocityStatic;
}
}
/**
* When the stop action is triggered, the elements' currently active call is immediately stopped. The active call might have
* been applied to multiple elements, in which case all of the call's elements will be stopped. When an element
* is stopped, the next item in its animation queue is immediately triggered.
* An additional argument may be passed in to clear an element's remaining queued calls. Either true (which defaults to the "fx" queue)
* or a custom queue string can be passed in.
* Note: The stop command runs prior to Velocity's Queueing phase since its behavior is intended to take effect *immediately*,
* regardless of the element's current queue state.
* @param {any[]} args
* @param {VelocityResult} elements
* @param {VelocityPromise} promiseHandler
* @param {string} action
* When the stop action is triggered, the elements' currently active call is
* immediately stopped. When an element is stopped, the next item in its
* animation queue is immediately triggered. If passed via a chained call
* then this will only target the animations in that call, and not the
* elements linked to it.
*
* A queue name may be passed in to specify that only animations on the
* named queue are stopped. The default queue is named "". In addition the
* value of `false` is allowed for the queue name.
*
* An final argument may be passed in to clear an element's remaining queued
* calls. This may only be the value `true`.
*
* Note: The stop command runs prior to Velocity's Queueing phase since its
* behavior is intended to take effect *immediately*, regardless of the
* element's current queue state.
*/
function stop(args, elements, promiseHandler, action) {
var queueName = validateQueue(args[0], true), defaultQueue = VelocityStatic.defaults.queue, finishAll = args[queueName === undefined ? 0 : 1] === true;
Expand Down
2 changes: 1 addition & 1 deletion velocity.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion velocity.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion velocity.ui.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e26106a

Please sign in to comment.