MacViews: Get c/b/ui/views/tabs to build on Mac
[chromium-blink-merge.git] / third_party / polymer / components-chromium / paper-ripple / paper-ripple.html
blobe48a3fedfa33f525ecbfd6b37c4ca89587a2c81a
1 <!--
2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8 -->
10 <!--
11 `paper-ripple` provides a visual effect that other paper elements can
12 use to simulate a rippling effect emanating from the point of contact. The
13 effect can be visualized as a concentric circle with motion.
15 Example:
17 <paper-ripple></paper-ripple>
19 `paper-ripple` listens to "down" and "up" events so it would display ripple
20 effect when touches on it. You can also defeat the default behavior and
21 manually route the down and up actions to the ripple element. Note that it is
22 important if you call downAction() you will have to make sure to call upAction()
23 so that `paper-ripple` would end the animation loop.
25 Example:
27 <paper-ripple id="ripple" style="pointer-events: none;"></paper-ripple>
28 ...
29 downAction: function(e) {
30 this.$.ripple.downAction({x: e.x, y: e.y});
32 upAction: function(e) {
33 this.$.ripple.upAction();
36 Styling ripple effect:
38 Use CSS color property to style the ripple:
40 paper-ripple {
41 color: #4285f4;
44 Note that CSS color property is inherited so it is not required to set it on
45 the `paper-ripple` element directly.
47 Apply `recenteringTouch` class to make the recentering rippling effect.
49 <paper-ripple class="recenteringTouch"></paper-ripple>
51 Apply `circle` class to make the rippling effect within a circle.
53 <paper-ripple class="circle"></paper-ripple>
55 @group Paper Elements
56 @element paper-ripple
57 @homepage github.io
58 -->
60 <link rel="import" href="../polymer/polymer.html">
62 <polymer-element name="paper-ripple" attributes="initialOpacity opacityDecayVelocity" assetpath="">
63 <template>
65 <style>
67 :host {
68 display: block;
69 position: relative;
72 #canvas {
73 pointer-events: none;
74 position: absolute;
75 top: 0;
76 left: 0;
77 width: 100%;
78 height: 100%;
81 :host(.circle) #canvas {
82 border-radius: 50%;
85 </style>
87 </template>
89 </polymer-element>
90 <script src="paper-ripple-extracted.js"></script>