UNPKG

dialogx

Version:

no reliance on third-party apple iphonx like popups

630 lines (576 loc) 13.1 kB
/*! * ===================================================== * Dialogx v3.x.x (害...) * ===================================================== */ *{ box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -m-box-sizing: border-box; -s-box-sizing: border-box; -o-box-sizing: border-box; } li, ol, ul { list-style: none; } .dp-popup-backdrop{ position: fixed; z-index: 10000; top: 0; right: 0; bottom: 0; left: 0; -webkit-transition-duration: 400ms; transition-duration: 400ms; opacity: 0; background: rgba(0, 0, 0, .27); } .dp-popup-backdrop.dp-active{ opacity: 1; } .dp-popup{ position: fixed; z-index: 100001; top: 50%; left: 50%; display: none; overflow: hidden; width: 270px; -webkit-transition-property: -webkit-transform,opacity; transition-property: transform,opacity; -webkit-transform: translateY(-50%) scale(1.185); transform: translateY(-50%) scale(1.185); text-align: center; opacity: 0; color: #000; background: rgba(255, 255, 255, .97); border-radius: 13px; margin-left: -135px; } .dp-popup.dp-popup-in{ display: block; -webkit-transition-duration: 400ms; transition-duration: 400ms; -webkit-transform:translateY(-50%) scale(1); transform:translateY(-50%) scale(1); opacity: 1; } .dp-popup.dp-popup-out{ -webkit-transition-duration: 400ms; transition-duration: 400ms; -webkit-transform: translateY(-50%) scale(1); transform: translateY(-50%) scale(1); opacity: 0; } .dp-popup-inner{ position: relative; padding: 15px; border-radius: 13px 13px 0 0; /*background: rgba(255, 255, 255, .97);*/ } .dp-popup-inner>img{ width: 100%; margin-top: 9px; border-radius: 5px; } .dp-popup-inner.action{ padding: 15px 0 0 0; } .dp-popup-inner.action .dp-popup-title{ margin:0 15px; } .dp-popup-inner:after{ position: absolute; z-index: 15; top: auto; right: auto; bottom: 0; left: 0; display: block; width: 100%; height: 1px; content: ''; -webkit-transform: scaleY(.7); transform: scaleY(.7); -webkit-transform-origin: 50% 100%; transform-origin: 50% 100%; background-color: rgba(0, 0, 0, .2); } .dp-popup-inner.action > .dp-popup-title + .dp-popup-text{ margin: 5px 0 8px 0; } .dp-popup-title{ font-size: 16px; font-weight: bold; text-align: center; position: relative; padding-bottom: 6px; -moz-user-select:none; /*火狐*/ -webkit-user-select:none; /*webkit浏览器*/ -ms-user-select:none; /*IE10*/ -khtml-user-select:none; /*早期浏览器*/ user-select:none; } .dp-popup-close{ position: absolute; right: 0; color: #909399; font-size: 25px; top: -7px; cursor: pointer; } .dp-popup-close:hover{ color: #409eff; } .dp-popup-title + .dp-popup-text{ font-family: inherit; font-size: 14px; } .dp-popup-title + .dp-popup-text > img{ width: 100%; } .dp-popup-buttons{ position: relative; display: -webkit-box; display: -webkit-flex; display: flex; height: 44px; -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center; -moz-user-select:none; /*火狐*/ -webkit-user-select:none; /*webkit浏览器*/ -ms-user-select:none; /*IE10*/ -khtml-user-select:none; /*早期浏览器*/ user-select:none; } .dp-popup-buttons.action{ flex-direction: column; -webkit-flex-direction: column; height: auto; } .dp-popup-buttons.dp-popup-waiting > .dp-popup-button{ color:gray } .dp-popup-buttons.dp-popup-waiting > .dp-popup-button:active{ background: transparent; } .dp-popup-button{ font-size: 17px; line-height: 44px; position: relative; display: block; overflow: hidden; width: 100%; height: 44px; padding: 0 5px; cursor: pointer; text-align: center; white-space: nowrap; text-overflow: ellipsis; color: #007aff; /**background: rgba(255, 255, 255, .95);**/ -webkit-box-flex: 1; } .dp-popup-button.action{ padding: 0; background: transparent; } .dp-popup-button.action:after{ display: none; } .dp-popup-button.action::before{ position: absolute; z-index: 15; left: 0; right: 0; bottom: auto; top: 0; display: block; width: 100%; height: 1px; content: ''; -webkit-transform: scaleY(.7); transform: scaleY(.7); -webkit-transform-origin: 100% 50%; transform-origin: 100% 50%; background-color: rgba(0, 0, 0, .2); } .dp-popup-button:active{ background: #eee; } .dp-popup-button:after{ position: absolute; z-index: 15; top: 0; right: 0; bottom: auto; left: auto; display: block; width: 1px; height: 100%; content: ''; -webkit-transform: scaleX(.7); transform: scaleX(.7); -webkit-transform-origin: 100% 50%; transform-origin: 100% 50%; background-color: rgba(0, 0, 0, .2); } .dp-popup-button:first-child{ border-radius: 0 0 0 13px; } .dp-popup-button:first-child:last-child{ border-radius: 0 0 13px 13px; } .dp-popup-button.action:first-child{ border-radius: 0; } .dp-popup-button.action:first-child:last-child{ border-radius: 0; } .dp-popup-button:last-child{ border-radius: 0 0 13px 0; } .dp-popup-button:last-child:after{ display: none; } .dp-popup-button.dp-popup-button-bold{ font-weight: 600; } .dp-popup-input{ position: relative; } .dp-popup-input input{ font-size: 14px; width: 100%; height: 35px; margin: 15px 0 0; padding: 0 5px; border: 1px solid rgba(0, 0, 0, .3); border-radius: 0; background: #fff; margin-bottom: 15px; outline: none; } .dp-popup-input .hk-input-rule{ position: absolute; text-align: left; bottom: -8px; color: red; font-size: 12px; } .gray{ color: gray; background: rgba(255, 255, 255, .95)!important; } .dp-popup-pins{ width: 100%; height: 55px; display: flex; align-items: center; position: relative; margin: 15px 0 5px 0; } .dp-popup-pin{ height: 100%; width: 25%; padding: 0 6px; } .dp-popup-pin.i4{ width: 25%; padding: 0 6px; } .dp-popup-pin.i5{ width: 20%; padding: 0 6px; } .dp-popup-pin.i6{ width: 16.666666%; padding: 0 4px; } .dp-popup-pin.i8{ width: 12.5%; padding: 0 1px; } .dp-popup-pin .hk-div{ position: relative; height: 48px; z-index: 2; user-select: none; border: 1px solid rgb(190, 191, 191); box-shadow: rgb(240, 240, 240) 0px 0px 0px 1px inset; padding: 3px 3.5px 4px; line-height: 55px; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; font-size: 32px; letter-spacing: 0.4px; width: 100%; border-radius: 4px; text-align: center; color: rgb(70, 70, 70); transition: all 0.22s ease-out 0s; } .hk-bline{ position: absolute; display: block; background-color: #111a34; height: 34px; width: 1.2px; top: 6px; animation: codeboxFlash 1s steps(2) infinite; } .hk-span{ position: absolute; top: 0; height: 48px; line-height: 48px; display: inline-block; width: 100%; left: 0; } @keyframes codeboxFlash{ from{ opacity: 0; } to{ opacity: 1; } } .dp-popup-pin > input:focus{ border-color: rgb(100, 171, 218); box-shadow: rgba(125, 195, 242, 0.9) 0px 0px 0px 1.5px inset; } .dp-keyboard{ position: fixed; bottom: -240px; width: 100%; z-index: 99999; } .dp-keyboard.keyUp{ animation: keyboardUp 0.2s linear forwards; } .dp-keyboard.keyDown{ animation: keyDown .2s linear forwards; } @keyframes keyboardUp{ from {bottom: -240px;} to {bottom: 0;} } @keyframes keyDown{ from {bottom: 0px;} to {bottom: -240px;} } .dp-keyboard-container { -webkit-user-select: none; -webkit-tap-highlight-color: transparent; display: flex; width: 100%; } .dp-keyboard-number { background: #f9fafb; display: flex; flex: 3; } .dp-number-list { float: left; width: 100%; padding: 0; margin: 0; } .dp-number-item { position: relative; float: left; width: 33.3%; height: 60px; text-align: center; line-height: 60px; font-size: 32px; color: #111a34; background: #fff; border-bottom: 1px solid #eee; -moz-user-select:none; /*火狐*/ -webkit-user-select:none; /*webkit浏览器*/ -ms-user-select:none; /*IE10*/ -khtml-user-select:none; /*早期浏览器*/ user-select:none; } .dp-number-item:nth-child(2), .dp-number-item:nth-child(5), .dp-number-item:nth-child(8), .dp-number-item:nth-child(11){ border-right: 1px solid #eee; border-left: 1px solid #eee; } .dp-number-item:hover{ animation: mymove .15s; } .dp-number-item:active{ animation: mymove .15s; } .dp-number-item span{ line-height: 60px; height: 60px; display: inline-block; } @keyframes mymove{ from {background: #fff;} to {background: #eee;} } .dp-tip-box{ position: fixed; width: 100%; height: 100%; top: 0; z-index: 6666; } .svg-tip-box{ position: relative; width: 125px; top: calc(50% - 40px); padding: 15px 10px; margin: auto; /* min-height: 130px; */ border-radius: 5px; z-index: 199999; text-align: center; } .svg-tip-box .svg-tip-bg{ position: absolute; background: #000; opacity: 0.7; width: 100%; height: 100%; top: 0; left: 0; border-radius: 10px; } .svg-tip-mask{ position: absolute; background: #000; width: 100%; height: 100%; opacity: 0.3; z-index: 99999; } .svg-tips{ text-align: center; margin-top: 12px; word-wrap: break-word; line-height: 16px; font-size: 14px; line-height: 20px; position: relative; color: #fff; } .svgDone{ width: 50px; height: 50px; border-radius: 50%; display: block; stroke-width: 2; /* stroke: #fff; */ stroke-miterlimit: 10; margin: auto; position: relative; } .svgSuccess .check { transform-origin: 50% 50%; stroke-dasharray: 48; stroke-dashoffset: 48; animation: stroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards; } .svgSuccess { box-shadow: inset 0px 0px 0px #7ac142; animation: fill-green 0.3s ease-in-out 0.5s forwards, scale 0.3s ease-in-out 0.7s both; } .svgError { box-shadow: inset 0px 0px 0px #e74c3c; animation: fill-red 0.3s ease-in-out 0.5s forwards, scale 0.3s ease-in-out 0.7s both; } .svgWarn { box-shadow: inset 0px 0px 0px #eedf0f; animation: fill-yellow 0.3s ease-in-out 0.5s forwards, scale 0.3s ease-in-out 0.7s both; } .svgSuccess .circle, .svgError .circle, .svgWarn .circle{ stroke-dasharray: 166; stroke-dashoffset: 166; stroke-width: 2; stroke-miterlimit: 10; fill: none; animation: stroke 0.4s cubic-bezier(0.65, 0, 0.45, 1) forwards; } .svgWarn .circles{ stroke-dasharray: 166; stroke-dashoffset: 166; stroke-width: 2; fill: none; animation: stroke 1.4s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards; } .svgWarn .rect{ stroke-dasharray: 166; stroke-dashoffset: 166; stroke-width: 2; fill: none; height:0; animation: heights .4s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards; } .svgSuccess .circle{ stroke: #7ac142; } .svgError .circle { stroke: #e74c3c; } .svgWarn .circle { stroke: #eedf0f; } .svgError .line { transform-origin: 50% 50%; stroke-dasharray: 48; stroke-dashoffset: 48; animation: stroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards; } .svgError .line:nth-child(1) { animation-delay: 0.8s; } .svgError .line:nth-child(2) { animation-delay: 0.5s; } @keyframes stroke { 100% { stroke-dashoffset: 0; } } @keyframes heights { 100% { height: 28px; } } @keyframes scale { 0%, 100% { transform: none; } 50% { transform: scale3d(1.2, 1.2, 1); } 80% { transform: scale3d(0.8, 0.8, 1); } } @keyframes fill-green { 100% { box-shadow: inset 0px 0px 0px 25px #7ac142; } } @keyframes fill-red { 100% { box-shadow: inset 0px 0px 0px 25px #e74c3c; } } @keyframes fill-yellow { 100% { box-shadow: inset 0px 0px 0px 25px #eedf0f; } }