add match history
This commit is contained in:
@@ -44,5 +44,8 @@ export const api = {
|
||||
|
||||
me: (token) => request('/api/me', { token }),
|
||||
|
||||
getMatches: (token, { start = 0, count = 20 } = {}) =>
|
||||
request(`/api/matches?start=${start}&count=${count}`, { token }),
|
||||
|
||||
logout: (token) => request('/api/logout', { method: 'DELETE', token }),
|
||||
}
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
import { useEffect, useState, useCallback } from 'react'
|
||||
import { api } from '../api'
|
||||
|
||||
const PAGE_SIZE = 10
|
||||
|
||||
function getMatchOutcome(match, userId) {
|
||||
const isPlayer1 = match.player1?.id === userId
|
||||
|
||||
if (match.status === 'ongoing') {
|
||||
return { type: 'ongoing', label: 'Не завершён' }
|
||||
}
|
||||
if (match.status === 'abandoned') {
|
||||
return { type: 'abandoned', label: 'Не завершён' }
|
||||
}
|
||||
if (match.status === 'draw') {
|
||||
return { type: 'draw', label: 'Ничья' }
|
||||
}
|
||||
if (match.status === 'player1_won') {
|
||||
return isPlayer1
|
||||
? { type: 'victory', label: 'Победа' }
|
||||
: { type: 'defeat', label: 'Поражение' }
|
||||
}
|
||||
if (match.status === 'player2_won') {
|
||||
return isPlayer1
|
||||
? { type: 'defeat', label: 'Поражение' }
|
||||
: { type: 'victory', label: 'Победа' }
|
||||
}
|
||||
return { type: 'ongoing', label: 'Не завершён' }
|
||||
}
|
||||
|
||||
function formatDate(dateString) {
|
||||
if (!dateString) return ''
|
||||
try {
|
||||
const date = new Date(dateString)
|
||||
return new Intl.DateTimeFormat('ru-RU', {
|
||||
day: 'numeric',
|
||||
month: 'short',
|
||||
year: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
}).format(date)
|
||||
} catch {
|
||||
return dateString
|
||||
}
|
||||
}
|
||||
|
||||
function formatDuration(seconds) {
|
||||
if (seconds == null) return '—'
|
||||
const total = Math.max(0, Math.floor(seconds))
|
||||
const minutes = Math.floor(total / 60)
|
||||
const remainingSeconds = total % 60
|
||||
if (minutes === 0) return `${remainingSeconds} сек`
|
||||
if (remainingSeconds === 0) return `${minutes} мин`
|
||||
return `${minutes} мин ${remainingSeconds} сек`
|
||||
}
|
||||
|
||||
export default function MatchesModal({ token, user, onClose }) {
|
||||
const [matches, setMatches] = useState([])
|
||||
const [total, setTotal] = useState(null)
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [loadingMore, setLoadingMore] = useState(false)
|
||||
const [error, setError] = useState(null)
|
||||
|
||||
const loadMatches = useCallback(
|
||||
async (offset, append = false) => {
|
||||
if (append) {
|
||||
setLoadingMore(true)
|
||||
} else {
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
}
|
||||
|
||||
try {
|
||||
const data = await api.getMatches(token, { start: offset, count: PAGE_SIZE })
|
||||
setMatches((prev) => (append ? [...prev, ...(data.matches || [])] : data.matches || []))
|
||||
if (typeof data.total === 'number') {
|
||||
setTotal(data.total)
|
||||
}
|
||||
} catch (err) {
|
||||
setError(err.message || 'Не удалось загрузить историю матчей')
|
||||
} finally {
|
||||
setLoading(false)
|
||||
setLoadingMore(false)
|
||||
}
|
||||
},
|
||||
[token]
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
loadMatches(0, false)
|
||||
}, [loadMatches])
|
||||
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (e) => {
|
||||
if (e.key === 'Escape') onClose()
|
||||
}
|
||||
document.addEventListener('keydown', handleKeyDown)
|
||||
return () => document.removeEventListener('keydown', handleKeyDown)
|
||||
}, [onClose])
|
||||
|
||||
const handleLoadMore = () => {
|
||||
if (loadingMore || loading) return
|
||||
loadMatches(matches.length, true)
|
||||
}
|
||||
|
||||
const hasMore = total != null ? matches.length < total : false
|
||||
|
||||
return (
|
||||
<div className="modal-overlay" onClick={onClose}>
|
||||
<div className="modal matches-modal" onClick={(e) => e.stopPropagation()}>
|
||||
<button className="modal-close" onClick={onClose} aria-label="Закрыть">
|
||||
×
|
||||
</button>
|
||||
|
||||
<div className="matches-modal-header">
|
||||
<h2 className="modal-title">Мои матчи</h2>
|
||||
{total != null && (
|
||||
<span className="matches-total-badge">Всего: {total}</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="matches-modal-content">
|
||||
{loading && matches.length === 0 ? (
|
||||
<div className="matches-loading">
|
||||
<div className="bouncing-dots">
|
||||
<span />
|
||||
<span />
|
||||
<span />
|
||||
</div>
|
||||
<span>Загрузка истории матчей…</span>
|
||||
</div>
|
||||
) : error && matches.length === 0 ? (
|
||||
<div className="matches-error-state">
|
||||
<p>{error}</p>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
onClick={() => loadMatches(0, false)}
|
||||
>
|
||||
Повторить
|
||||
</button>
|
||||
</div>
|
||||
) : matches.length === 0 ? (
|
||||
<div className="matches-empty-state">
|
||||
<div className="matches-empty-icon">⚓</div>
|
||||
<div className="matches-empty-title">У вас пока нет сыгранных матчей</div>
|
||||
<div className="matches-empty-desc">
|
||||
Сыграйте случайный бой, чтобы здесь появилась история ваших сражений!
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="matches-list">
|
||||
{matches.map((match) => {
|
||||
const isPlayer1 = match.player1?.id === user?.id
|
||||
const me = isPlayer1 ? match.player1 : match.player2
|
||||
const opponent = isPlayer1 ? match.player2 : match.player1
|
||||
const outcome = getMatchOutcome(match, user?.id)
|
||||
|
||||
return (
|
||||
<div key={match.id} className="match-card">
|
||||
{/* Текущий пользователь всегда слева */}
|
||||
<div className="match-card-side match-side-me">
|
||||
{me?.avatar_url ? (
|
||||
<img
|
||||
src={me.avatar_url}
|
||||
alt={me.nickname}
|
||||
className="match-player-avatar"
|
||||
/>
|
||||
) : (
|
||||
<div className="match-player-avatar match-player-avatar-placeholder">
|
||||
{me?.nickname?.[0]?.toUpperCase()}
|
||||
</div>
|
||||
)}
|
||||
<div className="match-player-info">
|
||||
<span className="match-player-name" title={me?.nickname}>
|
||||
{me?.nickname}
|
||||
</span>
|
||||
<span className="match-player-tag me-tag">Вы</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Центр: исход, дата и длительность */}
|
||||
<div className="match-card-center">
|
||||
<div className={`match-outcome-badge badge-${outcome.type}`}>
|
||||
{outcome.label}
|
||||
</div>
|
||||
<div className="match-meta-row">
|
||||
<span className="match-meta-item match-date">
|
||||
{formatDate(match.started_at)}
|
||||
</span>
|
||||
<span className="match-meta-divider">•</span>
|
||||
<span className="match-meta-item match-duration">
|
||||
{formatDuration(match.duration_seconds)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Соперник справа */}
|
||||
<div className="match-card-side match-side-opponent">
|
||||
<div className="match-player-info opponent-info">
|
||||
<span className="match-player-name" title={opponent?.nickname}>
|
||||
{opponent?.nickname}
|
||||
</span>
|
||||
<span className="match-player-tag opponent-tag">Соперник</span>
|
||||
</div>
|
||||
{opponent?.avatar_url ? (
|
||||
<img
|
||||
src={opponent.avatar_url}
|
||||
alt={opponent.nickname}
|
||||
className="match-player-avatar"
|
||||
/>
|
||||
) : (
|
||||
<div className="match-player-avatar match-player-avatar-placeholder">
|
||||
{opponent?.nickname?.[0]?.toUpperCase()}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
|
||||
{hasMore && (
|
||||
<div className="matches-load-more-wrapper">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary matches-load-more-btn"
|
||||
onClick={handleLoadMore}
|
||||
disabled={loadingMore}
|
||||
>
|
||||
{loadingMore ? 'Загрузка…' : 'Загрузить ещё'}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,8 +1,36 @@
|
||||
import { useState, useRef, useEffect } from 'react'
|
||||
import { useAuth, useAuthModal } from '../auth'
|
||||
import MatchesModal from './MatchesModal'
|
||||
|
||||
export default function ProfileBar() {
|
||||
const { user, loading, logout } = useAuth()
|
||||
const { user, token, loading, logout } = useAuth()
|
||||
const { openAuthModal } = useAuthModal()
|
||||
const [menuOpen, setMenuOpen] = useState(false)
|
||||
const [matchesModalOpen, setMatchesModalOpen] = useState(false)
|
||||
const menuContainerRef = useRef(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (!menuOpen) return
|
||||
|
||||
const handlePointerDown = (e) => {
|
||||
if (menuContainerRef.current && !menuContainerRef.current.contains(e.target)) {
|
||||
setMenuOpen(false)
|
||||
}
|
||||
}
|
||||
|
||||
const handleKeyDown = (e) => {
|
||||
if (e.key === 'Escape') {
|
||||
setMenuOpen(false)
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('pointerdown', handlePointerDown)
|
||||
document.addEventListener('keydown', handleKeyDown)
|
||||
return () => {
|
||||
document.removeEventListener('pointerdown', handlePointerDown)
|
||||
document.removeEventListener('keydown', handleKeyDown)
|
||||
}
|
||||
}, [menuOpen])
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -10,18 +38,58 @@ export default function ProfileBar() {
|
||||
{loading ? (
|
||||
<span className="profile-loading">Загрузка…</span>
|
||||
) : user ? (
|
||||
<div className="profile-user">
|
||||
{user.avatar_url ? (
|
||||
<img src={user.avatar_url} alt={user.nickname} className="profile-avatar" />
|
||||
) : (
|
||||
<div className="profile-avatar profile-avatar-placeholder">
|
||||
{user.nickname[0]?.toUpperCase()}
|
||||
<div className="profile-user-wrapper" ref={menuContainerRef}>
|
||||
{menuOpen && (
|
||||
<div className="profile-dropup-menu" role="menu">
|
||||
<button
|
||||
type="button"
|
||||
className="profile-menu-item"
|
||||
onClick={() => {
|
||||
setMenuOpen(false)
|
||||
setMatchesModalOpen(true)
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
className="profile-menu-icon"
|
||||
viewBox="0 0 24 24"
|
||||
width="18"
|
||||
height="18"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
>
|
||||
<circle cx="12" cy="12" r="10" />
|
||||
<polyline points="12 6 12 12 16 14" />
|
||||
</svg>
|
||||
<span>Мои матчи</span>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
<span className="profile-name">{user.nickname}</span>
|
||||
<button className="link-button" onClick={logout}>
|
||||
Выйти
|
||||
</button>
|
||||
|
||||
<div className="profile-user">
|
||||
<button
|
||||
type="button"
|
||||
className="profile-user-trigger"
|
||||
onClick={() => setMenuOpen((prev) => !prev)}
|
||||
aria-haspopup="menu"
|
||||
aria-expanded={menuOpen}
|
||||
>
|
||||
{user.avatar_url ? (
|
||||
<img src={user.avatar_url} alt={user.nickname} className="profile-avatar" />
|
||||
) : (
|
||||
<div className="profile-avatar profile-avatar-placeholder">
|
||||
{user.nickname[0]?.toUpperCase()}
|
||||
</div>
|
||||
)}
|
||||
<span className="profile-name">{user.nickname}</span>
|
||||
<span className={`profile-dropup-arrow ${menuOpen ? 'open' : ''}`}>▲</span>
|
||||
</button>
|
||||
<button className="link-button" onClick={logout}>
|
||||
Выйти
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<button className="btn btn-primary" onClick={openAuthModal}>
|
||||
@@ -29,6 +97,14 @@ export default function ProfileBar() {
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{matchesModalOpen && (
|
||||
<MatchesModal
|
||||
token={token}
|
||||
user={user}
|
||||
onClose={() => setMatchesModalOpen(false)}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -295,12 +295,112 @@ input:not([type]), input[type="text"] {
|
||||
backdrop-filter: blur(6px);
|
||||
}
|
||||
|
||||
.profile-user-wrapper {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.profile-user {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.profile-user-trigger {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
padding: 6px 10px;
|
||||
border-radius: 12px;
|
||||
font-family: inherit;
|
||||
color: inherit;
|
||||
transition: background-color 0.18s ease, transform 0.1s ease;
|
||||
}
|
||||
|
||||
.profile-user-trigger:hover {
|
||||
background: rgba(47, 128, 237, 0.08);
|
||||
}
|
||||
|
||||
.profile-user-trigger:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.profile-dropup-arrow {
|
||||
font-size: 11px;
|
||||
color: var(--text-soft);
|
||||
margin-left: 2px;
|
||||
transition: transform 0.2s ease, color 0.2s ease;
|
||||
}
|
||||
|
||||
.profile-user-trigger:hover .profile-dropup-arrow {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.profile-dropup-arrow.open {
|
||||
transform: rotate(180deg);
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.profile-dropup-menu {
|
||||
position: absolute;
|
||||
bottom: calc(100% + 12px);
|
||||
left: 0;
|
||||
background: #ffffff;
|
||||
border: 1px solid rgba(30, 58, 95, 0.12);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 12px 32px rgba(30, 58, 95, 0.18);
|
||||
padding: 8px;
|
||||
min-width: 190px;
|
||||
z-index: 50;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
animation: dropup-fade-in 0.15s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
@keyframes dropup-fade-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(8px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.profile-menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
padding: 10px 14px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
border-radius: 10px;
|
||||
color: var(--text);
|
||||
font-family: inherit;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
transition: background-color 0.15s ease, color 0.15s ease;
|
||||
}
|
||||
|
||||
.profile-menu-item:hover {
|
||||
background: var(--primary-soft);
|
||||
color: var(--primary-dark);
|
||||
}
|
||||
|
||||
.profile-menu-icon {
|
||||
flex-shrink: 0;
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.profile-avatar {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
@@ -1127,3 +1227,285 @@ body.is-dragging * {
|
||||
transform: rotate(-90deg) !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Окно истории матчей */
|
||||
.matches-modal {
|
||||
width: min(720px, 96vw);
|
||||
max-height: 85vh;
|
||||
padding: 28px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.matches-modal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.matches-total-badge {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
background: var(--primary-soft);
|
||||
color: var(--primary-dark);
|
||||
padding: 3px 10px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.matches-modal-content {
|
||||
overflow-y: auto;
|
||||
padding-right: 4px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.matches-loading {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 16px;
|
||||
padding: 48px 0;
|
||||
color: var(--text-soft);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.matches-empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 48px 16px;
|
||||
text-align: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.matches-empty-icon {
|
||||
font-size: 48px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.matches-empty-title {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.matches-empty-desc {
|
||||
font-size: 15px;
|
||||
color: var(--text-soft);
|
||||
max-width: 380px;
|
||||
}
|
||||
|
||||
.matches-error-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 36px 16px;
|
||||
gap: 14px;
|
||||
color: var(--danger);
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.matches-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* Карточка матча */
|
||||
.match-card {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto 1fr;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 14px 18px;
|
||||
background: #fbfdff;
|
||||
border: 1.5px solid rgba(30, 58, 95, 0.1);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 2px 8px rgba(30, 58, 95, 0.04);
|
||||
transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
|
||||
}
|
||||
|
||||
.match-card:hover {
|
||||
transform: translateY(-1px);
|
||||
border-color: rgba(47, 128, 237, 0.35);
|
||||
box-shadow: 0 4px 14px rgba(30, 58, 95, 0.08);
|
||||
}
|
||||
|
||||
.match-card-side {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.match-side-me {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.match-side-opponent {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.match-player-avatar {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
flex-shrink: 0;
|
||||
border: 2px solid #fff;
|
||||
box-shadow: 0 2px 6px rgba(30, 58, 95, 0.15);
|
||||
}
|
||||
|
||||
.match-player-avatar-placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: var(--primary);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.match-side-opponent .match-player-avatar-placeholder {
|
||||
background: #8b5cf6;
|
||||
}
|
||||
|
||||
.match-player-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.opponent-info {
|
||||
align-items: flex-end;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.match-player-name {
|
||||
font-weight: 700;
|
||||
font-size: 15px;
|
||||
color: var(--text);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 140px;
|
||||
}
|
||||
|
||||
.match-player-tag {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.me-tag {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.opponent-tag {
|
||||
color: var(--text-soft);
|
||||
}
|
||||
|
||||
/* Центральная колонка карточки матча */
|
||||
.match-card-center {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.match-outcome-badge {
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
padding: 4px 12px;
|
||||
border-radius: 20px;
|
||||
letter-spacing: 0.3px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.badge-victory {
|
||||
background: #dcfce7;
|
||||
color: #15803d;
|
||||
box-shadow: 0 1px 4px rgba(21, 128, 61, 0.15);
|
||||
}
|
||||
|
||||
.badge-defeat {
|
||||
background: #fee2e2;
|
||||
color: #b91c1c;
|
||||
box-shadow: 0 1px 4px rgba(185, 28, 28, 0.15);
|
||||
}
|
||||
|
||||
.badge-draw {
|
||||
background: #e0f2fe;
|
||||
color: #0369a1;
|
||||
box-shadow: 0 1px 4px rgba(3, 105, 161, 0.15);
|
||||
}
|
||||
|
||||
.badge-ongoing,
|
||||
.badge-abandoned {
|
||||
background: #fef3c7;
|
||||
color: #b45309;
|
||||
box-shadow: 0 1px 4px rgba(180, 83, 9, 0.15);
|
||||
}
|
||||
|
||||
.match-meta-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--text-soft);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.match-meta-divider {
|
||||
font-size: 10px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.matches-load-more-wrapper {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 12px 0 4px;
|
||||
}
|
||||
|
||||
.matches-load-more-btn {
|
||||
font-size: 14px;
|
||||
padding: 8px 24px;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.matches-modal {
|
||||
padding: 20px 16px;
|
||||
}
|
||||
|
||||
.match-card {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 12px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.match-card-side {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.match-side-opponent {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
.opponent-info {
|
||||
align-items: flex-start;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user