UNPKG

multi-func-picker

Version:

A multi-functional picker that can be time-picker, date-picker or custom-picker.

197 lines (196 loc) 4.11 kB
*{ margin: 0; padding: 0; } *,*:before, *,*:after{ box-sizing: border-box; -webkit-box-sizing: border-box; } .dw-mbody{ width: 100%; max-width: 487px; margin: 0 auto; } .dw-mask-div{ position: fixed; width: 100%; left: 0; top: 0; right: 0; bottom: 0; z-index: 9; opacity: 0; transition: opacity 0.2s linear 0s; } .dw-mask-div .dw-bg{ width: 100%; height: 100%; background: rgba(0,0,0,0.6); } .dw-body{ position: absolute; width: 100%; min-height: 220px; left: 0; bottom: 0; padding-bottom: 45px; background: #f5f5f5; -webkit-transform: translate(0, 100%); transform: translate(0, 100%); -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-transition: -webkit-transform .3s; transition: -webkit-transform .3s; transition: transform .3s; transition: transform .3s, -webkit-transform .3s; } .dw-mask-toggle.dw-mask-div{ z-index: 999; opacity: 1; } .dw-mask-toggle .dw-body{ -webkit-transform: translateY(0); transform: translateY(0); } .dw-hd{ width: 100%; min-height: 44px; background: #fff; display: flex; display: -webkit-flex; text-align: center; line-height: 44px; color: #333; font-size: 15px; } .dw-hd .dw-tab-item{ flex: 1; } .dw-hd .dw-basis{ width: 40px; } .dw-hd .dw-span{ display: inline-block; line-height: 44px; padding: 0 10px; cursor: pointer; } .dw-hd .dw-span.dw-active{ position: relative; color: #EF463C; cursor: default; } .dw-hd .dw-span.dw-active:after{ display: block; position: absolute; content: ''; width: 100%; height: 2px; left: 50%; bottom: 0; background: #EF463C; transform: translateX(-50%); -webkit-transform: translateX(-50%); } .dw-ct{ position: relative; width: 100%; min-height: 180px; /*padding: 6px 0;*/ overflow: hidden; } .dw-btn-div{ position: absolute; width: 100%; min-height: 44px; left: 0; bottom: 0; display: flex; display: -webkit-flex; /*border-top: 1px solid #e5e5e5;*/ } .dw-btn-div .dw-btn{ flex: 1; -webkit-flex: 1; text-align: center; line-height: 44px; font-size: 16px; color: #333; cursor: pointer; } .dw-btn-div .dw-btn-cancel{ border-top: 1px solid #e5e5e5; background: #f5f5f5; } .dw-btn-div .dw-btn-sure{ color: #fff; border-top: 1px solid #EF463C; background-color: #EF463C; } .dw-content{ position: relative; width: 100%; min-height: 180px; display: flex; display: -webkit-flex; justify-content: center; -webkit-mask-box-image: linear-gradient(to top, transparent, transparent 5%, white 20%, white 80%, transparent 95%, transparent); } .dw-window{ position: absolute; width: 100%; height: 36px; left: 0; top: 50%; background-color: #fff; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; transform: translateY(-50%); -webkit-transform: translateY(-50%); } .dw-scroll-item{ width: 100px; height: 180px; padding: 0 2px; text-align: center; z-index: 12; overflow: hidden; } .dw-scroll-item .dw-div { padding: 72px 0; overflow: auto; } .dw-scroll-item .dw-p{ min-height: 36px; line-height: 36px; font-size: 14px; color: #999; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; } .dw-scroll-item .dw-p.dw-active{ font-size: 15px; color: #333; } .dw-tab-panel{ position: absolute; top: 0; left: 0; -webkit-transform: translateX(-100%); transform: translateX(-100%); } .dw-tab-panel.dw-tab-panel-active{ position: relative; -webkit-transition: -webkit-transform .3s; transition: -webkit-transform .3s; transition: transform .3s; transition: transform .3s, -webkit-transform .3s; -webkit-transform: translateX(0); transform: translateX(0); } .dw-tab-panel.dw-tab-panel-active ~ .dw-tab-panel{ -webkit-transform: translateX(100%); transform: translateX(100%); }