UNPKG

unibox

Version:

A powerful search suggestion input box.

238 lines (226 loc) 7.2 kB
.unibox-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } /**** Suggest box styles ****/ #unibox-suggest-box, #unibox-suggest-box-special { /*** Base styles ***/ position: absolute; display: none; border: 1px solid #e5e5e5; background-color: #fff; color: #333; overflow: hidden; z-index: 1500; } #unibox-suggest-box a, #unibox-suggest-box-special a { text-decoration: none; color: #1C5D7D; } #unibox-suggest-box .unibox-suggest-heading, #unibox-suggest-box-special .unibox-suggest-heading { margin-left: 8px; margin-top: 6px; margin-bottom: 6px; font-size: 18px; text-align: left; color: #000; } #unibox-suggest-box > * > div, #unibox-suggest-box-special > * > div { padding: 6px 8px; } #unibox-suggest-box .unibox-selectable:hover a, #unibox-suggest-box .unibox-selectable.active a, #unibox-suggest-box-special .unibox-selectable:hover a, #unibox-suggest-box-special .unibox-selectable.active a { color: #fff; } /**** Mobile Unibox Layer ****/ .unibox-stretch { height: 100% !important; } #unibox-special section, section#unibox-special { margin: 0; padding: 0; } #unibox-special { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000000; overflow: hidden; /* Input wrapper */ /* Search box */ /* Icons */ /* Suggestion box */ } #unibox-special .input-container { width: calc(100% - 2px); border: 1px solid #bbb; background: #fff; } #unibox-special .unibox-special-searchbox { width: calc(100% - 2 * 63px); height: 48px; font-size: 19px; margin: 16px 63px; border: 1px solid #bbb; border-radius: 0; -webkit-appearance: none; appearance: none; padding: 0 0.5rem; } #unibox-special .unibox-special-icon { position: absolute; top: 16px; height: 50px; width: 50px; padding: 0; background: transparent; border: none; cursor: pointer; } #unibox-special .unibox-special-close { left: 0; border-right: 1px solid #bbb; background: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTE5IDYuNDFMMTcuNTkgNSAxMiAxMC41OSA2LjQxIDUgNSA2LjQxIDEwLjU5IDEyIDUgMTcuNTkgNi40MSAxOSAxMiAxMy40MSAxNy41OSAxOSAxOSAxNy41OSAxMy40MSAxMnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==") no-repeat center; background-size: 24px; } #unibox-special .unibox-special-searchbutton { right: 0; border-left: 1px solid #bbb; background: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMDAwMDAwIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTE1LjUgMTRoLS43OWwtLjI4LS4yN0MxNS40MSAxMi41OSAxNiAxMS4xMSAxNiA5LjUgMTYgNS45MSAxMy4wOSAzIDkuNSAzUzMgNS45MSAzIDkuNSA1LjkxIDE2IDkuNSAxNmMxLjYxIDAgMy4wOS0uNTkgNC4yMy0xLjU3bC4yNy4yOHYuNzlsNSA0Ljk5TDIwLjQ5IDE5bC00Ljk5LTV6bS02IDBDNy4wMSAxNCA1IDExLjk5IDUgOS41UzcuMDEgNSA5LjUgNSAxNCA3LjAxIDE0IDkuNSAxMS45OSAxNCA5LjUgMTR6Ii8+ICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48L3N2Zz4=") no-repeat center; background-size: 24px; } #unibox-special #unibox-suggest-box-special { overflow-y: scroll; -webkit-overflow-scrolling: touch; position: absolute; overflow-x: hidden; display: block; width: 100%; height: 100%; margin-top: 2px; } #unibox-special #unibox-suggest-box-special .unibox-selectable { min-height: 50px; } .move--left { transition-timing-function: ease-out; -ms-transform: translate3d(-100%, 0, 0); -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); pointer-events: none; transition-delay: 0s; } .move--right { transition-timing-function: ease-out; -ms-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); pointer-events: none; transition-delay: 0s; } /**** Single selectable style ****/ .unibox-selectable { /*** Base styles ***/ clear: both; position: relative; font-family: sans-serif; font-size: 14px; text-align: left; display: flex; /* Images */ /* Links, texts */ /* Other */ /*** Modifiers ***/ } .unibox-selectable .unibox-selectable-img-container { width: 60px; float: left; margin-right: 6px; } .unibox-selectable img { max-width: 60px; max-height: 60px; } .unibox-selectable img.unibox-vis { width: 70px; } .unibox-selectable a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .unibox-selectable span span, .unibox-selectable .unibox-highlight { font-weight: bold; } .unibox-selectable p.unibox-result-content { margin-top: 5px; margin-bottom: 15px; } .unibox-selectable .unibox-extra { cursor: default; } .unibox-selectable .unibox-ca { clear: both; } .unibox-selectable.active, .unibox-selectable:hover { background-color: #1C5D7D; color: #fff; cursor: pointer; } .unibox-selectable.active a, .unibox-selectable.active span, .unibox-selectable.active .unibox-extra, .unibox-selectable:hover a, .unibox-selectable:hover span, .unibox-selectable:hover .unibox-extra { color: #fff; } /**** Invisible ****/ #unibox-invisible { visibility: hidden; position: relative; text-align: left; height: 0; display: none; } /**** Instant visual feedback ****/ .unibox-ivf { position: absolute; width: 76px; height: 76px; position: absolute; top: -89px; left: -15px; /* Images */ } .unibox-ivf img { max-width: 76px; position: absolute; top: 0; bottom: 0; margin: auto; transition: .3s ease-out; -webkit-transition: .3s ease-out; -ms-transform: rotateX(-90deg) translateY(100%); -webkit-transform: rotateX(-90deg) translateY(100%); transform: rotateX(-90deg) translateY(100%); } .unibox-ivf img.l { -ms-transform: rotateX(0) translateY(0); -webkit-transform: rotateX(0) translateY(0); transform: rotateX(0) translateY(0); } /**** Show All Results Button ****/ .unibox-selectable.unibox-show-all { width: 100%; background: none; border: none; color: #1C5D7D; display: -ms-flexbox; display: -webkit-flex; display: flex; -webkit-flex-direction: row; -ms-flex-direction: row; flex-direction: row; -webkit-justify-content: center; -ms-flex-pack: center; justify-content: center; -webkit-align-items: center; -ms-flex-align: center; align-items: center; } .unibox-selectable.unibox-show-all:hover, .unibox-selectable.unibox-show-all.active { text-decoration: underline; } .unibox-selectable.unibox-show-all i { margin-left: 9px; margin-top: 2px; } .unibox-selectable.unibox-show-all span { color: #1C5D7D; }