update user data queries

This commit is contained in:
Luke Pulverenti 2016-05-08 02:31:08 -04:00
parent 471acf85af
commit 2242c4d5d6
110 changed files with 5729 additions and 119 deletions

View file

@ -0,0 +1,95 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<cascaded-animation>` applies an animation on an array of elements with a delay between each.
the delay defaults to 50ms.
Configuration:
```
{
name: 'cascaded-animation',
animation: <animation-name>,
nodes: <array-of-nodes>,
nodeDelay: <node-delay-in-ms>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'cascaded-animation',
behaviors: [
Polymer.NeonAnimationBehavior
],
/**
* @param {{
* animation: string,
* nodes: !Array<!Element>,
* nodeDelay: (number|undefined),
* timing: (Object|undefined)
* }} config
*/
configure: function(config) {
this._animations = [];
var nodes = config.nodes;
var effects = [];
var nodeDelay = config.nodeDelay || 50;
config.timing = config.timing || {};
config.timing.delay = config.timing.delay || 0;
var oldDelay = config.timing.delay;
var abortedConfigure;
for (var node, index = 0; node = nodes[index]; index++) {
config.timing.delay += nodeDelay;
config.node = node;
var animation = document.createElement(config.animation);
if (animation.isNeonAnimation) {
var effect = animation.configure(config);
this._animations.push(animation);
effects.push(effect);
} else {
Polymer.Base._warn(this.is + ':', config.animation, 'not found!');
abortedConfigure = true;
break;
}
}
config.timing.delay = oldDelay;
config.node = null;
// if a bad animation was configured, abort config.
if (abortedConfigure) {
return;
}
this._effect = new GroupEffect(effects);
return this._effect;
},
complete: function() {
for (var animation, index = 0; animation = this._animations[index]; index++) {
animation.complete(animation.config);
}
}
});
</script>

View file

