-
Notifications
You must be signed in to change notification settings - Fork 6
/
jk-keyboard.scss
86 lines (77 loc) · 1.53 KB
/
jk-keyboard.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
$black: #000;
$white: #fff;
$green: #3fb837;
@mixin translate3d($t...) {
-webkit-transform: translate3d($t);
-moz-transform: translate3d($t);
-ms-transform: translate3d($t);
transform: translate3d($t);
}
@mixin transition($t...) {
-webkit-transition: $t;
-moz-transition: $t;
-ms-transition: $t;
transition: $t;
}
@mixin keyboard($key-height) {
.jk-keyboard {
height: $key-height * 4;
}
.jk-key {
height: $key-height;
line-height: $key-height;
@each $grade in 0, 1, 2, 3 {
&.jk-height-#{$grade} {
height: $key-height * ($grade + 1);
line-height: $key-height * ($grade + 1);
}
}
}
}
.jk-keyboard {
position: fixed;
left: 0;
width: 100%;
bottom: 0;
opacity: 0.2;
@include transition(.3s all ease-in-out);
@include translate3d(0, 120%, 0);
&.open {
opacity: 1;
@include translate3d(0, 0, 0);
}
}
.jk-key {
font-size: 24px;
font-family: sans-serif;
color: $black;
display: block;
text-align: center;
position: absolute;
width: 25vw;
border: 1px solid #dedfe2;
margin: -1px;
background-color: #fafafb;
&.submit {
color: $white;
background-color: #06bf04;
&.disabled {
color: #beeabe;
background-color: #64d364;
}
}
&.jk-text {
font-size: 22px;
}
&.down {
background-color: #ededed;
}
@each $position in 'left', 'top' {
@each $grade in 0, 1, 2, 3 {
&.jk-#{$position}-#{$grade} {
#{$position}: $grade * 25%;
}
}
}
}
@include keyboard(10vh);