From e2d6aae4949209f858437aab12a846605c1820aa Mon Sep 17 00:00:00 2001 From: blank X Date: Mon, 3 May 2021 15:53:40 +0700 Subject: [PATCH] Scale images and videos to fit screen --- src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.rs b/src/utils.rs index b938ebf..2abc4e1 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -69,7 +69,7 @@ pub fn generate_html(album: Result) -> (u16, Vec) { let elem = BytesStart::owned(b"style".to_vec(), 5); writer.write_event(Event::Start(elem)).unwrap(); - let elem = BytesText::from_plain_str("body { background-color: black; color: white; text-align: center; }\ndiv { border: 1px solid #fcc; background: #fee; padding: 0.5em 1em 0.5em 1em; color: black; }"); + let elem = BytesText::from_plain_str("body { background-color: black; color: white; text-align: center; }\ndiv { border: 1px solid #fcc; background: #fee; padding: 0.5em 1em 0.5em 1em; color: black; }\nimg, video { max-width: 100%; height: auto; object-fit: contain; }"); writer.write_event(Event::Text(elem)).unwrap(); let elem = BytesEnd::owned(b"style".to_vec());