File tree Expand file tree Collapse file tree 10 files changed +115
-34
lines changed
lib/ex_doc/formatter/html/templates Expand file tree Collapse file tree 10 files changed +115
-34
lines changed Original file line number Diff line number Diff line change 11.autocomplete {
22 display : none;
3- height : 0 ;
4- margin-right : 32px ;
5- overflow : visible;
6- position : relative;
3+ position : absolute;
4+ width : 84% ;
5+ top : 55px ;
76}
87
98.autocomplete .triangle {
3635.autocomplete-results .show {
3736 white-space : normal;
3837 overflow-x : hidden;
39- width : 62 % ;
38+ width : 84 % ;
4039}
4140
4241.autocomplete-results .bold {
135134}
136135
137136@media (max-width : 480px ) {
137+
138+ .autocomplete {
139+ width : 90% ;
140+ }
141+
138142 .autocomplete .triangle {
139143 left : 27% ;
140144 }
141145}
142146
147+ @media (min-width : 481px ) and (max-width : 767px ) {
148+
149+ .autocomplete {
150+ width : 95% ;
151+ }
152+
153+ .autocomplete .triangle {
154+ left : 17% ;
155+ }
156+ }
157+
143158@media (max-width : 767px ) {
159+ .autocomplete {
160+ top : 50px ;
161+ left : 0 ;
162+ right : 0 ;
163+ z-index : 200 ;
164+ }
165+
144166 .autocomplete .triangle {
145167 left : 17% ;
146168 }
147169}
148170
149- @media (max-width : 1024 px ) {
171+ @media (max-width : 1023 px ) {
150172 .autocomplete-results {
151173 gap : 0 ;
152174 }
Original file line number Diff line number Diff line change @@ -35,13 +35,13 @@ body {
3535 position : fixed;
3636 top : 0 ;
3737 left : 0 ;
38- z-index : 4 ;
38+ z-index : 100 ;
3939}
4040
4141.sidebar-button {
4242 --sidebarButtonRightOpen : 4px ;
4343 position : fixed;
44- z-index : 99 ;
44+ z-index : 200 ;
4545 left : 0 ;
4646 transition : all var (--sidebarTransitionDuration ) ease-in-out;
4747 will-change : transform;
5353 left : var (--sidebarWidth );
5454 height : 100% ;
5555 position : absolute;
56- z-index : 3 ;
5756}
5857
5958.content-inner {
@@ -124,19 +123,22 @@ body.sidebar-closed .sidebar-button {
124123}
125124
126125@media screen and (max-width : 768px ) {
127- .content ,
126+ .content ,
128127 body .sidebar-opening .content {
129128 left : 0 ;
130129 width : 100% ;
131130 }
132131
133132 .content-inner {
134- padding-top : 13 px ;
133+ padding-top : 43 px ;
135134 padding-bottom : 26px ;
136135 overflow-x : auto;
136+
137137 }
138138
139139 body .sidebar-closed .sidebar-button {
140- position : absolute;
140+ position : fixed;
141+ left : 0 ;
142+ transition : top 0.9s ;
141143 }
142- }
144+ }
Original file line number Diff line number Diff line change 1+ .background-layer {
2+ display : none;
3+ position : fixed;
4+ top : 0 ;
5+ left : 0 ;
6+ right : 0 ;
7+ height : 70px ;
8+ background-color : var (--background );
9+ }
10+
111.top-search {
212 margin-top : 10px ;
313}
616 display : flex;
717 column-gap : 12px ;
818 align-items : center;
19+ width : 100% ;
920}
1021
1122.search-bar {
1223 border : 1px solid var (--searchBarBorder );
1324 border-radius : 8px ;
1425 height : 48px ;
1526 position : relative;
16- flex-grow : 1 ;
27+ width : 100 % ;
1728}
1829
1930.top-search .search-bar .search-input {
5667 position : absolute;
5768 top : 60% ;
5869 transform : translateY (-60% );
59- z-index : 2 ;
70+ z-index : 99 ;
6071}
6172
6273.top-search .search-bar .selected .search-button ,
8091 transform : scaleY (0 );
8192 top : calc (50% - 11px );
8293 transition : 0.15s transform ease-out;
83- z-index : 2 ;
94+ z-index : 99 ;
8495}
8596
8697.top-search .search-bar .search-close-button : hover {
114125
115126@media (max-width : 480px ) or ((min-width : 481px ) and (max-width : 768px )) {
116127 .search-bar {
117- margin-left : 35 px ;
128+ margin-left : 0 px ;
118129 }
119130}
120131
121132@media (max-width : 768px ) {
133+ .background-layer {
134+ display : block;
135+ z-index : 10 ;
136+ transition : top 0.3s ;
137+ }
138+
122139 .top-search {
123140 margin-top : 0 ;
141+ position : fixed;
142+ top : 13px ;
143+ left : 56px ;
144+ right : 20px ;
145+ transition : top 0.3s ;
146+ z-index : 99 ;
147+ }
148+
149+ .search-settings {
150+ width : 100% ;
151+ box-sizing : border-box;
124152 }
125153}
126154
Original file line number Diff line number Diff line change @@ -141,3 +141,29 @@ function hideAutocomplete () {
141141function isMacOS ( ) {
142142 return / ( M a c | i P h o n e | i P o d | i P a d ) / i. test ( navigator . platform )
143143}
144+
145+ let lastScrollTop = window . scrollY
146+ const topSearch = document . querySelector ( '.top-search' )
147+ const sidebarMenu = document . getElementById ( 'sidebar-menu' )
148+ const backgroundLayer = document . querySelector ( '.background-layer' )
149+
150+ window . addEventListener ( 'scroll' , function ( ) {
151+ const currentScroll = window . scrollY
152+
153+ if ( currentScroll > lastScrollTop ) {
154+ // Scrolling down
155+ topSearch . style . top = '-50px'
156+ backgroundLayer . style . top = '-70px'
157+ // Only hide sidebarMenu if aria-expanded is not true
158+ if ( sidebarMenu . getAttribute ( 'aria-expanded' ) !== 'true' ) {
159+ sidebarMenu . style . display = 'none'
160+ }
161+ } else {
162+ // Scrolling up
163+ topSearch . style . top = '11px'
164+ backgroundLayer . style . top = '0px'
165+ sidebarMenu . style . display = 'block'
166+ }
167+
168+ lastScrollTop = currentScroll <= 0 ? 0 : currentScroll
169+ } , false )
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11<div class="main">
22
3- <button class="sidebar-button sidebar-toggle" aria-label="toggle sidebar" aria-controls="sidebar">
3+ <button id="sidebar-menu" class="sidebar-button sidebar-toggle" aria-label="toggle sidebar" aria-controls="sidebar">
44 <i class="ri-menu-line ri-lg" title="Collapse/expand sidebar"></i>
55</button>
66
7+ <div class="background-layer"></div>
8+
79<nav id="sidebar" class="sidebar">
810 <% url = config.homepage_url || "#{config.main}.html" %>
911 <div class="sidebar-header">
8284 <i class="ri-close-line ri-lg" title="Cancel search"></i>
8385 </button>
8486 </form>
87+ <div class="autocomplete">
88+ </div>
8589 <button class="icon-settings display-settings">
8690 <i class="ri-settings-3-line"></i>
8791 <span class="sr-only">Settings</span>
8892 </button>
8993 </div>
90- </div>
91- <div class="autocomplete">
94+
9295 </div>
You can’t perform that action at this time.
0 commit comments