@yeepay/virtual-keyboard
Version:
YeePay Virtual Keyboard Component
335 lines (310 loc) • 7.44 kB
text/less
@media (min-width: 768px) {
.yeepay-input-container {
position: relative;
width: 100%;
.yee_pwd_input {
user-select: none;
position: relative;
font-size: 14px;
display: inline-block;
background-color: #f5f7fa;
color: #c0c4cc;
cursor: not-allowed;
background-image: none;
border-radius: 4px;
border: 1px solid #e4e7ed;
box-sizing: border-box;
color: #606266;
height: 40px;
line-height: 40px;
outline: none;
padding: 0 15px;
width: 100%;
&::placeholder {
font-size: 14px;
color: #c0c4cc;
}
}
.yee_pwd_mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
}
}
.yeepay-security-keyboard_pc {
position: relative;
background-color: #eee;
padding: 0 ;
margin-top: 0 ;
z-index: var(--keyboard-z-index, 2010) ;
.yeepay-keyboard-container {
width: max-content;
top: 40px;
left: 0;
gap: 2px;
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
user-select: none;
background-color: #eee;
display: flex;
flex-direction: column;
align-items: center;
min-width: 600px;
margin: 2px auto;
padding: 2px 4px;
.keyboard-header {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
position: relative;
.logo {
width: 24px;
height: 24px;
}
.title {
font-size: 14px;
margin-left: 10px;
}
&::after {
content: '';
position: absolute;
display: block;
width: 100%;
bottom: 0;
border-bottom: 1px solid #ece;
}
}
.letter-btn {
width: 34px;
height: 34px;
background-color: #fefefe;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.letter-btn:hover {
background-color: #ddd;
}
.keyboard-row ,.punctuation-row{
display: grid;
grid-template-columns: repeat(16, 1fr); /* 每行最多 16 个按钮 */
gap: 2px;
width: 100%;
.toggle-btn,
.reset-btn {
grid-column: 14 / span 3;
// 宽度自动扩展
width: auto;
}
}
.letter-content {
width: 100%;
display: grid;
grid-template-columns: repeat(16, 1fr);
grid-template-rows: repeat(3, 1fr);
gap: 2px;
.letter-row {
display: grid;
grid-column: 1 / span 14;
grid-template-columns: repeat(14, 1fr);
gap: 2px;
width: 100%;
}
.confirm-btn {
grid-row: 1 / span 3;
grid-column: 15 / span 2;
background-color: #23ac38;
width: 100%;
height: 100%; /* 确保按钮的高度填满其容器 */
color: #fff;
&:hover {
background-color: #1e9c34;
}
}
}
.keyboard-footer {
display: flex;
justify-content: space-between;
width: 100%;
margin-top: 10px;
}
.password-dot {
display: inline-block;
width: 20px;
height: 20px;
background-color: #ccc;
margin: 0 5px;
border-radius: 50%;
}
.char-UpperCase {
font-size: 18px;
font-weight: 500;
text-transform: uppercase;
}
}
}
}
// 媒体查询 适配手机
@media (max-width: 768px) {
body{
padding-bottom: env(safe-area-inset-bottom, 20px);
}
.yeepay-security-keyboard_mobile{
padding: 0 ;
margin-top: 0 ;
position: fixed ;
z-index: var(--keyboard-z-index, 2010) ;
left: 0 ;
right: 0 ;
width: 100% ;
}
.yeepay-input-container {
position: relative;
width: 100%;
.yee_pwd_input {
user-select: none;
position: relative;
font-size: 14px;
display: inline-block;
background-color: #f5f7fa;
color: #c0c4cc;
cursor: not-allowed;
background-image: none;
border-radius: 4px;
border: 1px solid #e4e7ed;
box-sizing: border-box;
color: #606266;
height: 40px;
line-height: 40px;
outline: none;
padding: 0 15px;
width: 100%;
&::placeholder {
font-size: 14px;
color: #c0c4cc;
}
}
.yee_pwd_mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
}
}
.yeepay-keyboard-container {
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
user-select: none;
background-color: #eee;
display: flex;
flex-direction: column;
align-items: center;
margin: 2px auto;
// padding: 2px 2px;
padding-bottom: env(safe-area-inset-bottom, 20px);
.keyboard-header {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
position: relative;
.logo {
width: 24px;
height: 24px;
}
.title {
font-size: 14px;
margin-left: 10px;
}
&::after {
content: '';
position: absolute;
display: block;
width: 100%;
bottom: 0;
border-bottom: 1px solid #ece;
}
}
.letter-btn {
width: 30px;
height: 30px;
background-color: #fefefe;
color: #333;
border: 1px solid #ccc;
border-radius: none;
box-sizing: border-box;
border-radius: 5px;
font-size: 14px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
// 第一个 class punctuation-row
.keyboard-row, .punctuation-row{
display: grid;
grid-template-columns: repeat(12, 1fr); /* 每行最多 13 个按钮 */
width: 100%;
.toggle-btn,
.reset-btn {
grid-column: 11 / span 2;
// 宽度自动扩展
width: auto;
font-size: 11px;
}
}
.letter-content {
width: 100%;
display: grid;
grid-template-columns: repeat(12, 1fr);
grid-template-rows: repeat(3, 1fr);
// gap: 2px;
.letter-row {
display: grid;
grid-column: 1 / span 10;
grid-template-columns: repeat(9, 1fr);
// gap: 2px;
width: 100%;
}
.confirm-btn {
grid-row: 1 / span 3;
grid-column: 11 / span 3;
background-color: #23ac38;
box-sizing: border-box;
width: 100%;
height: 100%; /* 确保按钮的高度填满其容器 */
color: #fff;
&:hover {
background-color: #1e9c34;
}
}
}
.keyboard-footer {
display: flex;
justify-content: space-between;
width: 100%;
margin-top: 10px;
}
.password-dot {
display: inline-block;
width: 20px;
height: 20px;
background-color: #ccc;
margin: 0 5px;
border-radius: 50%;
}
.char-UpperCase {
font-size: 14px;
font-weight: 500;
text-transform: uppercase;
}
}
}