^_^
This commit is contained in:
@@ -8928,6 +8928,13 @@ span.badge.badge-current {
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.avatar-settings-wrapper {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
gap: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.avatar-preview-container {
|
.avatar-preview-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -849,13 +849,28 @@
|
|||||||
if (data.success) {
|
if (data.success) {
|
||||||
showBannerStatus('Banner removed', 'success');
|
showBannerStatus('Banner removed', 'success');
|
||||||
e.target.remove();
|
e.target.remove();
|
||||||
|
const editBtn = document.getElementById('banner-edit-btn');
|
||||||
|
if (editBtn) editBtn.remove();
|
||||||
|
|
||||||
const bannerPreview = document.getElementById('banner-preview');
|
const bannerPreview = document.getElementById('banner-preview');
|
||||||
if (bannerPreview) {
|
if (bannerPreview) {
|
||||||
const ph = document.createElement('div');
|
const ph = document.createElement('div');
|
||||||
ph.id = 'banner-preview'; ph.className = 'banner-preview-img banner-placeholder';
|
ph.id = 'banner-preview'; ph.className = 'banner-preview-img banner-placeholder';
|
||||||
ph.style.cssText = 'width:100%;max-width:360px;height:80px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--nav-border-color);border-radius:4px;color:var(--text-muted);font-size:0.85em;';
|
ph.style.cssText = 'width:100%;aspect-ratio:4/1;display:flex;align-items:center;justify-content:center;border:1px dashed var(--nav-border-color);border-radius:4px;color:var(--text-muted);font-size:0.85em;';
|
||||||
ph.textContent = 'No banner set';
|
ph.textContent = 'No banner set';
|
||||||
bannerPreview.replaceWith(ph);
|
|
||||||
|
// Replace the <a> wrapper if it exists, otherwise just the preview element
|
||||||
|
const parentA = bannerPreview.closest('a');
|
||||||
|
if (parentA && parentA.parentElement.classList.contains('avatar-preview-container')) {
|
||||||
|
parentA.replaceWith(ph);
|
||||||
|
} else {
|
||||||
|
bannerPreview.replaceWith(ph);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const livePreviewBox = document.getElementById('live-profile-preview-box');
|
||||||
|
if (livePreviewBox) {
|
||||||
|
livePreviewBox.style.setProperty('--author-banner', 'none');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
showBannerStatus(data.msg || 'Failed to remove', 'error');
|
showBannerStatus(data.msg || 'Failed to remove', 'error');
|
||||||
|
|||||||
@@ -152,8 +152,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="avatar-upload-section">
|
<div class="avatar-upload-section">
|
||||||
<p class="avatar-hint">Upload a custom banner image for your profile card (max 5 MB — gif, jpg, png, webp). Will be cropped to a landscape ratio.</p>
|
|
||||||
|
|
||||||
<div class="avatar-upload-wrapper">
|
<div class="avatar-upload-wrapper">
|
||||||
<input type="file" id="banner-file-input" accept="image/gif,image/jpeg,image/png,image/webp" hidden>
|
<input type="file" id="banner-file-input" accept="image/gif,image/jpeg,image/png,image/webp" hidden>
|
||||||
<button type="button" id="banner-choose-btn" class="button">Choose File</button>
|
<button type="button" id="banner-choose-btn" class="button">Choose File</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user