fix banner view
All checks were successful
Android Build / publish (push) Successful in 31s
Linux Build / publish (push) Successful in 1m0s

This commit is contained in:
olcxja 2026-08-17 12:08:38 +02:00
commit a8c0ae8f18
4 changed files with 4 additions and 24 deletions

View file

@ -1891,17 +1891,7 @@ async function openProfile(accountId) {
let bannerUrl = `${url}/user/storage/public/getentry?id=${accountId}&e=larp.profile.banner`;
if (accountId === window.id && window.profileUpdateTimestamp) bannerUrl += `&t=${window.profileUpdateTimestamp}`;
let bannerHtml = `<img src="${bannerUrl}" class="profile-banner">`;
setTimeout(() => {
let bannerImg = document.querySelector("#profile-popup-inner .profile-banner");
if (bannerImg) {
bannerImg.addEventListener("error", function() {
let div = document.createElement("div");
div.className = "profile-banner";
this.parentNode.replaceChild(div, this);
});
}
}, 50);
let bannerHtml = `<img src="${bannerUrl}" class="profile-banner" onerror="this.outerHTML='<div class=\\'profile-banner\\'></div>'">`;
let bio = await fetchAsync(`${url}/user/storage/public/getentry?id=${accountId}&e=larp.profile.bio`);
if (bio.startsWith("error:")) bio = "";

View file

@ -359,7 +359,7 @@ var profileSettings = `
<br>
<div class="input-group" style="display: flex; flex-direction: row; align-items: stretch; justify-content: space-between; border: var(--border-width) solid var(--light-border-color); border-radius: 0.8rem; padding: 1rem; width: 100%; max-width: 30rem;">
<div style="width: 12.4rem; aspect-ratio: 494 / 200; background: var(--main-bg-color); border-radius: 0.4rem; overflow: hidden; display: flex; align-items: center; justify-content: center; border: var(--border-width) solid rgba(255, 255, 255, 0.2);">
<img id="settings-banner-preview" src="" style="width: 100%; height: 100%; object-fit: cover;">
<img id="settings-banner-preview" src="" style="width: 100%; height: 100%; object-fit: cover;" onerror="this.style.display='none'" onload="this.style.display='block'">
</div>
<div style="display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; padding: 0.1rem 0;">
<div style="font-weight: bold;"><blah>title.banner</blah></div>