w-ui
Version:
A Vue.js 2.0 UI Toolkit for mobile
211 lines (198 loc) • 4.4 kB
text/less
@line-color: #D9D9D9;
.mask(@bgcolor: rgba(0, 0, 0, .4), @z-index: @base-zindex * 1500) {
background-color: @bgcolor;
position: fixed;
z-index: @z-index;
bottom: 0;
right: 0;
left: 0;
top: 0;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
}
.top-line(@color, @zindex: 0) {
content: '';
position: absolute;
z-index: @zindex;
top: 0;
left: 0;
width: 100%;
border-top: 1px solid @color;
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
}
.right-line(@color, @zindex: 0) {
content: '';
position: absolute;
z-index: @zindex;
top: 0;
right: 0;
height: 100%;
border-right: 1px solid @color;
-webkit-transform: scaleX(.5);
transform: scaleX(.5);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
}
.bottom-line(@color, @zindex: 0) {
content: '';
position: absolute;
z-index: @zindex;
bottom: 0;
left: 0;
width: 100%;
border-bottom: 1px solid @color;
-webkit-transform: scaleY(.5);
transform: scaleY(.5);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
}
.wui {
&-keyboard-mask {
.mask(rgba(0, 0, 0, .4), 1500 + 2);
}
&-keyboard {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
z-index: 1500 + 2;
transform: translate(0, 100%);
transition: transform .3s;
background-color: #F7F7F7;
&-active {
transform: translate(0, 0);
}
&-content {
background-color: #FFF;
margin-top: .3rem;
position: relative;
&:before {
.top-line(@line-color);
}
}
&-title {
overflow: hidden;
padding: .2rem 0 .12rem;
color: #222;
margin-bottom: 1px; /* for old android */
font-size: .24rem;
text-align: center;
background-color: #FFF;
&:before {
content: '\e60a';
font-size: .26rem;
color: #FF2424;
line-height: 1;
margin-right: .06rem;
}
}
&-numbers {
font-size: .48rem;
background-color: #FFF;
> li {
width: 100%;
display: flex;
> a {
width: 1%; /* for old android */
flex: 1;
color: #222;
height: 1.2rem;
position: relative;
display: flex;
justify-content: center;
align-items: center;
&:not(:last-child):after {
.right-line(@line-color);
}
&:before {
.top-line(@line-color);
}
}
&:last-child {
> a:last-child,
> a:nth-last-child(3) {
background-color: #F7F7F7;
font-size: .3rem;
color: #686868;
}
}
}
}
&-head {
height: .8rem;
display: flex;
justify-content: center;
align-items: center;
color: #1F2324;
font-size: .3rem;
position: relative;
&:after {
.bottom-line(@line-color);
}
}
&-password {
margin: 0 .8rem;
display: flex;
position: relative;
background-color: #FFF;
&:after {
content: '';
width: 200%;
height: 200%;
transform: scale(.5);
position: absolute;
border: 1px solid @line-color;
top: 0;
left: 0;
transform-origin: 0 0;
border-radius: 4px;
}
li {
flex: 1;
position: relative;
display: flex;
justify-content: center;
align-items: center;
height: 1rem;
&:not(:last-child):after {
content: '';
width: 1px;
height: 50%;
position: absolute;
right: 0;
top: 25%;
background-color: @line-color;
transform: scaleX(.5);
}
i {
width: 6px;
height: 6px;
border-radius: 50%;
background-color: #000;
}
}
}
&-error {
padding: 2px .8rem;
color: #F00;
overflow: hidden;
height: .5rem;
line-height: .5rem;
font-size: .24rem;
text-align: left;
}
}
}