SHA256
Профиль: «Официальный» и «Сияющий» снова по бокам аватара
- Слева «Официальный», справа «Сияющий»: числа «подтвердили» и «подтвердил(а)» открывают списки. - У активного статуса числа его цветом; на своём профиле обе стороны видны всегда, пустая – бледнее. - Значки под именем и нижний раздел «Сияние» убраны – они повторяли эти числа.
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
client.version=1.19.31
|
client.version=1.19.32
|
||||||
server.version=1.15.0
|
server.version=1.15.0
|
||||||
|
|||||||
+1
-1
@@ -39,7 +39,7 @@
|
|||||||
}());
|
}());
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
window.__SHINE_BUILD_HASH__ = '20261013170000';
|
window.__SHINE_BUILD_HASH__ = '20261015230000';
|
||||||
window.__SHINE_CLIENT_VERSION__ = '1.2.10';
|
window.__SHINE_CLIENT_VERSION__ = '1.2.10';
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -13,35 +13,23 @@ export function escapeProfileHtml(text) {
|
|||||||
|
|
||||||
const esc = escapeProfileHtml;
|
const esc = escapeProfileHtml;
|
||||||
|
|
||||||
// Раздел статуса («Сияние», «Официальный»): кто подтвердил этот аккаунт и кого подтвердил он сам.
|
// Карточка статуса у аватара: кто подтвердил этот аккаунт и кого подтвердил он сам.
|
||||||
function statusSectionHtml({ kind, title, received, given, receivedLabel, givenLabel }) {
|
function statusSideHtml({ kind, title, active, received, given, verb }) {
|
||||||
const receivedCount = Number(received || 0);
|
|
||||||
const givenCount = Number(given || 0);
|
|
||||||
const isOfficial = kind === 'primary';
|
const isOfficial = kind === 'primary';
|
||||||
|
const receivedKind = isOfficial ? 'primary_received' : 'shine_received';
|
||||||
|
const givenKind = isOfficial ? 'primary_given' : 'shine_given';
|
||||||
return `
|
return `
|
||||||
<section class="pf-status-section pf-status-section--${esc(kind)}" aria-label="${esc(title)}">
|
<section class="pf-sc pf-sc--${esc(kind)}${active ? ' is-active' : ' is-empty'}" aria-label="${esc(title)}">
|
||||||
<h3 class="nav-list__title">${esc(title)}</h3>
|
<div class="pf-sc__title">${esc(title)}</div>
|
||||||
<div class="nav-list">
|
<button type="button" class="pf-sc__row" data-profile-list="${receivedKind}" aria-label="${esc(title)}: подтвердили ${Number(received || 0)}">
|
||||||
<button type="button" class="nav-row" data-profile-list="${isOfficial ? 'primary_received' : 'shine_received'}">
|
<strong>${Number(received || 0)}</strong><span>подтвердили</span>
|
||||||
<span class="nav-row__label">${esc(receivedLabel)}</span>
|
</button>
|
||||||
<span class="nav-row__hint">${esc(peopleCount(receivedCount))}</span>
|
<button type="button" class="pf-sc__row" data-profile-list="${givenKind}" aria-label="${esc(title)}: ${esc(verb)} ${Number(given || 0)}">
|
||||||
</button>
|
<strong>${Number(given || 0)}</strong><span>${esc(verb)}</span>
|
||||||
<button type="button" class="nav-row" data-profile-list="${isOfficial ? 'primary_given' : 'shine_given'}">
|
</button>
|
||||||
<span class="nav-row__label">${esc(givenLabel)}</span>
|
|
||||||
<span class="nav-row__hint">${esc(peopleCount(givenCount))}</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</section>`;
|
</section>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function peopleCount(count) {
|
|
||||||
if (!count) return 'Пока никого';
|
|
||||||
const mod10 = count % 10;
|
|
||||||
const mod100 = count % 100;
|
|
||||||
const word = mod10 === 1 && mod100 !== 11 ? 'человек' : (mod10 >= 2 && mod10 <= 4 && (mod100 < 12 || mod100 > 14)) ? 'человека' : 'человек';
|
|
||||||
return `${count} ${word}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function statHtml({ kind, label, valueHtml, ariaLabel }) {
|
function statHtml({ kind, label, valueHtml, ariaLabel }) {
|
||||||
return `
|
return `
|
||||||
<button type="button" class="pf-stat" data-profile-list="${esc(kind)}" aria-label="${esc(ariaLabel)}">
|
<button type="button" class="pf-stat" data-profile-list="${esc(kind)}" aria-label="${esc(ariaLabel)}">
|
||||||
@@ -103,39 +91,26 @@ export function profileCardHtml({ card, login = '', tilesHtml = '', tilesWrapCla
|
|||||||
const shineGiven = Number(stats.shineGivenCount || 0);
|
const shineGiven = Number(stats.shineGivenCount || 0);
|
||||||
const primaryReceived = Number(stats.primaryReceivedCount || 0);
|
const primaryReceived = Number(stats.primaryReceivedCount || 0);
|
||||||
const primaryGiven = Number(stats.primaryGivenCount || 0);
|
const primaryGiven = Number(stats.primaryGivenCount || 0);
|
||||||
// Раздел виден у сияющих и у всех, кого уже подтверждали или кто подтверждал сам.
|
// Статусы по бокам аватара: слева «Официальный», справа «Сияние». На своём профиле – всегда
|
||||||
const shineSection = (shining || shineReceived || shineGiven)
|
// (пустая сторона бледнее), на чужом – если статус есть или уже есть подтверждения.
|
||||||
? statusSectionHtml({
|
const verb = card?.gender === 'female' ? 'подтвердила' : card?.gender === 'male' ? 'подтвердил' : 'подтвердил(а)';
|
||||||
kind: 'shine',
|
const officialSide = (isSelf || official || primaryReceived || primaryGiven)
|
||||||
title: 'Сияние',
|
? statusSideHtml({ kind: 'primary', title: 'Официальный', active: official, received: primaryReceived, given: primaryGiven, verb })
|
||||||
received: shineReceived,
|
|
||||||
given: shineGiven,
|
|
||||||
receivedLabel: 'Подтвердили, что сияющий',
|
|
||||||
givenLabel: 'Подтвердил сияющими',
|
|
||||||
})
|
|
||||||
: '';
|
: '';
|
||||||
const officialSection = (official || primaryReceived || primaryGiven)
|
const shineSide = (isSelf || shining || shineReceived || shineGiven)
|
||||||
? statusSectionHtml({
|
? statusSideHtml({ kind: 'shine', title: 'Сияющий', active: shining, received: shineReceived, given: shineGiven, verb })
|
||||||
kind: 'primary',
|
|
||||||
title: 'Официальный аккаунт',
|
|
||||||
received: primaryReceived,
|
|
||||||
given: primaryGiven,
|
|
||||||
receivedLabel: 'Подтвердили, что официальный',
|
|
||||||
givenLabel: 'Подтвердил официальными',
|
|
||||||
})
|
|
||||||
: '';
|
: '';
|
||||||
const badges = [
|
|
||||||
shining ? '<span class="pf-badge pf-badge--shine">Сияющий</span>' : '',
|
|
||||||
official ? '<span class="pf-badge pf-badge--official">Официальный</span>' : '',
|
|
||||||
].join('');
|
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<div class="pf-hero" aria-label="Профиль ${esc(cardLogin)}">
|
<div class="pf-hero" aria-label="Профиль ${esc(cardLogin)}">
|
||||||
<div class="pf-avatar user-profile-avatar-slot${shining ? ' is-shining' : ''}"></div>
|
<div class="pf-identity">
|
||||||
|
<div class="pf-side pf-side--left">${officialSide}</div>
|
||||||
|
<div class="pf-avatar user-profile-avatar-slot${shining ? ' is-shining' : ''}"></div>
|
||||||
|
<div class="pf-side pf-side--right">${shineSide}</div>
|
||||||
|
</div>
|
||||||
<h2 class="pf-name">${esc(displayName)}</h2>
|
<h2 class="pf-name">${esc(displayName)}</h2>
|
||||||
<div class="pf-login">@${esc(cardLogin)}</div>
|
<div class="pf-login">@${esc(cardLogin)}</div>
|
||||||
${city ? `<div class="pf-city">${iconHtml('place')}<span>${esc(city)}</span></div>` : ''}
|
${city ? `<div class="pf-city">${iconHtml('place')}<span>${esc(city)}</span></div>` : ''}
|
||||||
${badges ? `<div class="pf-badges">${badges}</div>` : ''}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pf-stats">
|
<div class="pf-stats">
|
||||||
@@ -150,8 +125,6 @@ export function profileCardHtml({ card, login = '', tilesHtml = '', tilesWrapCla
|
|||||||
<div class="pf-tiles user-profile-actions">${tilesHtml}</div>
|
<div class="pf-tiles user-profile-actions">${tilesHtml}</div>
|
||||||
</div>` : ''}
|
</div>` : ''}
|
||||||
|
|
||||||
${shineSection}
|
|
||||||
${officialSection}
|
|
||||||
${listHtml}`;
|
${listHtml}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,17 +33,36 @@
|
|||||||
}
|
}
|
||||||
@media (prefers-reduced-motion: reduce) { .user-profile-screen .pf-avatar.is-shining::before { animation: none; } }
|
@media (prefers-reduced-motion: reduce) { .user-profile-screen .pf-avatar.is-shining::before { animation: none; } }
|
||||||
|
|
||||||
.user-profile-screen .pf-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-1); margin-top: var(--space-1); }
|
/* Статусы по бокам аватара: слева «Официальный», справа «Сияющий» (profile-card.js → statusSideHtml). */
|
||||||
.user-profile-screen .pf-badge {
|
.user-profile-screen .pf-identity {
|
||||||
padding: 3px 10px;
|
--pf-shine: var(--warning);
|
||||||
border-radius: 999px;
|
--pf-official: var(--info);
|
||||||
font-size: var(--text-xs);
|
width: min(100%, 440px);
|
||||||
line-height: var(--leading-xs);
|
display: grid;
|
||||||
font-weight: var(--weight-bold);
|
grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr);
|
||||||
|
align-items: center;
|
||||||
|
gap: var(--space-3);
|
||||||
|
}
|
||||||
|
.user-profile-screen .pf-side { min-width: 0; display: grid; align-items: center; }
|
||||||
|
.user-profile-screen .pf-side--left { justify-items: end; }
|
||||||
|
.user-profile-screen .pf-side--right { justify-items: start; }
|
||||||
|
.user-profile-screen .pf-sc { --pf-c: var(--pf-shine); width: min(100%, 116px); display: grid; gap: var(--space-1); min-width: 0; }
|
||||||
|
.user-profile-screen .pf-sc--primary { --pf-c: var(--pf-official); }
|
||||||
|
.user-profile-screen .pf-sc__title { text-align: center; color: var(--pf-c); font-size: var(--text-xs); line-height: 1.2; font-weight: var(--weight-bold); }
|
||||||
|
.user-profile-screen .pf-sc__row { min-width: 0; display: grid; justify-items: center; gap: 1px; padding: 4px 2px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-primary); font: inherit; cursor: pointer; }
|
||||||
|
.user-profile-screen .pf-sc__row strong { font-size: var(--text-xl); line-height: 1.1; font-weight: var(--weight-bold); }
|
||||||
|
.user-profile-screen .pf-sc__row span { color: var(--text-secondary); font-size: 11px; line-height: 1.15; }
|
||||||
|
.user-profile-screen .pf-sc__row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
|
||||||
|
.user-profile-screen .pf-sc.is-active .pf-sc__row strong { color: var(--pf-c); }
|
||||||
|
.user-profile-screen .pf-sc.is-empty { opacity: 0.75; }
|
||||||
|
.user-profile-screen .pf-sc.is-empty .pf-sc__title { color: var(--text-secondary); }
|
||||||
|
@media (hover: hover) { .user-profile-screen .pf-sc__row:hover { background: var(--surface-selected); } }
|
||||||
|
.user-profile-screen .pf-sc__row:active { background: var(--surface-selected); }
|
||||||
|
|
||||||
|
@media (max-width: 360px) {
|
||||||
|
.user-profile-screen .pf-identity { grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr); gap: var(--space-2); }
|
||||||
|
.user-profile-screen .pf-sc__row span { font-size: 10px; }
|
||||||
}
|
}
|
||||||
.user-profile-screen .pf-badge--shine { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
|
|
||||||
.user-profile-screen .pf-badge--official { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
|
|
||||||
.user-profile-screen .pf-status-section .nav-list__title { margin-top: 0; }
|
|
||||||
|
|
||||||
.user-profile-screen .pf-name { margin: var(--space-2) 0 0; color: var(--text-primary); font-size: var(--text-xl); line-height: var(--leading-xl); font-weight: var(--weight-bold); overflow-wrap: anywhere; }
|
.user-profile-screen .pf-name { margin: var(--space-2) 0 0; color: var(--text-primary); font-size: var(--text-xl); line-height: var(--leading-xl); font-weight: var(--weight-bold); overflow-wrap: anywhere; }
|
||||||
.user-profile-screen .pf-login { color: var(--text-secondary); font-size: var(--text-sm); line-height: var(--leading-sm); }
|
.user-profile-screen .pf-login { color: var(--text-secondary); font-size: var(--text-sm); line-height: var(--leading-sm); }
|
||||||
|
|||||||
Reference in New Issue
Block a user