-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcount-up.html
49 lines (40 loc) · 1.43 KB
/
count-up.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="count-up-import.html">
<!--
`<count-up>` is a wrapper component for [CountUp.js](https://github.com/inorganik/countUp.js) that displays an animated count up (or down) with configurable options like the duration, the easing function for the animation or the decimal separator, etc.
For examples of the easing function, check out [CountUp's demo](http://inorganik.github.io/countUp.js/).
__Basic example:__
```html
<count-up start-value="100" end-value="2000"></count-up>
```
__Update the current value from the previous `updateTo` value instead of `startValue`:__
```html
<count-up update-to="[[someValue]]"></count-up>
```
```js
_onSomeValueChanged: function(value) {
this.someValue = value;
}
```
__With decimals and custom decimal separators:__
```html
<count-up decimals="2" decimal="," separator="."></count-up>
```
## Styling
The following custom properties and mixins are available for styling:
| Custom property | Description | Default |
| :-------------- | :--------------------- | :------ |
| --count-up | Mixin applied to :host | {} |
@demo demo/index.html
-->
<dom-module id="count-up">
<template>
<style>
:host { display: inline-block; }
:host([hidden]) { display: none; }
#value { @apply --count-up-value; }
</style>
<span id="value"></span>
</template>
<script src="count-up.js"></script>
</dom-module>