Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | <template> <li class="dropdown position-static"> <button class="btn btn-sm p-0 shadow-none navbar-link d-flex align-items-start nav-link" id="search-button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="search icon button"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="gray" class="bi bi-search icon" viewBox="0 0 16 16"> <path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/> </svg> </button> <div ref="dropdown-menu" class="dropdown-menu specific-breakpoint mt-0 px-3 px-sm-intermediate px-lg-0 py-4 py-lg-5 border-0" id="search-dropdown" aria-labelledby="search-button" data-bs-popper> <div class="d-flex justify-content-center w-100"> <form class="d-flex"> <input class="form-control mb-0" type="text" placeholder="Cauta produse..." aria-label="Cauta produse"> <input class="submit-button d-flex align-items-center justify-content-center py-0 px-3" type="submit" value="Cauta"> </form> </div> </div> </li> </template> <script> export default { methods: { /** * Sets the scrollbar width css variable * @see changeScrollWidth * @returns void */ changeScrollWidth() { let dropdownMenu = this.$refs["dropdown-menu"]; dropdownMenu.style.setProperty('--scrollWidth', ((window.innerWidth - document.body.clientWidth) / 2) + 'px'); } }, /** * Adds resize event on window to register scrollbar width changes * @see mounted * @returns void */ mounted() { let dropdownMenu = this.$refs["dropdown-menu"]; dropdownMenu.style.setProperty('--scrollWidth', ((window.innerWidth - document.body.clientWidth) / 2) + 'px'); window.addEventListener('resize', this.changeScrollWidth); }, /** * Removes the resize event * @see beforeDestroy * @returns void */ beforeDestroy() { window.removeEventListener('resize', this.changeScrollWidth); } } </script> <style lang="scss" scoped> .btn.btn-sm { font-size: .8rem; text-transform: uppercase; border: none; } .dropdown-menu { width: 100vw; position: absolute; border: none; border-radius: 0 !important; margin-top: -2rem; box-shadow: 0 5px 6px -4px rgb(0 0 0 / 80%); left: auto; } .form-control, .form-control:focus { border: none; outline: none; box-shadow: none; border-bottom: 1px solid rgb(0, 21, 44); background-color: transparent; border-radius: 0; font-size: 1rem; } .submit-button { background-color: transparent; font-family: SoleilBold; color: rgb(0, 21, 44); border-color: rgb(0, 21, 44); font-size: 1rem; } .dropdown>.dropdown-menu { display: inherit; left: auto; top: 100%; transform-origin: center top; transform: scaleY(0); transition: transform .3s ease-out .2s; } .dropdown>.btn.show+.dropdown-menu { transform: scaleY(1); transition: transform .3s ease-out .2s; } @include media-breakpoint-up(lg) { .dropdown-menu { right: -2rem; } .submit-button:hover { color: white; background-color: rgb(0, 21, 44); } form { width: 50%; max-width: 1440px; } } @include media-breakpoint-up(inter) { .dropdown-menu { right: calc(720px - 50vw + calc(var(--scrollWidth))); } } @media screen and #{$ipad-pro-portrait-breakpoint}, screen and #{$ipad-pro-landscape-breakpoint}, screen and #{$ipad-landscape-breakpoint} { .submit-button:hover { color: rgb(0, 21, 44); background-color: transparent; } .dropdown-menu { left: 0; } .dropdown>.dropdown-menu { left: 0; position: fixed !important; top: 10rem; } .submit-button, .form-control { font-size: 1.4rem; } form { width: 75%; } } @include media-breakpoint-down(lg) { .dropdown-menu { left: 0; } .dropdown>.dropdown-menu { position: fixed !important; left: 0; top: 7rem; } .submit-button, .form-control { font-size: 1.2rem; } form { width: 75%; } } @include media-breakpoint-down(sm) { .dropdown>.dropdown-menu{ top: 6rem; } } </style> |