| OLD | NEW |
| 1 <!-- TODO(crbug.com/603217): Use i18n instead of string literals. Figure out | 1 <!-- TODO(crbug.com/603217): Use i18n instead of string literals. Figure out |
| 2 what i18n to use for keypad, ie, does 1 ABC make | 2 what i18n to use for keypad, ie, does 1 ABC make |
| 3 sense in every scenario? --> | 3 sense in every scenario? --> |
| 4 | 4 |
| 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt
on.html"> | 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt
on.html"> |
| 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button.html"> | 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button.html"> |
| 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/paper-styl
es.html"> | 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/paper-styl
es.html"> |
| 8 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.h
tml"> | 8 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.h
tml"> |
| 9 | 9 |
| 10 <dom-module id="pin-keyboard"> | 10 <dom-module id="pin-keyboard"> |
| 11 <template> | 11 <template> |
| 12 <style> | 12 <style> |
| 13 #root { | 13 #root { |
| 14 display: flex; | 14 display: flex; |
| 15 } | 15 } |
| 16 | 16 |
| 17 .row { | 17 .row { |
| 18 display: flex; | 18 display: flex; |
| 19 } | 19 } |
| 20 | 20 |
| 21 .row.horizontal-center { | |
| 22 justify-content: center; | |
| 23 } | |
| 24 | |
| 25 .digit-button { | 21 .digit-button { |
| 26 align-items: center; | 22 align-items: center; |
| 27 background: none; | 23 background: none; |
| 28 border-radius: 50px; | 24 border-radius: 20px; |
| 29 box-sizing: border-box; | 25 box-sizing: border-box; |
| 26 color: var(--paper-blue-grey-700); |
| 30 display: flex; | 27 display: flex; |
| 31 flex-direction: column; | 28 flex-direction: column; |
| 32 font-size: 30px; | 29 font-size: 32px; |
| 33 height: 70px; | 30 height: 70px; |
| 34 justify-content: center; | 31 justify-content: center; |
| 35 margin: 0; | 32 margin: 0; |
| 36 min-height: 70px; | 33 min-height: 70px; |
| 37 min-width: 85px; | 34 min-width: 70px; |
| 38 padding: 15px 20px; | 35 padding: 15px 20px; |
| 39 width: 85px; | 36 width: 70px; |
| 40 } | 37 } |
| 41 | 38 |
| 42 .digit-button.clear-button { | 39 .digit-button.clear-button { |
| 43 display: block; | 40 display: block; |
| 44 } | 41 } |
| 45 | 42 |
| 43 .digit-button.center-button { |
| 44 margin: 0 30px; |
| 45 } |
| 46 |
| 47 .digit-button.submit-button { |
| 48 left: 20px; |
| 49 position: relative; |
| 50 } |
| 51 |
| 46 .digit-button .icon-container { | 52 .digit-button .icon-container { |
| 47 background: var(--paper-grey-500); | 53 background: var(--paper-grey-400); |
| 48 border-radius: 100px; | 54 border-radius: 100px; |
| 49 height: 24px; | 55 height: 24px; |
| 50 margin: auto; | 56 margin: auto; |
| 51 width: 24px; | 57 width: 24px; |
| 52 } | 58 } |
| 53 | 59 |
| 60 .digit-button .icon-container.ready-background { |
| 61 background: var(--paper-blue-800); |
| 62 } |
| 63 |
| 54 .digit-button .icon-container .icon { | 64 .digit-button .icon-container .icon { |
| 55 color: white; | 65 color: white; |
| 56 display: block; | 66 display: block; |
| 57 height: 16px; | 67 height: 16px; |
| 58 left: 4px; | 68 left: 4px; |
| 59 top: 4px; | 69 top: 4px; |
| 60 width: 16px; | 70 width: 16px; |
| 61 } | 71 } |
| 62 | 72 |
| 63 .digit-button .icon-subheading { | 73 .digit-button .icon-subheading { |
| 64 color: var(--paper-grey-500); | 74 color: var(--paper-grey-400); |
| 65 font-size: 10px; | 75 font-size: 10px; |
| 66 padding: 10px; | 76 left: 0; |
| 77 position: absolute; |
| 78 text-align: center; |
| 67 text-transform: capitalize; | 79 text-transform: capitalize; |
| 80 top: 44px; |
| 81 width: 100%; |
| 68 } | 82 } |
| 69 | 83 |
| 70 .digit-button inner-text { | 84 .digit-button inner-text { |
| 85 color: var(--paper-blue-grey-700); |
| 71 display: flex; | 86 display: flex; |
| 72 flex-direction: column; | 87 flex-direction: column; |
| 73 height: 52px; | 88 height: 52px; |
| 74 } | 89 } |
| 75 | 90 |
| 76 .first-row { | 91 .first-row { |
| 77 height: 54px; | 92 height: 64px; |
| 78 min-height: 54px; | 93 min-height: 64px; |
| 94 padding: 28px 15px 12px 15px; |
| 79 } | 95 } |
| 80 | 96 |
| 81 #pin-input { | 97 #pin-input { |
| 82 -webkit-text-security: disc; | 98 -webkit-text-security: disc; |
| 83 border: 0; | 99 border: 0; |
| 84 font-size: 20px; | 100 font-size: 18px; |
| 85 height: 54px; | 101 height: 64px; |
| 102 left: 20px; |
| 103 padding: 28px 3px 12px 3px; |
| 104 position: relative; |
| 86 text-align: center; | 105 text-align: center; |
| 87 width: 171px; | 106 width: 180px; |
| 88 } | 107 } |
| 89 | 108 |
| 90 #pin-input[type=number]::-webkit-inner-spin-button, | 109 #pin-input[type=number]::-webkit-inner-spin-button, |
| 91 #pin-input[type=number]::-webkit-outer-spin-button { | 110 #pin-input[type=number]::-webkit-outer-spin-button { |
| 92 -webkit-appearance: none; | 111 -webkit-appearance: none; |
| 93 margin: 0; | 112 margin: 0; |
| 94 } | 113 } |
| 95 | 114 |
| 96 /* Ensure that all children of paper-button do not consume events. This | 115 /* Ensure that all children of paper-button do not consume events. This |
| 97 * simplifies the event handler code. */ | 116 * simplifies the event handler code. */ |
| 98 paper-button * { | 117 paper-button * { |
| 99 pointer-events: none; | 118 pointer-events: none; |
| 100 } | 119 } |
| 101 </style> | 120 </style> |
| 102 | 121 |
| 103 <div id="root"> | 122 <div id="root"> |
| 104 <div id="container-constrained-width"> | 123 <div id="container-constrained-width"> |
| 105 <div class="row horizontal-center"> | 124 <div class="row"> |
| 106 <input id="pin-input" type="number" placeholder="Enter PIN" | 125 <input id="pin-input" type="number" placeholder="Enter PIN" |
| 107 value="{{value::input}}" | 126 value="{{value::input}}" |
| 108 on-keydown="onInputKeyDown_"></input> | 127 on-keydown="onInputKeyDown_"></input> |
| 109 <div class="digit-button first-row"> | 128 <paper-button class="digit-button first-row submit-button" |
| 110 <paper-button class="digit-button submit-button" | 129 on-tap="firePinSubmitEvent_"> |
| 111 on-tap="firePinSubmitEvent_"> | 130 <div class$="icon-container [[computeSubmitClass_(value)]]"> |
| 112 <div class="icon-container"> | 131 <iron-icon class="icon" icon="icons:forward"><iron-icon> |
| 113 <iron-icon class="icon" icon="icons:forward"><iron-icon> | 132 </div> |
| 114 </div> | 133 </paper-button> |
| 115 </paper-button> | |
| 116 </div> | |
| 117 </div> | 134 </div> |
| 118 | 135 |
| 119 <div class="row keyboard"> | 136 <div class="row keyboard"> |
| 120 <paper-button class="digit-button" on-tap="onNumberTap_" value="1"> | 137 <paper-button class="digit-button" on-tap="onNumberTap_" value="1"> |
| 121 <inner-text>1</inner-text> | 138 <inner-text>1</inner-text> |
| 122 </paper-button> | 139 </paper-button> |
| 123 <paper-button class="digit-button" on-tap="onNumberTap_" value="2"> | 140 <paper-button class="digit-button center-button" on-tap="onNumberTap_" |
| 141 value="2"> |
| 124 <inner-text>2</inner-text> | 142 <inner-text>2</inner-text> |
| 125 </paper-button> | 143 </paper-button> |
| 126 <paper-button class="digit-button" on-tap="onNumberTap_" value="3"> | 144 <paper-button class="digit-button" on-tap="onNumberTap_" value="3"> |
| 127 <inner-text>3</inner-text> | 145 <inner-text>3</inner-text> |
| 128 </paper-button> | 146 </paper-button> |
| 129 </div> | 147 </div> |
| 130 <div class="row keyboard"> | 148 <div class="row keyboard"> |
| 131 <paper-button class="digit-button" on-tap="onNumberTap_" value="4"> | 149 <paper-button class="digit-button" on-tap="onNumberTap_" value="4"> |
| 132 <inner-text>4</inner-text> | 150 <inner-text>4</inner-text> |
| 133 </paper-button> | 151 </paper-button> |
| 134 <paper-button class="digit-button" on-tap="onNumberTap_" value="5"> | 152 <paper-button class="digit-button center-button" on-tap="onNumberTap_" |
| 153 value="5"> |
| 135 <inner-text>5</inner-text> | 154 <inner-text>5</inner-text> |
| 136 </paper-button> | 155 </paper-button> |
| 137 <paper-button class="digit-button" on-tap="onNumberTap_" value="6"> | 156 <paper-button class="digit-button" on-tap="onNumberTap_" value="6"> |
| 138 <inner-text>6</inner-text> | 157 <inner-text>6</inner-text> |
| 139 </paper-button> | 158 </paper-button> |
| 140 </div> | 159 </div> |
| 141 <div class="row keyboard"> | 160 <div class="row keyboard"> |
| 142 <paper-button class="digit-button" on-tap="onNumberTap_" value="7"> | 161 <paper-button class="digit-button" on-tap="onNumberTap_" value="7"> |
| 143 <inner-text>7</inner-text> | 162 <inner-text>7</inner-text> |
| 144 </paper-button> | 163 </paper-button> |
| 145 <paper-button class="digit-button" on-tap="onNumberTap_" value="8"> | 164 <paper-button class="digit-button center-button" on-tap="onNumberTap_" |
| 165 value="8"> |
| 146 <inner-text>8</inner-text> | 166 <inner-text>8</inner-text> |
| 147 </paper-button> | 167 </paper-button> |
| 148 <paper-button class="digit-button" on-tap="onNumberTap_" value="9"> | 168 <paper-button class="digit-button" on-tap="onNumberTap_" value="9"> |
| 149 <inner-text>9</inner-text> | 169 <inner-text>9</inner-text> |
| 150 </paper-button> | 170 </paper-button> |
| 151 </div> | 171 </div> |
| 152 <div class="row keyboard"> | 172 <div class="row keyboard"> |
| 153 <div class="digit-button"></div> | 173 <div class="digit-button"></div> |
| 154 <paper-button class="digit-button" on-tap="onNumberTap_" value="0"> | 174 <paper-button class="digit-button center-button" on-tap="onNumberTap_" |
| 175 value="0"> |
| 155 <inner-text>0</inner-text> | 176 <inner-text>0</inner-text> |
| 156 </paper-button> | 177 </paper-button> |
| 157 <paper-button class="digit-button clear-button" on-tap="onPinClear_"> | 178 <paper-button class="digit-button clear-button" on-tap="onPinClear_"> |
| 158 <div class="icon-container"> | 179 <div class="icon-container"> |
| 159 <iron-icon class="icon" icon="icons:clear"><iron-icon> | 180 <iron-icon class="icon" icon="icons:clear"><iron-icon> |
| 160 </div> | 181 </div> |
| 161 <inner-text class="icon-subheading">Clear</inner-text> | 182 <inner-text class="icon-subheading">Clear</inner-text> |
| 162 </paper-button> | 183 </paper-button> |
| 163 </div> | 184 </div> |
| 164 </div> | 185 </div> |
| 165 </div> | 186 </div> |
| 166 </template> | 187 </template> |
| 167 <script src="pin_keyboard.js"></script> | 188 <script src="pin_keyboard.js"></script> |
| 168 </dom-module> | 189 </dom-module> |
| OLD | NEW |