Profile: hide alt text if the image is not loaded
This commit is contained in:
parent
e2a1f38958
commit
4aac0381ae
2 changed files with 21 additions and 13 deletions
|
@ -8,6 +8,21 @@
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.banner {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: calc(-1 * (var(--scaffold-topbar-height) + var(--safe-area-inset-top)));
|
||||||
|
|
||||||
|
>img {
|
||||||
|
object-fit: cover;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.description {
|
.description {
|
||||||
& a {
|
& a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
|
|
@ -336,21 +336,14 @@ const Profile: Component = () => {
|
||||||
</Menu>
|
</Menu>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
width: "100%",
|
|
||||||
height: `${268 * (Math.min(560, windowSize.width) / 560)}px`,
|
height: `${268 * (Math.min(560, windowSize.width) / 560)}px`,
|
||||||
"margin-top":
|
|
||||||
"calc(-1 * (var(--scaffold-topbar-height) + var(--safe-area-inset-top)))",
|
|
||||||
}}
|
}}
|
||||||
|
class="banner"
|
||||||
role="presentation"
|
role="presentation"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
ref={(e) => obx.observe(e)}
|
ref={(e) => obx.observe(e)}
|
||||||
src={bannerImg()}
|
src={bannerImg()}
|
||||||
style={{
|
|
||||||
"object-fit": "cover",
|
|
||||||
width: "100%",
|
|
||||||
height: "100%",
|
|
||||||
}}
|
|
||||||
crossOrigin="anonymous"
|
crossOrigin="anonymous"
|
||||||
alt={`Banner image for ${profile()?.displayName || "the user"}`}
|
alt={`Banner image for ${profile()?.displayName || "the user"}`}
|
||||||
onLoad={(event) => {
|
onLoad={(event) => {
|
||||||
|
|
Loading…
Reference in a new issue