|
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>
|
|
308 | 309 | }
|
309 | 310 |
|
310 | 311 | .key {
|
311 |
| - &:not(:last-child) { |
312 |
| - margin-right: $margin; |
313 |
| - } |
314 |
| -
|
315 | 312 | flex: $width;
|
316 |
| - //width: $btnW; |
317 |
| - height: $height; |
318 |
| - line-height: $height; |
319 |
| - overflow: hidden; |
320 | 313 |
|
321 |
| - vertical-align: middle; |
322 |
| - border: 1px solid #ccc; |
323 |
| - color: #333; |
324 |
| - background-color: #fff; |
325 |
| - box-shadow: 0px 2px 2px rgba(0, 0, 0, .6); |
326 |
| - border-radius: $radius; |
| 314 | + &.half { |
| 315 | + flex: $width / 2; |
| 316 | + } |
| 317 | +
|
| 318 | + > div { |
| 319 | + height: $height; |
| 320 | + line-height: $height; |
| 321 | + overflow: hidden; |
327 | 322 |
|
328 |
| - font-size: 1.25em; |
329 |
| - text-align: center; |
330 |
| - white-space: nowrap; |
331 |
| - user-select: none; |
332 |
| - cursor: pointer; |
| 323 | + vertical-align: middle; |
| 324 | + border: 1px solid #ccc; |
| 325 | + color: #333; |
| 326 | + background-color: #fff; |
| 327 | + box-shadow: 0px 2px 2px rgba(0, 0, 0, .6); |
| 328 | + border-radius: $radius; |
| 329 | +
|
| 330 | + font-size: 1.25em; |
| 331 | + text-align: center; |
| 332 | + white-space: nowrap; |
| 333 | + user-select: none; |
| 334 | + cursor: pointer; |
| 335 | + } |
333 | 336 |
|
| 337 | + &:not(:last-child) > div { |
| 338 | + margin-right: $margin; |
| 339 | + } |
334 | 340 |
|
335 |
| - &.backspace { |
| 341 | + &.backspace > div { |
336 | 342 | background-image: url("./icons/backspace.svg");
|
337 | 343 | background-position: center center;
|
338 | 344 | background-repeat: no-repeat;
|
339 | 345 | background-size: 35%;
|
340 | 346 | }
|
341 |
| - |
342 |
| - &.half { |
343 |
| - flex: $width / 2; |
344 |
| - } |
345 | 347 |
|
346 |
| - &.control { |
| 348 | + &.control > div { |
347 | 349 | color: #fff;
|
348 | 350 | background-color: #7d7d7d;
|
349 | 351 | border-color: #656565;
|
350 | 352 | }
|
351 | 353 |
|
352 |
| - &.featured { |
| 354 | + &.featured > div { |
353 | 355 | color: #fff;
|
354 | 356 | background-color: #337ab7;
|
355 | 357 | border-color: #2e6da4;
|
356 | 358 | }
|
357 | 359 |
|
358 |
| - &:hover { |
| 360 | + &:hover > div { |
359 | 361 | color: #333;
|
360 | 362 | background-color: #d6d6d6;
|
361 | 363 | border-color: #adadad;
|
362 | 364 | }
|
363 | 365 |
|
364 |
| - &:active { |
| 366 | + &:active > div { |
365 | 367 | transform: scale(.98); // translateY(1px);
|
366 | 368 | color: #333;
|
367 | 369 | background-color: #d4d4d4;
|
368 | 370 | border-color: #8c8c8c;
|
369 | 371 | }
|
370 | 372 |
|
371 |
| - &.activated { |
| 373 | + &.activated > div { |
372 | 374 | color: #fff;
|
373 | 375 | background-color: #5bc0de;
|
374 | 376 | border-color: #46b8da;
|
375 | 377 | }
|
376 |
| -
|
377 | 378 | } // .key
|
378 | 379 | /*
|
379 | 380 | // Apple style
|
|
417 | 418 | flex: $width / 2;
|
418 | 419 | height: $height;
|
419 | 420 | line-height: $height;
|
420 |
| - |
421 |
| - &:not(:last-child) { |
422 |
| - margin-right: $margin; |
423 |
| - } |
424 | 421 | }
|
425 | 422 |
|
426 | 423 |
|
|
0 commit comments