@ -0,0 +1,49 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<fade-in-animation>` animates the opacity of an element from 0 to 1.
Configuration:
```
{
name: 'fade-in-animation',
node: <node>
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'fade-in-animation',
behaviors: [
Polymer.NeonAnimationBehavior
],
configure: function(config) {
var node = config.node;
this._effect = new KeyframeEffect(node, [
{'opacity': '0'},
{'opacity': '1'}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,49 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<fade-out-animation>` animates the opacity of an element from 1 to 0.
Configuration:
```
{
name: 'fade-out-animation',
node: <node>
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'fade-out-animation',
behaviors: [
Polymer.NeonAnimationBehavior
],
configure: function(config) {
var node = config.node;
this._effect = new KeyframeEffect(node, [
{'opacity': '1'},
{'opacity': '0'}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,83 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-shared-element-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<hero-animation>` is a shared element animation that scales and transform an element such that it
appears to be shared between two pages. Use this in `<neon-animated-pages>`. The source page
should use this animation in an 'exit' animation and set the `fromPage` configuration property to
itself, and the destination page should use this animation in an `entry` animation and set the
`toPage` configuration property to itself. They should also define the hero elements in the
`sharedElements` property (not a configuration property, see
`Polymer.NeonSharedElementAnimatableBehavior`).
Configuration:
```
{
name: 'hero-animation',
id: <shared-element-id>,
timing: <animation-timing>,
toPage: <node>, /* define for the destination page */
fromPage: <node>, /* define for the source page */
}
```
-->
<script>
Polymer({
is: 'hero-animation',
behaviors: [
Polymer.NeonSharedElementAnimationBehavior
],
configure: function(config) {
var shared = this.findSharedElements(config);
if (!shared) {
return;
}
var fromRect = shared.from.getBoundingClientRect();
var toRect = shared.to.getBoundingClientRect();
var deltaLeft = fromRect.left - toRect.left;
var deltaTop = fromRect.top - toRect.top;
var deltaWidth = fromRect.width / toRect.width;
var deltaHeight = fromRect.height / toRect.height;
this.setPrefixedProperty(shared.to, 'transformOrigin', '0 0');
shared.to.style.zIndex = 10000;
shared.from.style.visibility = 'hidden';
this._effect = new KeyframeEffect(shared.to, [
{'transform': 'translate(' + deltaLeft + 'px,' + deltaTop + 'px) scale(' + deltaWidth + ',' + deltaHeight + ')'},
{'transform': 'none'}
], this.timingFromConfig(config));
return this._effect;
},
complete: function(config) {
var shared = this.findSharedElements(config);
if (!shared) {
return null;
}
shared.to.style.zIndex = '';
shared.from.style.visibility = '';
}
});
</script>

View file

@ -0,0 +1,46 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<opaque-animation>` makes an element `opacity:1` for the duration of the animation. Used to prevent
webkit/safari from drawing a frame before an animation for elements that animate from display:none.
-->
<script>
Polymer({
is: 'opaque-animation',
behaviors: [
Polymer.NeonAnimationBehavior
],
configure: function(config) {
var node = config.node;
node.style.opacity = '0';
this._effect = new KeyframeEffect(node, [
{'opacity': '1'},
{'opacity': '1'}
], this.timingFromConfig(config));
return this._effect;
},
complete: function(config) {
config.node.style.opacity = '';
}
});
</script>

View file

@ -0,0 +1,86 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-shared-element-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<reverse-ripple-animation>` scales and transform an element such that it appears to ripple down from this element, to either
a shared element, or a screen position.
If using as a shared element animation in `<neon-animated-pages>`, use this animation in an `exit`
animation in the source page and in an `entry` animation in the destination page. Also, define the
reverse-ripple elements in the `sharedElements` property (not a configuration property, see
`Polymer.NeonSharedElementAnimatableBehavior`).
If using a screen position, define the `gesture` property.
Configuration:
```
{
name: 'reverse-ripple-animation`.
id: <shared-element-id>, /* set this or gesture */
gesture: {x: <page-x>, y: <page-y>}, /* set this or id */
timing: <animation-timing>,
toPage: <node>, /* define for the destination page */
fromPage: <node>, /* define for the source page */
}
```
-->
<script>
Polymer({
is: 'reverse-ripple-animation',
behaviors: [
Polymer.NeonSharedElementAnimationBehavior
],
configure: function(config) {
var shared = this.findSharedElements(config);
if (!shared) {
return null;
}
var translateX, translateY;
var fromRect = shared.from.getBoundingClientRect();
if (config.gesture) {
translateX = config.gesture.x - (fromRect.left + (fromRect.width / 2));
translateY = config.gesture.y - (fromRect.top + (fromRect.height / 2));
} else {
var toRect = shared.to.getBoundingClientRect();
translateX = (toRect.left + (toRect.width / 2)) - (fromRect.left + (fromRect.width / 2));
translateY = (toRect.top + (toRect.height / 2)) - (fromRect.top + (fromRect.height / 2));
}
var translate = 'translate(' + translateX + 'px,' + translateY + 'px)';
var size = Math.max(fromRect.width + Math.abs(translateX) * 2, fromRect.height + Math.abs(translateY) * 2);
var diameter = Math.sqrt(2 * size * size);
var scaleX = diameter / fromRect.width;
var scaleY = diameter / fromRect.height;
var scale = 'scale(' + scaleX + ',' + scaleY + ')';
this.setPrefixedProperty(shared.from, 'transformOrigin', '50% 50%');
shared.from.style.borderRadius = '50%';
this._effect = new KeyframeEffect(shared.from, [
{'transform': translate + ' ' + scale},
{'transform': translate + ' scale(0)'}
], this.timingFromConfig(config));
return this._effect;
},
complete: function() {
if (this.sharedElements) {
this.setPrefixedProperty(this.sharedElements.from, 'transformOrigin', '');
this.sharedElements.from.style.borderRadius = '';
}
}
});
</script>

View file

@ -0,0 +1,92 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-shared-element-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<ripple-animation>` scales and transform an element such that it appears to ripple from either
a shared element, or from a screen position, to full screen.
If using as a shared element animation in `<neon-animated-pages>`, use this animation in an `exit`
animation in the source page and in an `entry` animation in the destination page. Also, define the
hero elements in the `sharedElements` property (not a configuration property, see
`Polymer.NeonSharedElementAnimatableBehavior`).
If using a screen position, define the `gesture` property.
Configuration:
```
{
name: 'ripple-animation`.
id: <shared-element-id>, /* set this or gesture */
gesture: {x: <page-x>, y: <page-y>}, /* set this or id */
timing: <animation-timing>,
toPage: <node>, /* define for the destination page */
fromPage: <node>, /* define for the source page */
}
```
-->
<script>
Polymer({
is: 'ripple-animation',
behaviors: [
Polymer.NeonSharedElementAnimationBehavior
],
configure: function(config) {
var shared = this.findSharedElements(config);
if (!shared) {
return null;
}
var translateX, translateY;
var toRect = shared.to.getBoundingClientRect();
if (config.gesture) {
translateX = config.gesture.x - (toRect.left + (toRect.width / 2));
translateY = config.gesture.y - (toRect.top + (toRect.height / 2));
} else {
var fromRect = shared.from.getBoundingClientRect();
translateX = (fromRect.left + (fromRect.width / 2)) - (toRect.left + (toRect.width / 2));
translateY = (fromRect.top + (fromRect.height / 2)) - (toRect.top + (toRect.height / 2));
}
var translate = 'translate(' + translateX + 'px,' + translateY + 'px)';
var size = Math.max(toRect.width + Math.abs(translateX) * 2, toRect.height + Math.abs(translateY) * 2);
var diameter = Math.sqrt(2 * size * size);
var scaleX = diameter / toRect.width;
var scaleY = diameter / toRect.height;
var scale = 'scale(' + scaleX + ',' + scaleY + ')';
this.setPrefixedProperty(shared.to, 'transformOrigin', '50% 50%');
shared.to.style.borderRadius = '50%';
this._effect = new KeyframeEffect(shared.to, [
{'transform': translate + ' scale(0)'},
{'transform': translate + ' ' + scale}
], this.timingFromConfig(config));
return this._effect;
},
complete: function() {
if (this.sharedElements) {
this.setPrefixedProperty(this.sharedElements.to, 'transformOrigin', '');
this.sharedElements.to.style.borderRadius = '';
}
}
});
</script>

View file

@ -0,0 +1,65 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<scale-down-animation>` animates the scale transform of an element from 1 to 0. By default it
scales in both the x and y axes.
Configuration:
```
{
name: 'scale-down-animation',
node: <node>,
axis: 'x' | 'y' | '',
transformOrigin: <transform-origin>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'scale-down-animation',
behaviors: [
Polymer.NeonAnimationBehavior
],
configure: function(config) {
var node = config.node;
if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
}
var scaleProperty = 'scale(0, 0)';
if (config.axis === 'x') {
scaleProperty = 'scale(0, 1)';
} else if (config.axis === 'y') {
scaleProperty = 'scale(1, 0)';
}
this._effect = new KeyframeEffect(node, [
{'transform': 'scale(1,1)'},
{'transform': scaleProperty}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,65 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<scale-up-animation>` animates the scale transform of an element from 0 to 1. By default it
scales in both the x and y axes.
Configuration:
```
{
name: 'scale-up-animation',
node: <node>,
axis: 'x' | 'y' | '',
transformOrigin: <transform-origin>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'scale-up-animation',
behaviors: [
Polymer.NeonAnimationBehavior
],
configure: function(config) {
var node = config.node;
if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
}
var scaleProperty = 'scale(0)';
if (config.axis === 'x') {
scaleProperty = 'scale(0, 1)';
} else if (config.axis === 'y') {
scaleProperty = 'scale(1, 0)';
}
this._effect = new KeyframeEffect(node, [
{'transform': scaleProperty},
{'transform': 'scale(1, 1)'}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,59 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<slide-down-animation>` animates the transform of an element from `none` `translateY(100%)`.
The `transformOrigin` defaults to `50% 0`.
Configuration:
```
{
name: 'slide-down-animation',
node: <node>,
transformOrigin: <transform-origin>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'slide-down-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', '50% 0');
}
this._effect = new KeyframeEffect(node, [
{'transform': 'translateY(0%)'},
{'transform': 'translateY(100%)'}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,59 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<slide-from-bottom-animation>` animates the transform of an element from `none` to `translateY(100%)`.
The `transformOrigin` defaults to `50% 0`.
Configuration:
```
{
name: 'slide-from-bottom-animation',
node: <node>,
transformOrigin: <transform-origin>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'slide-from-bottom-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', '50% 0');
}
this._effect = new KeyframeEffect(node, [
{'transform': 'translateY(100%)'},
{'transform': 'translateY(0)'}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,60 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<slide-from-left-animation>` animates the transform of an element from
`translateX(-100%)` to `none`.
The `transformOrigin` defaults to `0 50%`.
Configuration:
```
{
name: 'slide-from-left-animation',
node: <node>,
transformOrigin: <transform-origin>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: '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, [
{'transform': 'translateX(-100%)'},
{'transform': 'none'}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,60 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<slide-from-right-animation>` animates the transform of an element from
`translateX(100%)` to `none`.
The `transformOrigin` defaults to `0 50%`.
Configuration:
```
{
name: 'slide-from-right-animation',
node: <node>,
transformOrigin: <transform-origin>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: '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, [
{'transform': 'translateX(100%)'},
{'transform': 'none'}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,59 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<slide-from-top-animation>` animates the transform of an element from `translateY(-100%)` to
`none`. The `transformOrigin` defaults to `50% 0`.
Configuration:
```
{
name: 'slide-from-top-animation',
node: <node>,
transformOrigin: <transform-origin>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'slide-from-top-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', '50% 0');
}
this._effect = new KeyframeEffect(node, [
{'transform': 'translateY(-100%)'},
{'transform': 'translateY(0%)'}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,59 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<slide-left-animation>` animates the transform of an element from `none` to `translateX(-100%)`.
The `transformOrigin` defaults to `0 50%`.
Configuration:
```
{
name: 'slide-left-animation',
node: <node>,
transformOrigin: <transform-origin>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'slide-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, [
{'transform': 'none'},
{'transform': 'translateX(-100%)'}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,59 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<slide-right-animation>` animates the transform of an element from `none` to `translateX(100%)`.
The `transformOrigin` defaults to `0 50%`.
Configuration:
```
{
name: 'slide-right-animation',
node: <node>,
transformOrigin: <transform-origin>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'slide-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, [
{'transform': 'none'},
{'transform': 'translateX(100%)'}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,59 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<slide-up-animation>` animates the transform of an element from `translateY(0)` to
`translateY(-100%)`. The `transformOrigin` defaults to `50% 0`.
Configuration:
```
{
name: 'slide-up-animation',
node: <node>,
transformOrigin: <transform-origin>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'slide-up-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', '50% 0');
}
this._effect = new KeyframeEffect(node, [
{'transform': 'translate(0)'},
{'transform': 'translateY(-100%)'}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>

View file

@ -0,0 +1,70 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../neon-animation-behavior.html">
<link rel="import" href="../web-animations.html">
<!--
`<transform-animation>` animates a custom transform on an element. Use this to animate multiple
transform properties, or to apply a custom transform value.
Configuration:
```
{
name: 'transform-animation',
node: <node>,
transformOrigin: <transform-origin>,
transformFrom: <transform-from-string>,
transformTo: <transform-to-string>,
timing: <animation-timing>
}
```
-->
<script>
Polymer({
is: 'transform-animation',
behaviors: [
Polymer.NeonAnimationBehavior
],
/**
* @param {{
* node: !Element,
* transformOrigin: (string|undefined),
* transformFrom: (string|undefined),
* transformTo: (string|undefined),
* timing: (Object|undefined)
* }} config
*/
configure: function(config) {
var node = config.node;
var transformFrom = config.transformFrom || 'none';
var transformTo = config.transformTo || 'none';
if (config.transformOrigin) {
this.setPrefixedProperty(node, 'transformOrigin', config.transformOrigin);
}
this._effect = new KeyframeEffect(node, [
{'transform': transformFrom},
{'transform': transformTo}
], this.timingFromConfig(config));
return this._effect;
}
});
</script>