Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit 36237b7

Browse files
committed
Improved keyboard init animation
1 parent e8c1a68 commit 36237b7

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/_renderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ initUI = () => {
9696
document.getElementById("keyboard").setAttribute("class", "animation_state_1 animation_state_2");
9797
setTimeout(() => {
9898
document.getElementById("keyboard").setAttribute("class", "");
99-
}, 1500);
99+
}, 1100);
100100
}, 100);
101101
}, 50);
102102
}, 260);

src/assets/css/keyboard.css

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,31 @@ div.keyboard_row {
1616
}
1717

1818
section#keyboard.animation_state_2 > div.keyboard_row:nth-child(1) {
19-
transition: width .5s cubic-bezier(0.4, 0, 1, 1), background .1s linear .5s;
19+
transition: width .7s cubic-bezier(0.4, 0, 1, 1) .2s, filter .1s linear .8s;
2020
}
2121
section#keyboard.animation_state_2 > div.keyboard_row:nth-child(2) {
22-
transition: width .5s cubic-bezier(0.4, 0, 1, 1) .2s, background .1s linear .7s;
22+
transition: width .7s cubic-bezier(0.4, 0, 1, 1) .1s, filter .1s linear .6s;
2323
}
2424
section#keyboard.animation_state_2 > div.keyboard_row:nth-child(3) {
25-
transition: width .5s cubic-bezier(0.4, 0, 1, 1) .4s, background .1s linear .9s;
25+
transition: width .7s cubic-bezier(0.4, 0, 1, 1), filter .1s linear .5s;
2626
}
2727
section#keyboard.animation_state_2 > div.keyboard_row:nth-child(4) {
28-
transition: width .5s cubic-bezier(0.4, 0, 1, 1) .6s, background .1s linear 1.1s;
28+
transition: width .7s cubic-bezier(0.4, 0, 1, 1) .3s, filter .1s linear 1s;
2929
}
3030
section#keyboard.animation_state_2 > div.keyboard_row:nth-child(5) {
31-
transition: width .5s cubic-bezier(0.4, 0, 1, 1) .8s, background .1s linear 1.3s;
31+
transition: width .6s cubic-bezier(0.4, 0, 1, 1) .2s, filter .1s linear .8s;
3232
}
3333

3434
section#keyboard.animation_state_1 > * {
35-
background-color: rgba(190, 230, 193, 1);
35+
filter: brightness(170%);
3636
width: 0px;
3737
overflow: hidden;
3838
}
3939

4040
section#keyboard.animation_state_2 > * {
41-
width: 53vw;
42-
background-color: rgba(190, 230, 193, 0);
41+
filter: brightness(100%);
42+
width: 100vw;
43+
overflow: hidden;
4344
}
4445

4546
div.keyboard_row:last-child {
@@ -123,6 +124,7 @@ div.keyboard_key > h4, div.keyboard_row > .keyboard_key:last-child > *:not(h1),
123124

124125
div.keyboard_row:not(:nth-child(4)):not(:last-child) > .keyboard_key:last-child, div.keyboard_row > .keyboard_key:first-child {
125126
width: 90px;
127+
min-width: 90px;
126128
}
127129

128130
div.keyboard_key#keyboard_spacebar, div.keyboard_enter {
@@ -132,6 +134,7 @@ div.keyboard_key#keyboard_spacebar, div.keyboard_enter {
132134
div.keyboard_row#row_1 > div.keyboard_enter {
133135
border-bottom-right-radius: 0px;
134136
width: 105px;
137+
min-width: 105px;
135138
}
136139

137140
div.keyboard_row#row_1 > div.keyboard_enter > h1 {
@@ -144,6 +147,7 @@ div.keyboard_row#row_2 > div.keyboard_enter {
144147
border-top-left-radius: 0px;
145148
border-top: 2px solid #090b0a;
146149
width: 84px;
150+
min-width: 84px;
147151
margin-top: 0px;
148152
height: 69px;
149153
top: -4px;
@@ -156,6 +160,7 @@ div.keyboard_row#row_2 > div.keyboard_enter:active, div.keyboard_row#row_2 > div
156160

157161
div.keyboard_key#keyboard_spacebar {
158162
width: 515px;
163+
min-width: 515px;
159164
height: 38px;
160165
}
161166

0 commit comments

Comments
 (0)