Scale images and videos to fit screen
This commit is contained in:
parent
782ac4e86c
commit
e2d6aae494
|
@ -69,7 +69,7 @@ pub fn generate_html(album: Result<Album, Error>) -> (u16, Vec<u8>) {
|
||||||
let elem = BytesStart::owned(b"style".to_vec(), 5);
|
let elem = BytesStart::owned(b"style".to_vec(), 5);
|
||||||
writer.write_event(Event::Start(elem)).unwrap();
|
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();
|
writer.write_event(Event::Text(elem)).unwrap();
|
||||||
|
|
||||||
let elem = BytesEnd::owned(b"style".to_vec());
|
let elem = BytesEnd::owned(b"style".to_vec());
|
||||||
|
|
Loading…
Reference in New Issue