w-ui
Version:
A Vue.js 2.0 UI Toolkit for mobile
169 lines (153 loc) • 3.39 kB
text/less
@line-color: #D9D9D9;
.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;
}
.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;
}
// 遮罩层
// -----------------------------------------------------------------------------
.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;
}
@datetime-item-height: 38px;
.wui {
&-datetime-mask {
.mask(rgba(0, 0, 0, .4), 1500 + 2);
}
&-datetime {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
z-index: 1500 + 2;
background-color: #FFF;
transform: translate(0, 100%);
transition: transform .25s;
touch-action: none;
&-active {
transform: translate(0, 0);
}
}
&-datetime-input {
width: 100%;
}
&-datetime-head {
display: flex;
justify-content: space-between;
position: relative;
background-color: #FBFBFB;
&:after {
.bottom-line(@line-color);
}
> a {
height: 43px;
padding: 0 30px;
font-size: 15px;
display: flex;
align-items: center;
color: #555;
}
> a:last-child {
color: #0BB20C;
}
}
&-datetime-content {
position: relative;
width: 100%;
height: @datetime-item-height * 7;
overflow: hidden;
display: flex;
}
&-datetime-item {
font-size: 16px;
height: 100%;
position: relative;
flex: 1;
}
&-datetime-item-content {
> span {
width: 100%;
display: block;
height: @datetime-item-height;
line-height: @datetime-item-height;
text-align: center;
}
}
&-datetime-item-box {
height: 100%;
}
&-datetime-shade,
&-datetime-indicator {
pointer-events: none;
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
}
&-datetime-shade {
z-index: 3;
transform: translateZ(0px);
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6)), linear-gradient(to top, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6));
background-position: top, bottom;
background-size: 100% @datetime-item-height * 3;
background-repeat: no-repeat;
}
&-datetime-indicator {
z-index: 4;
display: flex;
justify-content: center;
flex-direction: column;
> span {
display: block;
width: 100%;
height: @datetime-item-height;
position: relative;
&:after {
.top-line(@line-color);
}
&:before {
.bottom-line(@line-color);
}
}
}
}