Scale images and videos to fit screen

This commit is contained in:
blank X 2021-05-03 15:53:40 +07:00
parent 782ac4e86c
commit e2d6aae494
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ pub fn generate_html(album: Result<Album, Error>) -> (u16, Vec<u8>) {
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());