sk-smart-ui
Version:
简洁快速的vue ui框架
750 lines (723 loc) • 15.4 kB
CSS
* {
margin: 0;
padding: 0;
}
body {
font-size: 14px;
max-width: 540px;
margin: 0 auto;
padding-bottom: 56px;
background: #f7f7f7;
font-weight: normal;
}
*,:after,:before {
/* box-sizing:inherit;*/
/* -webkit-tap-highlight-color:transparent;*/
-moz-tap-highlight-color:transparent;
/*-webkit-box-sizing: border-box;*/
/*box-sizing: border-box;*/
}
a {
color: #333;
text-decoration: none;
}
i {
font-style: normal;
}
ul {
list-style: none;
}
.smart-ui-clear:before, .smart-ui-clear:after {
content: "";
display: table;
}
.smart-ui-clear:after {
clear: both;
overflow: hidden
}
.smart-ui-clear {
zoom: 1
}
.smart-ui-fill-bg {
display: block;
width: 100%;
height: 100%;
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
}
/* flax */
.smart-ui-flex {
display: -webkit-flex;
display: flex;
}
.smart-ui-flex-inline {
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
}
.smart-ui-flex-center {
flex-wrap: nowrap;
justify-content: center;
align-items: center;
}
.smart-ui-cursor-pointer {
cursor: pointer;
}
/* 阿里图标 */
@font-face {
font-family: 'iconfont'; /* project id 316419 */
src: url('//at.alicdn.com/t/font_7hkw41xmwzmpldi.eot');
src: url('//at.alicdn.com/t/font_7hkw41xmwzmpldi.eot?#iefix') format('embedded-opentype'),
url('//at.alicdn.com/t/font_7hkw41xmwzmpldi.woff') format('woff'),
url('//at.alicdn.com/t/font_7hkw41xmwzmpldi.ttf') format('truetype'),
url('//at.alicdn.com/t/font_7hkw41xmwzmpldi.svg#iconfont') format('svg');
}
.smart-ui-icon {
font-family:"iconfont" ;
font-size:16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-weight: normal;
}
.smart-ui-title {
text-align: center;
padding: 10px;
width: 100px;
margin:0 auto;
font-size: 16px;
border-bottom: 1px solid #f60;
}
/* layout-navbar */
.smart-ui-navbar {
background: #0097FC;
color: #fff;
font-size: 14px;
height: 45px;
line-height: 45px;
position: fixed;
width: 100%;
max-width: 540px;
z-index: 6;
}
.smart-ui-navbar .navbar-item {
width: 15%;
float: left;
height: 100%;
}
.smart-ui-navbar .navbar-title {
width: 70%;
white-space: nowrap;
text-overflow: ellipsis;
text-align: center;
}
.smart-ui-navbar .navbar-right {
text-align: right;
}
.smart-ui-navbar .navbar-left .smart-ui-icon {
font-size: 20px;
margin-left: 15%;
}
.smart-ui-navbar .navbar-right .smart-ui-icon {
font-size: 20px;
margin-right: 15%;
}
/* layout-content */
.smart-ui-layout-content {
width: 100%;
background: #f7f7f7;
padding-top: 45px;
position: relative;
z-index: 5;
/*position: fixed;
top: 45px;
bottom: 50px;*/
/*overflow-y: auto;*/
/*max-width: 540px;*/
/*z-index: 6;*/
}
/* layout-tabbar */
.smart-ui-tabbar {
background: #fff;
position: fixed;
bottom: 0;
width: 100%;
height: 55px;
border-top: 1px solid #ddd;
max-width: 540px;
z-index: 5;
}
.smart-ui-tabbar .tabbar-item {
text-align: center;
width: 33%;
color: #666;
padding-top: 5px;
}
.smart-ui-tabbar .tabbar-item .smart-ui-icon {
font-size: 20px;
}
.smart-ui-tabbar .tabbar-item .tabbar-text {
padding-top: 0px;
}
.smart-ui-tabbar .tabbar-active {
color: #0097FC;
}
.smart-ui-tabbar .smart-ui-tabbar__icon {
width: 22px;
height: 22px;
}
/* mask */
.smart-ui-mask {
position: fixed;
left: 0;
width: 100%;
height: 100%;
bottom: 0;
top: 0;
background: rgba(0, 0, 0, 0.3);
z-index: 99;
}
/* loading */
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@-webkit-keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.smart-ui-loading {
min-width: 60px;
min-height: 60px;
background: rgba(0, 0, 0, 0.8);
color: #fff;
border-radius: 5px;
text-align: center;
padding: 10px;
z-index: 100;
display: inline-block;
}
.smart-ui-loading .smart-ui-icon {
font-size: 30px;
-webkit-animation: spin 800ms infinite linear;
animation: spin 800ms infinite linear;
}
.smart-ui-loading .loading-icon {
-webkit-animation: spin .8s infinite linear;
animation: spin .8s infinite linear;
border: 4px solid transparent;
border-radius: 50%;
border-top-color: rgb(204, 204, 204);
border-left-color: rgb(204, 204, 204);
border-bottom-color: rgb(204, 204, 204);
height: 25px;
width: 25px;
margin: 0 auto;
}
.smart-ui-loading .loading-text {
padding-top:10px;
}
/* toast */
.smart-ui-toast {
background: rgba(0, 0, 0, 0.8);
color: #fff;
border-radius: 3px;
text-align: center;
padding: 8px 15px;
z-index: 100;
display: inline-block;
}
.smart-ui-loading .loading-text {
}
/* message-box */
.smart-ui-msgbox {
position:fixed;
top:50%;
left:50%;
-webkit-transform:translate3d(-50%,-50%,0);
transform:translate3d(-50%,-50%,0);
background-color:#fff;
width:85%;
border-radius:3px;
font-size:16px;
-webkit-user-select:none;
overflow:hidden;
-webkit-backface-visibility:hidden;
backface-visibility:hidden;
-webkit-transition:.2s;
transition:.2s
}
.smart-ui-msgbox .msgbox-header {
padding:15px 0 0
}
.smart-ui-msgbox .msgbox-content {
padding:10px 20px 15px;
border-bottom:1px solid #ddd;
min-height:36px;
position:relative
}
.smart-ui-msgbox .msgbox-input {
padding-top:15px
}
.smart-ui-msgbox .msgbox-input input {
border:1px solid #dedede;
border-radius:5px;
padding:4px 5px;
width:95%;
-webkit-appearance:none;
-moz-appearance:none;
appearance:none;
outline:none
}
.smart-ui-msgbox .msgbox-input input.invalid,.smart-ui-msgbox .msgbox-input input.invalid:focus {
border-color:#ff4949
}
.smart-ui-msgbox .msgbox-errormsg {
color:red;
font-size:12px;
min-height:18px;
margin-top:2px
}
.smart-ui-msgbox .msgbox-title {
text-align:center;
padding-left:0;
margin-bottom:0;
font-size:16px;
font-weight:700;
color:#333
}
.smart-ui-msgbox .msgbox-message {
color:#999;
margin:0;
text-align:center;
line-height:36px
}
.smart-ui-msgbox .msgbox-btns {
display:-webkit-box;
display:-ms-flexbox;
display:flex;
height:40px;
line-height:40px
}
.smart-ui-msgbox .msgbox-btn {
line-height:35px;
display:block;
background-color:#fff;
-webkit-box-flex:1;
-ms-flex:1;
flex:1;
margin:0;
border:0
}
.smart-ui-msgbox .msgbox-btn:focus {
outline:none
}
.smart-ui-msgbox .msgbox-btn:active {
background-color:#fff
}
.smart-ui-msgbox .msgbox-cancel {
width:50%;
border-right:1px solid #ddd
}
.smart-ui-msgbox .msgbox-cancel:active {
color:#000
}
.smart-ui-msgbox .msgbox-confirm {
color:#26a2ff;
width:50%
}
.smart-ui-msgbox .msgbox-confirm:active {
color:#26a2ff
}
.msgbox-bounce-enter {
opacity:0;
-webkit-transform:translate3d(-50%,-50%,0) scale(.7);
transform:translate3d(-50%,-50%,0) scale(.7)
}
.msgbox-bounce-leave-active {
opacity:0;
-webkit-transform:translate3d(-50%,-50%,0) scale(.9);
transform:translate3d(-50%,-50%,0) scale(.9)
}
/* field */
.smart-ui-input {
display: inline-block;
background: 0 0;
width: 100%;
max-width: 100%;
margin-bottom: 2px;
padding: 10px 0;
border: 0;
outline: 0;
transition: all .3s;
border-bottom: 1px solid #eee;
}
.smart-ui-input:hover {
border-color: #0097FC;
}
.smart-ui-field {
padding: 10px 10px;
/*margin: 15px 0;*/
background: #fff;
}
.smart-ui-field .field-title {
font-size: 0.9rem;
color: #666;
padding: 8px 0;
}
.smart-ui-field .field-has-button .input-area {
float: left;
width: 70%;
}
.smart-ui-field .field-has-button .field-button {
float: right;
width: 28%;
}
.smart-ui-field .field-has-button .field-button .smart-ui-button {
padding: 0;
width: 100%;
text-align: center;
line-height: 38px;
}
/* button */
.smart-ui-button {
background: #0097FC;
color: #fff;
padding: 12px;
border-radius: 2px;
border: none;
}
.smart-ui-button:hover {
background: #004191;
}
.smart-ui-button-full-width {
width: 100%;
padding: 12px 0;
text-align:center;
}
.smart-ui-button-small {
padding: 6px 8px;
}
.smart-ui-button-big {
padding: 15px 15px;
}
/* select */
.smart-ui-select {
position: relative;
}
.smart-ui-select-inline {
display: inline-block;
}
.smart-ui-select .select-value {
border-bottom: 1px solid #eee;
position: relative;
padding: 10px 0;
}
.smart-ui-select-inline .select-value {
padding: 10px 35px 10px 10px;
}
.smart-ui-select .select-value .smart-ui-icon {
position: absolute;
right: 5px;
top: 12px;
}
.smart-ui-select .select-value:hover, .smart-ui-select .select-active {
border-color: #0097FC;
}
.smart-ui-select .select-list {
width: 100%;
position: absolute;
left:0;
max-height: 150px;
background: #fff;
overflow-y: auto;
box-shadow: 0px 2px 10px 0px #ccc;
z-index: 10;
/*border-radius: 0 0 3px 3px;*/
}
.smart-ui-select .select-list li {
margin: 0 10px;
padding: 12px 0;
border-bottom: 1px solid #eee;
}
.smart-ui-select .select-list li:last-child {
border: none;
}
/* numeric */
.smart-ui-numeric {
transition: all .3s;
border-bottom: 1px solid #eee;
display: inline-block;
padding: 10px 0 0px 0;
}
.smart-ui-numeric:hover {
border-color: #0097FC;
}
.smart-ui-numeric .smart-ui-icon {
cursor: pointer;
color: #777;
font-size: 20px;
padding: 0 5px;
}
.smart-ui-numeric .smart-ui-icon:hover {
color: #0097FC;
transition: all .3s;
}
.smart-ui-numeric .smart-ui-input {
width: 30px;
text-align: center;
border: none;
color: #666;
padding: 0;
font-size: 18px;
}
/* media-panel */
.smart-ui-media-panel {
height: 100px;
border-bottom: 1px solid #eee;
background: #fff;
}
.smart-ui-media-panel .media-panel-img {
width: 25%;
line-height: 100px;
}
.smart-ui-media-panel .media-panel-img img {
width: 80px;
/*height: 80px;*/
vertical-align: middle;
margin-left: 10px;
border-radius: 5px;
}
.smart-ui-media-panel .media-panel-main {
width: 70%;
margin-right: 3%;
}
.smart-ui-media-panel .media-panel-main p {
display: block;
line-height: 20px;
color: #666;
}
.smart-ui-media-panel .media-panel-main .media-panel-title {
color: #000;
font-size: 0.9rem;
padding-top: 10px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.smart-ui-media-panel .media-panel-main .media-panel-intro {
font-size: 13px;
color: #999;
padding-top: 2px;
height: 40px;
text-overflow: ellipsis;
overflow: hidden;
}
@media screen and (max-width: 360px) {
.smart-ui-media-panel .media-panel-img img {
width: 60px;
height: 60px;
vertical-align: middle;
margin-left: 10px;
border-radius: 5px;
}
}
/* tab */
.smart-ui-tab {
background: #fff;
}
.smart-ui-tab .tab-item {
display: inline-block;
padding: 15px 20px;
text-decoration: none;
color: #333;
}
.smart-ui-tab .tab-item-active {
border-bottom: 1px solid #0097FC;
}
/* radio */
.smart-ui-radio label {
line-height: 22px;
display: block;
padding: 5px;
}
.smart-ui-radio .radio-input {
display: inline-block;
height: 22px;
width: 22px;
vertical-align: middle;
}
.smart-ui-radio .radio-input input {
display: none;
}
.smart-ui-radio .radio-input input+div {
position: relative;
}
.smart-ui-radio .radio-input input+div:before, .smart-ui-radio .radio-input input+div:after {
content: "";
position: absolute;
top: 0;
left: 0;
border-radius: 50%;
transition: .3s ease;
}
.smart-ui-radio .radio-input input+div:before {
width: 18px;
height: 18px;
border: 2px solid #bdbdbd;
}
.smart-ui-radio .radio-input input:checked+div:before {
border: 2px solid #027be3;
}
.smart-ui-radio .radio-input input+div:after {
-webkit-transform: scale(0);
transform: scale(0);
margin: 6px;
width: 10px;
height: 10px;
}
.smart-ui-radio .radio-input input:checked+div:after {
background: #027be3;
-webkit-transform: scale(1.02);
transform: scale(1.02);
}
/* toggle */
.smart-ui-toggle {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
position: relative;
}
.smart-ui-toggle * {
pointer-events: none;
}
.smart-ui-toggle-input {
display: none;
}
.smart-ui-toggle-core {
display: inline-block;
position: relative;
width: 52px;
height: 32px;
border: 1px solid #d9d9d9;
border-radius: 16px;
box-sizing: border-box;
background: #d9d9d9;
}
.smart-ui-toggle-core:after, .smart-ui-toggle-core:before {
content: " ";
top: 0;
left: 0;
position: absolute;
-webkit-transition: -webkit-transform .3s;
transition: -webkit-transform .3s;
transition: transform .3s;
transition: transform .3s,-webkit-transform .3s;
border-radius: 15px;
}
.smart-ui-toggle-core:before {
width: 50px;
height: 30px;
background-color: #fdfdfd;
}
.smart-ui-toggle-core:after {
width: 30px;
height: 30px;
background-color: #fff;
box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.smart-ui-toggle-label {
margin-left: 10px;
display: inline-block;
}
.smart-ui-toggle-input:checked+.smart-ui-toggle-core {
border-color: #26a2ff;
background-color: #26a2ff;
}
.smart-ui-toggle-input:checked+.smart-ui-toggle-core:before {
-webkit-transform: scale(0);
transform: scale(0);
}
.smart-ui-toggle-input:checked+.smart-ui-toggle-core:after {
-webkit-transform: translateX(20px);
transform: translateX(20px);
}
/* tab */
.smart-ui-tab {
background: #fff;
}
.smart-ui-tab .tab-item {
display: inline-block;
padding: 15px 20px;
text-decoration: none;
color: #333;
}
.smart-ui-tab .tab-item-active {
border-bottom: 1px solid #0097FC;
}
/* cells */
.smart-ui-cells {
padding: 0 10px;
margin: 8px 0px;
background: #fff;
}
.smart-ui-cells__item {
border-bottom: 1px solid #eee;
padding: 12px 0;
}
.smart-ui-cells .smart-ui-cells__item:last-child {
border-bottom: none;
}
.smart-ui-cells__item-text {
width: 60%;
color: #666;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.smart-ui-cells__item-text__icon {
color: #f60;
font-size: 18px;
}
.smart-ui-cells__item-nav {
color: #999;
width: 38%;
text-align: right;
}
.smart-ui-cells__item-icon {
font-size: 18px;
}
.smart-ui-cells__item-value {
width: 92%;
}
/* infinite-scroll */
.smart-ui-infinite-scroll__more {
text-align: center;
padding: 20px 0;
}
.smart-ui-infinite-scroll__none {
text-align: center;
padding: 80px 0;
color: #666;
font-size: 18px;
}
/* grid */
.smart-ui-grid {
background: #fff;
padding: 15px 10px;
line-height: 24px;
}
.smart-ui-grid__name {
width: 20%;
color: #666;
float: left;
}
.smart-ui-grid__value {
width: 75%;
color: #444;
float: right;
}