web: don't show progress bar until 400px have scrolled

This commit is contained in:
Bill Thiede 2024-09-01 15:48:11 -07:00
parent 3efe90ca21
commit b1e761b26f

View File

@ -62,6 +62,8 @@ fn compute_scroll_ratio() -> Msg {
// the tags at the end on mobile/tablet).
let body = document().body().expect("body");
let sh = body.scroll_height() as f64;
// HACK: don't report percent until a fixed amount of scrolling has happened
let sh = if sh < 400. { 0. } else { sh };
let window = window();
let ih = window
.inner_height()