-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolymer-meter.html
More file actions
109 lines (87 loc) · 2.58 KB
/
polymer-meter.html
File metadata and controls
109 lines (87 loc) · 2.58 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<link rel="import" href="../polymer/polymer.html">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="reading.js"></script>
<!--
`polymer-meter`
This is a polymer element to indicate the amount of article still left for reading.
Example:
<polymer-meter></polymer-meter>
Place this element at the top your page, it will watch the length of the page and at the top it will
display a indicator show how much of the page you have already covered.
You may not insert any custom DOM inside of this indicator element.
### Styling
You can control the color of the indicator using css property '--progress-meter-color'
Example:
polymer-meter{
--progress-meter-color: red;
}
Custom property | Description | Default
----------------|-------------|----------
`--progress-meter-color` | Background color of the progress indicator | `green`
@demo demo/index.html
-->
<dom-module id="polymer-meter">
<template>
<style>
:host {
display: block;
}
/* Progress bar indicator css */
progress {
/* Positioning */
position: fixed;
left: 0;
top: 0;
z-index: 99999;
/* Dimensions */
width: 100%;
height: .25em;
/* Reset the apperance */
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
/* Get rid of the default border in Firefox/Opera. */
border: none;
/* For Firefox/IE10+ */
background-color: transparent;
/* For IE10+, color of the progress bar */
color: transparent;
}
progress::-webkit-progress-bar {
background-color: transparent;
}
.flat::-webkit-progress-value {
background-color: var(--progress-meter-color);
}
.flat::-moz-progress-bar {
background-color: var(--progress-meter-color);
}
.progress-container {
width: 100%;
background-color: transparent;
position: fixed;
top: 0;
left: 0;
height: .25em;
display: block;
z-index: 99999;
}
.progress-bar {
background-color: var(--progress-meter-color);
width: 50%;
display: block;
height: inherit;
}
</style>
<progress value="0" id="progressBar" class="flat">
<div class="progress-container">
<span class="progress-bar"></span>
</div>
</progress>
</template>
<script>
Polymer({
is: 'polymer-meter',
});
</script>
</dom-module>