Compare commits

...

2 commits

Author SHA1 Message Date
2f06b0443a
fix(web): expanded images go to almost full screen
they were too little every time anyway, aaaaaaaaaaaaa
2024-08-12 01:39:02 +02:00
b44f1000e1
fix(web): sensitive cover also for obj images 2024-08-12 01:38:43 +02:00
2 changed files with 13 additions and 4 deletions

View file

@ -230,7 +230,7 @@
width: unset; width: unset;
height: unset; height: unset;
max-width: calc(100% - 1.5em); max-width: calc(100% - 1.5em);
max-height: 55vh; max-height: 90vh;
} }
.box { .box {
border: 3px solid var(--accent); border: 3px solid var(--accent);
@ -253,7 +253,7 @@
img.expand, img.expand,
video.expand { video.expand {
height: unset; height: unset;
max-height: 55vh; max-height: 90vh;
max-width: 100%; max-width: 100%;
object-fit: contain; object-fit: contain;
} }

View file

@ -1,7 +1,7 @@
use std::sync::Arc; use std::sync::Arc;
use leptos::*; use leptos::*;
use crate::prelude::*; use crate::{prelude::*, URL_SENSITIVE};
use apb::{field::OptionalString, target::Addressed, ActivityMut, Base, Collection, CollectionMut, Object, ObjectMut}; use apb::{field::OptionalString, target::Addressed, ActivityMut, Base, Collection, CollectionMut, Object, ObjectMut};
@ -119,7 +119,16 @@ pub fn Object(object: crate::Object) -> impl IntoView {
let post_image = object.image().get().and_then(|x| x.url().id().str()).map(|x| { let post_image = object.image().get().and_then(|x| x.url().id().str()).map(|x| {
let (expand, set_expand) = create_signal(false); let (expand, set_expand) = create_signal(false);
view! { view! {
<img src={x} class="flex-pic box cursor" class:flex-pic-expand=expand on:click=move|_| set_expand.set(!expand.get()) /> <img
class="flex-pic box cursor"
class:flex-pic-expand=expand
src={move || if sensitive && !expand.get() {
URL_SENSITIVE.to_string()
} else {
x.clone()
}}
on:click=move|_| set_expand.set(!expand.get())
/>
} }
}); });