electron-secure-virtual-keyboard
Version:
A secure electron based virtual keyboard. Uses electron's sendInputEvent api to implement a simple customizable soft keyboard.
176 lines (155 loc) • 3.62 kB
CSS
.virtual-keyboard {
display: inline-block;
background: white;
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
user-select: none;
white-space: nowrap;
border-radius: .3em;
border-style: solid;
border-width: 0.1em;
border-color: #999;
box-shadow: 0px 9px 12px 2px rgba(0, 0, 0, 0.38);
z-index: 1;
position: relative;
pointer-events: all;
}
.virtual-keyboard .layout {
display: none;
flex-direction: row;
}
.virtual-keyboard .layout .kb-column {
display: flex;
flex-direction: column;
flex: 1 1 auto;
}
.virtual-keyboard .layout.active {
display: flex;
}
.virtual-keyboard .kb-row {
white-space: nowrap;
}
.virtual-keyboard .key {
display: inline-block;
vertical-align: bottom;
text-align: center;
margin: .2em;
padding: .3em .7em;
line-height: 1.3em;
cursor: pointer;
user-select: none;
border: 1px solid lightgrey;
border-radius: .3em;
color: grey;
white-space: nowrap;
min-width: 1em;
}
.virtual-keyboard .key.spacer {
background: transparent;
border: none;
min-width: unset;
}
.virtual-keyboard .key.sizer {
min-width: unset;
}
.virtual-keyboard .key.fill {
flex: 1 1 auto;
}
.virtual-keyboard .key:active {
background-color: lightgray;
}
.virtual-keyboard .kb-row {
display: flex;
justify-content: center;
}
.virtual-keyboard .key.space {
flex: unset;
width: 20em;
}
.virtual-keyboard .key.space.fill {
flex: 1 1 auto;
width: unset;
}
.virtual-keyboard.theme-black {
background: #1b1b1b;
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
user-select: none;
padding: .5em;
}
.virtual-keyboard.theme-black .key {
display: inline-block;
vertical-align: bottom;
background-color: rgb(56, 56, 56);
background: linear-gradient(#2c2c2c, rgb(65, 65, 65));
border-width: 0 0 .2em 0;
border-style: none none solid none;
border-radius: .3em;
border-color: rgb(15, 15, 15);
text-align: center;
color: rgb(187, 187, 187);
box-shadow: 0 0 5px 0 rgb(29, 29, 29);
cursor: pointer;
user-select: none;
}
.virtual-keyboard.theme-black .key:active {
margin-top: .4em;
border-bottom-width: 0;
background-color: rgb(15, 15, 15);
background: linear-gradient(#202020, #353535);
}
.virtual-keyboard.theme-black .key.spacer {
background: transparent;
border: none;
box-shadow: none;
}
.virtual-keyboard.theme-mac {
background: #e2e5e8;
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
user-select: none;
padding: .5em;
}
.virtual-keyboard.theme-mac .key {
display: inline-block;
vertical-align: bottom;
background-color: rgb(250, 250, 250);
background: linear-gradient(#e8e8e8, #fff);
border-width: 0 0 .2em 0;
border-style: none none solid none;
border-radius: .3em;
border-color: #aaa;
text-align: center;
color: #aaa;
box-shadow: 0 0 5px 0 #aaa;
cursor: pointer;
user-select: none;
}
.virtual-keyboard.theme-mac .key:active {
margin-top: .4em;
border-bottom-width: 0;
background-color: rgb(245, 245, 245);
background: linear-gradient(#dfd8d8, #f4f4f4);
}
.virtual-keyboard.theme-mac .key.spacer {
background: transparent;
border: none;
box-shadow: none;
}
.virtual-keyboard .kb-close-button {
display: flex;
align-items: center;
justify-content: center;
width: 2.5em;
height: 2.5em;
position: absolute;
top: -2.75em;
right: -2.75em;
background-color: white;
border-radius: 50%;
border-style: solid;
border-width: 0.1em;
border-color: #999;
box-shadow: 0px 3px 4px 1px rgba(0, 0, 0, 0.38);
z-index: 1;
font-weight: bold;
font-size: 0.75em;
cursor: pointer;
}