File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 < head >
44 < meta charset ="utf-8 " >
55 < link rel ="icon " href ="%sveltekit.assets%/wan.webp " >
6- < meta name ="viewport " content ="width=device-width " >
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1 " >
77 < link rel ="manifest " href ="/site.webmanifest ">
88 < link rel ="apple-touch-icon " href ="/wan-ios-logo.png ">
99 < meta name ="darkreader-lock ">
Original file line number Diff line number Diff line change 136136 let addSpace = $state (false );
137137 function checkHeight() {
138138 if (! browser || ! mainContainer ) return ;
139- if (mainContainer .scrollHeight > window .innerHeight - 50 ) {
139+ // Use hysteresis to prevent oscillation when window.innerHeight fluctuates
140+ // due to mobile browser chrome showing/hiding. The spacer is outside
141+ // mainContainer so it doesn't affect scrollHeight, but we still need
142+ // different thresholds to avoid toggling on small viewport changes.
143+ const threshold = addSpace ? 100 : 50 ;
144+ if (mainContainer .scrollHeight > window .innerHeight - threshold ) {
140145 outerContainer .classList .remove (" items-center" )
141146 outerContainer .classList .add (" too-short" )
142- addSpace = true // So that there is some space at the bottom when scrolling. for some stupid reason padding doesnt work here
147+ addSpace = true
143148 if (dev ) console .debug (" too short" )
144149 } else {
145150 outerContainer .classList .add (" items-center" )
406411 </Accordion >
407412 </div >
408413 {/if }
409- {#if addSpace }
410- <div class =" h-16" ></div >
411- {/if }
412414 </div >
415+ {#if addSpace }
416+ <div class =" h-16" ></div >
417+ {/if }
413418</div >
414419
415420{#if isFrame }
477482
478483 .container {
479484 padding : 5em 1em 1em ;
480- transition : padding 0.4s ;
481485 }
482486
483487 .lateness-stats {
You can’t perform that action at this time.
0 commit comments