Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
oetzit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
commul
oetzit
Commits
8a547dfd
Commit
8a547dfd
authored
3 years ago
by
Paolo.Brasolin
Browse files
Options
Downloads
Patches
Plain Diff
feat: #fe restyle keyboard
parent
7cc89c18
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/css/keyboard.scss
+66
-80
66 additions, 80 deletions
frontend/src/css/keyboard.scss
frontend/src/js/typewriter.ts
+2
-2
2 additions, 2 deletions
frontend/src/js/typewriter.ts
with
68 additions
and
82 deletions
frontend/src/css/keyboard.scss
+
66
−
80
View file @
8a547dfd
$kbd-gutter
:
3px
;
$kbd-gutter
:
0
.5vw
;
$key-width
:
8vw
;
$key-width
:
8vw
;
// 100/12 ~ 8.3
.hg-theme-default
{
.hg-theme-default
{
width
:
100%
;
/* keyboard placement */
user-select
:
none
;
box-sizing
:
border-box
;
overflow
:
hidden
;
touch-action
:
manipulation
;
// font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-family
:
"Courier New"
,
Courier
,
monospace
;
// background-color: #ececec;
position
:
absolute
;
background-color
:
#aaaa
;
bottom
:
0
;
// padding: 5px;
padding
:
$kbd-gutter
;
// border-radius: 5px;
font-weight
:
bold
;
/* keyboard sizing */
// font-size: 20px;
.hg-button
span
{
box-sizing
:
border-box
;
pointer-events
:
none
;
overflow
:
hidden
;
}
width
:
100%
;
height
:
100%
;
max-height
:
30vh
;
button
.hg-button
{
/* rows layout */
border-width
:
0
;
outline
:
0
;
font-size
:
inherit
;
}
.hg-button
{
.hg-rows
{
display
:
inline-block
;
height
:
100%
;
flex-grow
:
1
;
display
:
grid
;
cursor
:
pointer
;
grid-auto-rows
:
1fr
;
// grid-row-gap: $kbd-gutter;
}
}
.hg-row
{
/* keys layout */
display
:
flex
;
&
:not
(
:last-child
)
{
.hg-row
{
// margin-bottom: 5px;
display
:
grid
;
margin-bottom
:
$kbd-gutter
;
grid-auto-flow
:
column
;
// grid-column-gap: $kbd-gutter;
&
:nth-child
(
1
)
{
grid-auto-columns
:
8vw
8vw
8vw
8vw
8vw
8vw
8vw
8vw
8vw
8vw
8vw
1fr
;
}
}
&
:nth-child
(
2
)
{
.hg-button
:not
(
:last-child
)
{
padding-left
:
0
.5
*
$key-width
;
// margin-right: 5px;
grid-auto-columns
:
8vw
8vw
8vw
8vw
8vw
8vw
8vw
8vw
8vw
8vw
8vw
;
margin-right
:
$kbd-gutter
;
}
}
&
:nth-child
(
3
)
{
.hg-button-container
{
grid-auto-columns
:
1fr
8vw
8vw
8vw
8vw
8vw
8vw
8vw
8vw
1fr
;
// margin-right: 5px;
margin-right
:
$kbd-gutter
;
display
:
flex
;
}
}
}
>
div
:last-child
{
/* gutters */
margin-right
:
0
;
}
&
:nth-child
(
2
)
{
padding
:
0
.5
*
$kbd-gutter
;
margin-left
:
0
.5
*
$key-width
;
.hg-button
{
}
margin
:
0
.5
*
$kbd-gutter
;
}
}
/* keycaps */
.hg-button
{
.hg-button
{
// box-shadow: 0px 0px 3px -1px rgba(0, 0, 0, 0.3);
font-family
:
"Courier New"
,
Courier
,
monospace
;
height
:
40px
;
color
:
white
;
border-radius
:
5px
;
font-weight
:
bold
;
box-sizing
:
border-box
;
text-shadow
:
0
0
8px
black
;
// padding: 5px;
font-size
:
max
(
4vw
,
20px
);
background
:
white
;
// border-bottom: 1px solid #b5b5b5;
border-radius
:
0
.125
*
$key-width
;
cursor
:
pointer
;
background
:
#fff4
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
-webkit-tap-highlight-color
:
rgba
(
0
,
0
,
0
,
0
);
&
.hg-standardBtn
{
-webkit-tap-highlight-color
:
rgba
(
0
,
0
,
0
,
0
);
// width: 20px;
// width: $key-width;
max-width
:
8vw
;
// 100/12 ~ 8.3
}
&
.hg-activeButton
{
&
.hg-activeButton
{
background
:
#ff0
;
background
:
lightyellow
;
&
[
data-skbtn
=
"{backspace}"
]
{
background-color
:
lightcoral
;
}
&
[
data-skbtn
=
"{space}"
]
{
background-color
:
lightblue
;
}
&
[
data-skbtn
=
"{enter}"
]
{
background-color
:
lightgreen
;
}
}
}
}
}
// .hg-button {
/* interaction */
// &.hg-functionBtn {
// &[data-skbtn="{bksp}"] {
// background-color: lightcoral;
// }
// &[data-skbtn="{space}"] {
// background-color: lightblue;
// }
// &[data-skbtn="{enter}"] {
// background-color: lightgreen;
// }
// }
// }
}
.simple-keyboard
{
user-select
:
none
;
position
:
absolute
;
touch-action
:
manipulation
;
bottom
:
0
;
.hg-button
{
cursor
:
pointer
;
span
{
pointer-events
:
none
;
}
}
}
}
This diff is collapsed.
Click to expand it.
frontend/src/js/typewriter.ts
+
2
−
2
View file @
8a547dfd
...
@@ -78,8 +78,8 @@ class Typewriter {
...
@@ -78,8 +78,8 @@ class Typewriter {
},
},
display
:
{
display
:
{
[
Key
.
Backspace
]:
"
⟵
"
,
// "⌫⟵",
[
Key
.
Backspace
]:
"
⟵
"
,
// "⌫⟵",
[
Key
.
Enter
]:
"
↵
"
,
// "⏎↩↵⏎",
[
Key
.
Enter
]:
"
↩
"
,
// "⏎↩↵⏎",
[
Key
.
Space
]:
"
␣
"
,
// "␣",
[
Key
.
Space
]:
"
"
,
// "␣",
},
},
onChange
:
this
.
keyboardOnChangeHandler
.
bind
(
this
),
onChange
:
this
.
keyboardOnChangeHandler
.
bind
(
this
),
}
as
KeyboardOptions
);
}
as
KeyboardOptions
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment