|
3 | 3 | // input(type="text", v-model="keyboardText", v-if="!input") |
4 | 4 | .keyboard |
5 | 5 | .line(v-for="(line, index) in keySet", :key="index") |
6 | | - span(v-for="(key, index) in line", :key="index", :class="getClassesOfKey(key)", v-text="getCaptionOfKey(key)", @click="e => clickKey(e, key)", @mousedown="mousedown", :style="getKeyStyle(key)") |
| 6 | + div(v-for="(key, index) in line", :key="index", :class="getClassesOfKey(key)", :style="getKeyStyle(key)") |
| 7 | + div(v-if="!key.placeholder" v-text="getCaptionOfKey(key)", @click="e => clickKey(e, key)", @mousedown="mousedown") |
7 | 8 |
|
8 | 9 |
|
9 | 10 | </template> |
|
316 | 317 | } |
317 | 318 | |
318 | 319 | .key { |
319 | | - &:not(:last-child) { |
320 | | - margin-right: $margin; |
321 | | - } |
322 | | -
|
323 | 320 | flex: $width; |
324 | | - //width: $btnW; |
325 | | - height: $height; |
326 | | - line-height: $height; |
327 | | - overflow: hidden; |
328 | 321 |
|
329 | | - vertical-align: middle; |
330 | | - border: 1px solid #ccc; |
331 | | - color: #333; |
332 | | - background-color: #fff; |
333 | | - box-shadow: 0px 2px 2px rgba(0, 0, 0, .6); |
334 | | - border-radius: $radius; |
| 322 | + &.half { |
| 323 | + flex: $width / 2; |
| 324 | + } |
| 325 | +
|
| 326 | + > div { |
| 327 | + height: $height; |
| 328 | + line-height: $height; |
| 329 | + overflow: hidden; |
335 | 330 |
|
336 | | - font-size: 1.25em; |
337 | | - text-align: center; |
338 | | - white-space: nowrap; |
339 | | - user-select: none; |
340 | | - cursor: pointer; |
| 331 | + vertical-align: middle; |
| 332 | + border: 1px solid #ccc; |
| 333 | + color: #333; |
| 334 | + background-color: #fff; |
| 335 | + box-shadow: 0px 2px 2px rgba(0, 0, 0, .6); |
| 336 | + border-radius: $radius; |
| 337 | +
|
| 338 | + font-size: 1.25em; |
| 339 | + text-align: center; |
| 340 | + white-space: nowrap; |
| 341 | + user-select: none; |
| 342 | + cursor: pointer; |
| 343 | + } |
341 | 344 |
|
| 345 | + &:not(:last-child) > div { |
| 346 | + margin-right: $margin; |
| 347 | + } |
342 | 348 |
|
343 | | - &.backspace { |
| 349 | + &.backspace > div { |
344 | 350 | background-image: url("./icons/backspace.svg"); |
345 | 351 | background-position: center center; |
346 | 352 | background-repeat: no-repeat; |
347 | 353 | background-size: 35%; |
348 | 354 | } |
349 | | - |
350 | | - &.half { |
351 | | - flex: $width / 2; |
352 | | - } |
353 | 355 |
|
354 | | - &.control { |
| 356 | + &.control > div { |
355 | 357 | color: #fff; |
356 | 358 | background-color: #7d7d7d; |
357 | 359 | border-color: #656565; |
358 | 360 | } |
359 | 361 | |
360 | | - &.featured { |
| 362 | + &.featured > div { |
361 | 363 | color: #fff; |
362 | 364 | background-color: #337ab7; |
363 | 365 | border-color: #2e6da4; |
364 | 366 | } |
365 | 367 |
|
366 | | - &:hover { |
| 368 | + &:hover > div { |
367 | 369 | color: #333; |
368 | 370 | background-color: #d6d6d6; |
369 | 371 | border-color: #adadad; |
370 | 372 | } |
371 | 373 | |
372 | | - &:active { |
| 374 | + &:active > div { |
373 | 375 | transform: scale(.98); // translateY(1px); |
374 | 376 | color: #333; |
375 | 377 | background-color: #d4d4d4; |
376 | 378 | border-color: #8c8c8c; |
377 | 379 | } |
378 | 380 |
|
379 | | - &.activated { |
| 381 | + &.activated > div { |
380 | 382 | color: #fff; |
381 | 383 | background-color: #5bc0de; |
382 | 384 | border-color: #46b8da; |
383 | 385 | } |
384 | | -
|
385 | 386 | } // .key |
386 | 387 | /* |
387 | 388 | // Apple style |
|
425 | 426 | flex: $width / 2; |
426 | 427 | height: $height; |
427 | 428 | line-height: $height; |
428 | | - |
429 | | - &:not(:last-child) { |
430 | | - margin-right: $margin; |
431 | | - } |
432 | 429 | } |
433 | 430 | |
434 | 431 | |
|
0 commit comments