style: Update EasySwitchManager UI for improved layout and visual consistency, including adjustments to card dimensions, padding, and font sizes for better user experience.

This commit is contained in:
2025-12-07 04:50:47 +07:00
parent 489bdedfbb
commit ab8b30fbd4
+16 -16
View File
@@ -444,28 +444,28 @@ function EasySwitchManager() {
</div> </div>
{/* Сетка карточек ВСЕх шлюзов сервера */} {/* Сетка карточек ВСЕх шлюзов сервера */}
<div className="row g-2"> <div className="row g-3">
{server.gateways.map((gw, idx) => { {server.gateways.map((gw, idx) => {
const isActive = activeGw === gw.name; const isActive = activeGw === gw.name;
const isFastest = idx === 0; const isFastest = idx === 0;
const ping = 20 + idx * 10 + Math.floor(Math.random() * 15); const ping = 20 + idx * 10 + Math.floor(Math.random() * 15);
return ( return (
<div key={gw.name} className="col-6 col-sm-4 col-md-3 col-lg-2"> <div key={gw.name} className="col-12 col-sm-6 col-md-4">
<div <div
className={`card cursor-pointer h-100 ${isActive ? 'bg-primary text-white' : ''}`} className={`card cursor-pointer h-100 ${isActive ? 'bg-primary text-white' : ''}`}
style={{ style={{
cursor: 'pointer', cursor: 'pointer',
transition: 'all 0.15s ease', transition: 'all 0.15s ease',
border: isActive ? '2px solid var(--tblr-primary)' : '1px solid rgba(0,0,0,0.1)', border: isActive ? '2px solid var(--tblr-primary)' : '1px solid rgba(0,0,0,0.1)',
borderRadius: '6px', borderRadius: '8px',
boxShadow: isActive ? '0 3px 8px rgba(32, 107, 196, 0.3)' : 'none' boxShadow: isActive ? '0 4px 12px rgba(32, 107, 196, 0.3)' : 'none'
}} }}
onClick={() => handleGatewaySelect(server.id, comm.value, gw.name)} onClick={() => handleGatewaySelect(server.id, comm.value, gw.name)}
onMouseEnter={(e) => { onMouseEnter={(e) => {
if (!isActive) { if (!isActive) {
e.currentTarget.style.boxShadow = '0 2px 6px rgba(0,0,0,0.1)'; e.currentTarget.style.boxShadow = '0 2px 8px rgba(0,0,0,0.1)';
e.currentTarget.style.transform = 'translateY(-1px)'; e.currentTarget.style.transform = 'translateY(-2px)';
} }
}} }}
onMouseLeave={(e) => { onMouseLeave={(e) => {
@@ -475,12 +475,12 @@ function EasySwitchManager() {
} }
}} }}
> >
<div className="card-body p-2"> <div className="card-body p-3">
{/* Галочка и метка Fastest */} {/* Галочка и метка Fastest */}
<div className="d-flex align-items-start justify-content-between mb-1"> <div className="d-flex align-items-start justify-content-between mb-2">
{isFastest && !isActive && ( {isFastest && !isActive && (
<span className="badge bg-yellow-lt text-yellow d-inline-flex align-items-center" style={{ fontSize: '0.65rem', padding: '2px 4px' }}> <span className="badge bg-yellow-lt text-yellow d-inline-flex align-items-center" style={{ fontSize: '0.75rem', padding: '4px 8px' }}>
<IconBolt size={10} className="me-1" /> <IconBolt size={14} className="me-1" />
Fast Fast
</span> </span>
)} )}
@@ -488,25 +488,25 @@ function EasySwitchManager() {
{isActive && ( {isActive && (
<div <div
className="bg-white text-primary rounded-circle d-flex align-items-center justify-content-center" className="bg-white text-primary rounded-circle d-flex align-items-center justify-content-center"
style={{ width: '18px', height: '18px' }} style={{ width: '24px', height: '24px' }}
> >
<IconCheck size={12} /> <IconCheck size={16} />
</div> </div>
)} )}
</div> </div>
{/* Название шлюза */} {/* Название шлюза */}
<div className={`fw-bold mb-1 ${isActive ? 'text-white' : ''}`} style={{ fontSize: '0.8rem' }}> <div className={`fw-bold mb-2 ${isActive ? 'text-white' : ''}`} style={{ fontSize: '1rem' }}>
{gw.name} {gw.name}
</div> </div>
{/* Протокол */} {/* Протокол */}
<div className={`small ${isActive ? 'text-white' : 'text-muted'}`} style={{ fontSize: '0.7rem', opacity: isActive ? 0.85 : 1 }}> <div className={`small mb-2 ${isActive ? 'text-white' : 'text-muted'}`} style={{ fontSize: '0.85rem', opacity: isActive ? 0.85 : 1 }}>
{serverMeta?.provider || 'vless'} {serverMeta?.provider || 'vless / xudp'}
</div> </div>
{/* Метрика (пинг) */} {/* Метрика (пинг) */}
<div className={`fw-bold mt-1 ${isActive ? 'text-white' : 'text-success'}`} style={{ fontSize: '1rem' }}> <div className={`fw-bold ${isActive ? 'text-white' : 'text-success'}`} style={{ fontSize: '1.5rem' }}>
{ping} {ping}
</div> </div>
</div> </div>