| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 @license | |
| 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE | |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS | |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS | |
| 7 Code distributed by Google as part of the polymer project is also | |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS | |
| 9 --><html><head><link rel="import" href="../paper-styles/paper-styles.html"> | |
| 10 <link rel="import" href="../iron-range-behavior/iron-range-behavior.html"> | |
| 11 <link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html"> | |
| 12 | |
| 13 <!-- | |
| 14 The progress bars are for situations where the percentage completed can be | |
| 15 determined. They give users a quick sense of how much longer an operation | |
| 16 will take. | |
| 17 | |
| 18 Example: | |
| 19 | |
| 20 <paper-progress value="10"></paper-progress> | |
| 21 | |
| 22 There is also a secondary progress which is useful for displaying intermediate | |
| 23 progress, such as the buffer level during a streaming playback progress bar. | |
| 24 | |
| 25 Example: | |
| 26 | |
| 27 <paper-progress value="10" secondary-progress="30"></paper-progress> | |
| 28 | |
| 29 Styling progress bar: | |
| 30 | |
| 31 To change the active progress bar color: | |
| 32 | |
| 33 paper-progress { | |
| 34 --paper-progress-active-color: #e91e63; | |
| 35 } | |
| 36 | |
| 37 To change the secondary progress bar color: | |
| 38 | |
| 39 paper-progress { | |
| 40 --paper-progress-secondary-color: #f8bbd0; | |
| 41 } | |
| 42 | |
| 43 To change the progress bar background color: | |
| 44 | |
| 45 paper-progress { | |
| 46 --paper-progress-container-color: #64ffda; | |
| 47 } | |
| 48 | |
| 49 @group Paper Elements | |
| 50 @element paper-progress | |
| 51 @hero hero.svg | |
| 52 @demo demo/index.html | |
| 53 --> | |
| 54 | |
| 55 </head><body><dom-module id="paper-progress"> | |
| 56 <style> | |
| 57 :host { | |
| 58 display: inline-block; | |
| 59 width: 200px; | |
| 60 height: 4px; | |
| 61 } | |
| 62 | |
| 63 #progressContainer { | |
| 64 position: relative; | |
| 65 height: 100%; | |
| 66 background-color: var(--paper-progress-container-color, --google-grey-300)
; | |
| 67 overflow: hidden; | |
| 68 } | |
| 69 | |
| 70 #activeProgress, | |
| 71 #secondaryProgress { | |
| 72 -webkit-transform-origin: left center; | |
| 73 transform-origin: left center; | |
| 74 -webkit-transform: scaleX(0); | |
| 75 transform: scaleX(0); | |
| 76 } | |
| 77 | |
| 78 #activeProgress { | |
| 79 background-color: var(--paper-progress-active-color, --google-green-500); | |
| 80 } | |
| 81 | |
| 82 #secondaryProgress { | |
| 83 background-color: var(--paper-progress-secondary-color, --google-green-100
); | |
| 84 } | |
| 85 | |
| 86 #activeProgress.indeterminate { | |
| 87 -webkit-transform-origin: center center; | |
| 88 transform-origin: center center; | |
| 89 -webkit-animation: indeterminate-bar 1s linear infinite; | |
| 90 animation: indeterminate-bar 1s linear infinite; | |
| 91 } | |
| 92 | |
| 93 @-webkit-keyframes indeterminate-bar { | |
| 94 0% { | |
| 95 -webkit-transform: translate(-50%) scaleX(0); | |
| 96 } | |
| 97 50% { | |
| 98 -webkit-transform: translate(0%) scaleX(0.3); | |
| 99 } | |
| 100 100% { | |
| 101 -webkit-transform: translate(50%) scaleX(0); | |
| 102 } | |
| 103 } | |
| 104 | |
| 105 @keyframes indeterminate-bar { | |
| 106 0% { | |
| 107 transform: translate(-50%) scaleX(0); | |
| 108 } | |
| 109 50% { | |
| 110 transform: translate(0%) scaleX(0.3); | |
| 111 } | |
| 112 100% { | |
| 113 transform: translate(50%) scaleX(0); | |
| 114 } | |
| 115 } | |
| 116 </style> | |
| 117 <template> | |
| 118 <div id="progressContainer" role="progressbar" aria-valuenow$="{{value}}" ar
ia-valuemin$="{{min}}" aria-valuemax$="{{max}}"> | |
| 119 <div id="secondaryProgress" class="fit"></div> | |
| 120 <div id="activeProgress" class="fit"></div> | |
| 121 </div> | |
| 122 </template> | |
| 123 </dom-module> | |
| 124 | |
| 125 <script src="paper-progress-extracted.js"></script></body></html> | |
| OLD | NEW |