diff --git a/src/transition/docs/assets/transition.css b/src/transition/docs/assets/transition.css new file mode 100644 index 00000000000..8efacb667cb --- /dev/null +++ b/src/transition/docs/assets/transition.css @@ -0,0 +1,32 @@ +#example-canvas { /* for YDN */ + height: 250px; + +} +#demo { + background: #ccc; + border: 4px solid #999; + height: 200px; + margin: 20px; + overflow: hidden; + position: relative; + width: 300px; + zoom: 1; +} + +#demo a { + background: #999; + border: 2px solid #fff; + font-weight: bold; + color: #fff; + line-height: 12px; + height: 14px; + width: 15px; + overflow: hidden; + padding: 3px; + position: absolute; + top: 1px; + right: 1px; + text-decoration: none; + text-align: center; +} + diff --git a/src/transition/docs/component.json b/src/transition/docs/component.json new file mode 100644 index 00000000000..42761ddf05f --- /dev/null +++ b/src/transition/docs/component.json @@ -0,0 +1,41 @@ +{ + "name" : "transition", + "displayName": "Transition", + "description": "Transition adds the ability to animate Node style properties. It is modeled after the CSS Transition specification, and leverages native CSS Transition implementations when possible.", + "author" : "msweeney", + + "tags": ["utility", "transition"], + "use" : ["transition"], + + "examples": [ + { + "name" : "transition-basic", + "displayName": "Basic Node Transitions", + "description": "Demonstrates the basic usage of Transitions.", + "modules" : ["transition"], + "tags" : ["transition"], + + "hideTableOfContents": true + }, + + { + "name" : "transition-usage", + "displayName": "Using Transitions", + "description": "Demonstrates more advanced usage of Transitions.", + "modules" : ["transition"], + "tags" : ["transition"], + + "hideTableOfContents": true + }, + + { + "name" : "transition-view", + "displayName": "Showing and Hiding with Transitions", + "description": "Demonstrates how to animate Node's show and hide methods.", + "modules" : ["transition", "node-event-delegate"], + "tags" : ["transition"], + + "hideTableOfContents": true + } + ] +} diff --git a/src/transition/docs/index.mustache b/src/transition/docs/index.mustache new file mode 100644 index 00000000000..0245e1c7bf4 --- /dev/null +++ b/src/transition/docs/index.mustache @@ -0,0 +1,125 @@ +
The Transition Utility adds the transition
method to Node
instances when the transition
module is included. The method accepts a configuration object, and an optional callback function. The config may include one or more CSS
properties to be transitioned, an optional duration
(in seconds), delay
, and easing
for fine-tuning transition behavior. Calling the transition
method begins the transition. The callback
is run after the transition has completed.
Transition supports the following easings:
+Easing | +Description | +
---|---|
cubic-bezier |
+ Specifies a cubic-bezier curve. The four values specify points P1 and P2 of the curve as (x1, y1, x2, y2). All values must be in the range [0, 1] or the definition is invalid. | +
ease (default) |
+ equivalent to cubic-bezier(0.25, 0.1, 0.25, 1) | +
linear |
+ equivalent to cubic-bezier(0, 0, 1, 1) | +
ease-in |
+ equivalent to cubic-bezier(0.42, 0, 1, 1) | +
ease-out |
+ equivalent to cubic-bezier(0, 0, 0.58, 1) | +
ease-in-out |
+ equivalent to cubic-bezier(0.42, 0, 0.58, 1) | +
Transition easings are defined as part of the CSS3 Transition Module. See the full specification for further details. + +
The Transition Utility also allows for property specific attributes. Each attribute may optionally have its own duration
, easing, and/or delay
. This provides much finer control over the transition timeline, enabling more complex effects.
The Transition Utility provides optional notifications for reacting to the start and end of a transition. These can be subscribed to via the on
attribute of the transition config.
For simplicity, an end handler can also be added as a function callback: + +``` +Y.one('#demo').transition({ + duration: 1, + height:0, + + width: { + delay: 1, + duration: 0.5, + value: 0 + } +}, function() { + Y.log('end'); +}); + +``` diff --git a/src/transition/docs/partials/transition-basic-source.mustache b/src/transition/docs/partials/transition-basic-source.mustache new file mode 100644 index 00000000000..08d9889c638 --- /dev/null +++ b/src/transition/docs/partials/transition-basic-source.mustache @@ -0,0 +1,25 @@ +