-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added full animation according to specs, 2 additional animations, uni…
…t test, ready for release
- Loading branch information
Showing
9 changed files
with
219 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "jv-datepicker", | ||
"version": "1.7.2", | ||
"version": "2.0.0", | ||
"authors": [ | ||
"motss <[email protected]>" | ||
], | ||
|
@@ -35,7 +35,9 @@ | |
"paper-dialog": "PolymerElements/paper-dialog#~1.0.1", | ||
"paper-icon-button": "PolymerElements/paper-icon-button#~1.0.3", | ||
"iron-list": "PolymerElements/iron-list#~1.1.5", | ||
"paper-slider": "PolymerElements/paper-slider#~1.0.7" | ||
"paper-slider": "PolymerElements/paper-slider#~1.0.7", | ||
"test-fixture": "PolymerElements/test-fixture#~1.0.1", | ||
"iron-test-helpers": "PolymerElements/iron-test-helpers#~1.0.6" | ||
}, | ||
"devDependencies": { | ||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<link rel="import" href="../polymer/polymer.html"> | ||
<link rel="import" href="../neon-animation/neon-animation-behavior.html"> | ||
<link rel="import" href="../neon-animation/web-animations.html"> | ||
|
||
<!-- | ||
`<datepicker-slide-from-left-animation>` animates the transform of an element from | ||
`translateX(-100%)` to `none` and animates opacity from 0 to 1. | ||
The `transformOrigin` defaults to `0 50%`. | ||
Configuration: | ||
``` | ||
{ | ||
name: 'datepicker-slide-from-left-animation', | ||
node: <node>, | ||
transformOrigin: <transform-origin>, | ||
timing: <animation-timing> | ||
} | ||
``` | ||
--> | ||
|
||
<script> | ||
Polymer({ | ||
is: 'datepicker-slide-from-left-animation', | ||
behaviors: [ | ||
Polymer.NeonAnimationBehavior | ||
], | ||
configure: function(config) { | ||
var node = config.node; | ||
if (config.transformOrigin) { | ||
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin); | ||
} else { | ||
this.setPrefixedProperty(node, 'transformOrigin', '0 50%'); | ||
} | ||
this._effect = new KeyframeEffect(node, [ | ||
{offset: 0.0, 'transform': 'translateX(-100%)', 'opacity': 0}, | ||
{offset: 0.2, 'transform': 'translateX(-80%)', 'opacity': 0}, | ||
{offset: 0.4, 'transform': 'translateX(-60%)', 'opacity': 0}, | ||
{offset: 0.6, 'transform': 'translateX(-40%)', 'opacity': 0}, | ||
{offset: 0.8, 'transform': 'translateX(-20%)', 'opacity': 0.6}, | ||
{offset: 1.0, 'transform': 'none', 'opacity': 1}, | ||
], this.timingFromConfig(config)); | ||
return this._effect; | ||
} | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<link rel="import" href="../polymer/polymer.html"> | ||
<link rel="import" href="../neon-animation/neon-animation-behavior.html"> | ||
<link rel="import" href="../neon-animation/web-animations.html"> | ||
|
||
<!-- | ||
`<datepicker-slide-from-left-animation>` animates the transform of an element from | ||
`translateX(100%)` to `none` and animates opacity from 0 to 1. | ||
The `transformOrigin` defaults to `0 50%`. | ||
Configuration: | ||
``` | ||
{ | ||
name: 'datepicker-slide-from-left-animation', | ||
node: <node>, | ||
transformOrigin: <transform-origin>, | ||
timing: <animation-timing> | ||
} | ||
``` | ||
--> | ||
|
||
<script> | ||
Polymer({ | ||
is: 'datepicker-slide-from-right-animation', | ||
behaviors: [ | ||
Polymer.NeonAnimationBehavior | ||
], | ||
configure: function(config) { | ||
var node = config.node; | ||
if (config.transformOrigin) { | ||
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin); | ||
} else { | ||
this.setPrefixedProperty(node, 'transformOrigin', '0 50%'); | ||
} | ||
this._effect = new KeyframeEffect(node, [ | ||
{offset: 0.0, 'transform': 'translateX(100%)', 'opacity': 0}, | ||
{offset: 0.2, 'transform': 'translateX(80%)', 'opacity': 0}, | ||
{offset: 0.4, 'transform': 'translateX(60%)', 'opacity': 0}, | ||
{offset: 0.6, 'transform': 'translateX(40%)', 'opacity': 0}, | ||
{offset: 0.8, 'transform': 'translateX(20%)', 'opacity': 0.6}, | ||
{offset: 1.0, 'transform': 'none', 'opacity': 1}, | ||
], this.timingFromConfig(config)); | ||
return this._effect; | ||
} | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.