|
3 | 3 | // input(type="text", v-model="keyboardText", v-if="!input") |
4 | 4 | .keyboard |
5 | 5 | .line(v-for="line in keySet", track-by="$index") |
6 | | - span(v-for="key in line", track-by="$index", :class="getClassesOfKey(key)", v-text="getCaptionOfKey(key)", @click="clickKey(key)", :style="getKeyStyle(key)") |
| 6 | + span(v-for="key in line", track-by="$index", :class="getClassesOfKey(key)", v-text="getCaptionOfKey(key)", @click="clickKey(key)", @mousedown="mousedown", :style="getKeyStyle(key)") |
7 | 7 |
|
8 | 8 | </template> |
9 | 9 |
|
|
32 | 32 | |
33 | 33 | data () { |
34 | 34 | return { |
35 | | - currentKeySet: "default" |
| 35 | + currentKeySet: "default", |
| 36 | +
|
| 37 | + inputScrollLeft: 0 |
36 | 38 | }; |
37 | 39 | }, |
38 | 40 |
|
|
173 | 175 | return text; |
174 | 176 | }, |
175 | 177 |
|
| 178 | + mousedown() { |
| 179 | + if (!this.input) return; |
| 180 | +
|
| 181 | + this.inputScrollLeft = this.input.scrollLeft; |
| 182 | + //console.log("mousedown: ", this.input.scrollLeft, this.input.scrollWidth, this.input.clientWidth); |
| 183 | + }, |
| 184 | +
|
176 | 185 | clickKey(key) { |
177 | 186 | if (!this.input) return; |
178 | 187 |
|
|
274 | 283 | $width: 40; |
275 | 284 | $height: 2.2em; |
276 | 285 | $margin: 0.5em; |
277 | | - $radius: 0.625em; |
| 286 | + $radius: 0.35em; |
278 | 287 |
|
279 | 288 | .vue-touch-keyboard { |
280 | 289 |
|
|
345 | 354 | } |
346 | 355 | |
347 | 356 | &:active { |
348 | | - transform: scale(.95); |
| 357 | + transform: scale(.98); // translateY(1px); |
349 | 358 | color: #333; |
350 | 359 | background-color: #d4d4d4; |
351 | 360 | border-color: #8c8c8c; |
|
358 | 367 | } |
359 | 368 |
|
360 | 369 | } // .key |
| 370 | + /* |
| 371 | + // Apple style |
| 372 | + .key { |
| 373 | + color: #aaa; |
| 374 | + //font: bold 9pt arial; |
| 375 | + background: #eff0f2; |
| 376 | + border-radius: 4px; |
| 377 | + border-top: 1px solid #ddd; |
| 378 | + box-shadow: |
| 379 | + inset 0 0 25px #e8e8e8, |
| 380 | + 0 1px 0 #c3c3c3, |
| 381 | + 0 2px 0 #c9c9c9, |
| 382 | + 0 2px 3px #333; |
| 383 | + text-shadow: 0px 1px 0px #f5f5f5; |
| 384 | +
|
| 385 | + &.control { |
| 386 | + box-shadow: |
| 387 | + 0 1px 0 #c3c3c3, |
| 388 | + 0 2px 0 #c9c9c9, |
| 389 | + 0 2px 3px #333; |
| 390 | + text-shadow: 0px 1px 0px #777; |
| 391 | + } |
| 392 | +
|
| 393 | + &:hover { |
| 394 | + color: #aaa; |
| 395 | + background-color: inherit; |
| 396 | + border-color: inherit; |
| 397 | + } |
| 398 | +
|
| 399 | + &:active { |
| 400 | + color: #888; |
| 401 | + background: #ebeced; |
| 402 | + transform: translateY(3px); |
| 403 | + box-shadow: inset 0 0 25px #ddd, 0 0 3px #333; |
| 404 | + border-top: 1px solid #eee; |
| 405 | + } |
| 406 | + }*/ |
361 | 407 |
|
362 | 408 | .placeholder { |
363 | 409 | flex: $width / 2; |
|
0 commit comments