UNPKG

@qymh/vue-q-select

Version:

一个高性能的vue移动端下拉选择插件

305 lines (296 loc) 6.63 kB
.q-select-bk { position: fixed; left: 0; top: 0; height: 100vh; width: 100%; background-color: #000; opacity: 0.3; } .q-select { position: fixed; width: 100%; height: auto; background-color: #fff; bottom: 0; left: 0; } .q-select-header { display: -webkit-box; display: -ms-flexbox; display: flex; position: relative; } .q-select-header::after { content: ' '; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; -webkit-transform-origin: bottom right; transform-origin: bottom right; -webkit-transform: scaleY(0.5); transform: scaleY(0.5); border-bottom: 1px solid #ebebeb; } .q-select-header > .q-select-header-title { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; -ms-flex-negative: 1; flex-shrink: 1; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; white-space: nowrap; text-overflow: ellipsis; text-align: center; width: 100%; overflow: hidden; } .q-select-header > .q-select-header-cancel, .q-select-header > .q-select-header-confirm { -webkit-box-flex: 0; -ms-flex-positive: 0; flex-grow: 0; -ms-flex-negative: 0; flex-shrink: 0; -webkit-box-align: center; -ms-flex-align: center; align-items: center; display: -webkit-box; display: -ms-flexbox; display: flex; } .q-select-header > .q-select-header-confirm { -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; } .q-select-header-title__value { white-space: nowrap; text-overflow: ellipsis; text-align: center; width: 100%; overflow: hidden; color: #4a90e2; } .q-select-box { display: -webkit-box; display: -ms-flexbox; display: flex; } .q-select-box-item { -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; -ms-flex-negative: 1; flex-shrink: 1; position: relative; overflow: hidden; } .q-select-flex { display: -webkit-box; display: -ms-flexbox; display: flex; } .q-select-none { display: none; } .q-select-box-item-collections { width: 100%; will-change: transform; } .q-select-box-item-collections__tick { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .q-select-box-item-collections__tick--disabled { opacity: 0.3; } .q-select-box-item__highlight { width: 100%; position: absolute; left: 0; } .q-select-box-item__highlight::before { content: ' '; position: absolute; left: 0; top: 0; width: 100%; height: 1px; -webkit-transform-origin: 0 0; transform-origin: 0 0; -webkit-transform: scaleY(0.5); transform: scaleY(0.5); border-top: 1px solid #ebebeb; } .q-select-box-item__highlight::after { content: ' '; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; -webkit-transform-origin: bottom right; transform-origin: bottom right; -webkit-transform: scaleY(0.5); transform: scaleY(0.5); border-bottom: 1px solid #ebebeb; } .q-select-box-item__overlay { height: 100%; width: 100%; position: absolute; z-index: 5; background-position: top, bottom; background-repeat: no-repeat; background-image: -webkit-gradient( linear, left top, left bottom, from(rgba(255, 255, 255, 0.95)), to(rgba(255, 255, 255, 0.6)) ), -webkit-gradient(linear, left bottom, left top, from(rgba(255, 255, 255, 0.95)), to(rgba(255, 255, 255, 0.6))); 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)); } .q-select-loading { width: 100%; position: absolute; display: none; z-index: 6; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } .q-select-loading-svg { -webkit-animation: loading-rotate 2s linear infinite; animation: loading-rotate 2s linear infinite; } .q-select-loading-svg__circle { -webkit-animation: loading-dash 1.5s ease-in-out infinite; animation: loading-dash 1.5s ease-in-out infinite; stroke-dasharray: 90, 150; stroke-dashoffset: 0; stroke-width: 2; stroke-linecap: round; stroke: #4a90e2; } .animated { -webkit-animation-fill-mode: both; animation-fill-mode: both; -webkit-animation-duration: 200ms; animation-duration: 200ms; } @-webkit-keyframes loading-dash { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90, 150; stroke-dashoffset: -40; } 100% { stroke-dasharray: 90, 150; stroke-dashoffset: -120; } } @keyframes loading-dash { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90, 150; stroke-dashoffset: -40; } 100% { stroke-dasharray: 90, 150; stroke-dashoffset: -120; } } @-webkit-keyframes loading-rotate { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes loading-rotate { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @-webkit-keyframes slideInUp { from { -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); visibility: visible; } to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } } @keyframes slideInUp { from { -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); visibility: visible; } to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } } .slideInUp { -webkit-animation-name: slideInUp; animation-name: slideInUp; } @-webkit-keyframes slideOutDown { from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } to { visibility: hidden; -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); } } @keyframes slideOutDown { from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } to { visibility: hidden; -webkit-transform: translate3d(0, 100%, 0); transform: translate3d(0, 100%, 0); } } .slideOutDown { -webkit-animation-name: slideOutDown; animation-name: slideOutDown; }