web: add scrollbar for read progress
This commit is contained in:
@@ -1117,12 +1117,14 @@ fn news_post(post: &ShowThreadQueryThreadOnNewsPost, show_icon_text: bool) -> No
|
||||
C!["body", "news-post", format!("site-{}", post.slug)],
|
||||
raw![&post.body]
|
||||
]
|
||||
] /* TODO(wathiede): plumb in orignal id
|
||||
a![
|
||||
attrs! {At::Href=>api::original(&thread_node.0.as_ref().expect("message missing").id)},
|
||||
"Original"
|
||||
],
|
||||
*/
|
||||
],
|
||||
/* TODO(wathiede): plumb in orignal id
|
||||
a![
|
||||
attrs! {At::Href=>api::original(&thread_node.0.as_ref().expect("message missing").id)},
|
||||
"Original"
|
||||
],
|
||||
*/
|
||||
ev(Ev::Scroll, |e| info!("scroll event {e:?}"))
|
||||
]
|
||||
}
|
||||
fn render_news_post_header(post: &ShowThreadQueryThreadOnNewsPost) -> Node<Msg> {
|
||||
@@ -1181,3 +1183,20 @@ fn render_news_post_header(post: &ShowThreadQueryThreadOnNewsPost) -> Node<Msg>
|
||||
]
|
||||
]
|
||||
}
|
||||
fn reading_progress(ratio: f64) -> Node<Msg> {
|
||||
let percent = ratio * 100.;
|
||||
progress![
|
||||
C![
|
||||
"read-progress",
|
||||
"progress",
|
||||
"is-success",
|
||||
"is-small",
|
||||
IF!(percent<5. => "is-invisible")
|
||||
],
|
||||
attrs! {
|
||||
At::Value=>percent,
|
||||
At::Max=>"100"
|
||||
},
|
||||
format!("{percent}%")
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user