пенис пенис елда

This commit is contained in:
root
2026-07-05 17:40:52 +00:00
parent f23a79d618
commit 6638ab99f3
12 changed files with 2732 additions and 123 deletions
+220
View File
@@ -166,6 +166,7 @@
border-radius: 10px;
overflow: hidden;
transition: all 0.25s ease;
cursor: pointer;
}
.inventory-skin-card:hover {
@@ -443,6 +444,128 @@
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
}
/* ─── Карточка предмета (попап) ──────────────────────────────────── */
.ic-overlay {
position: fixed; inset: 0;
background: rgba(0,0,0,0.8);
backdrop-filter: blur(6px);
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
}
.ic-modal {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 14px;
max-width: 900px;
width: 100%;
max-height: 85vh;
overflow-y: auto;
position: relative;
padding: 1.5rem;
box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.ic-close {
position: absolute;
top: 12px; right: 16px;
font-size: 1.4rem;
cursor: pointer;
color: var(--text-secondary);
z-index: 10;
width: 32px; height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: all 0.2s;
}
.ic-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ic-layout {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
}
.ic-left {
display: flex;
align-items: center;
justify-content: center;
background: var(--bg-dark);
border-radius: 10px;
min-height: 300px;
padding: 1rem;
}
.ic-image {
max-width: 100%;
max-height: 350px;
object-fit: contain;
border-radius: 6px;
}
.ic-right {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.ic-name {
font-family: 'Russo One', sans-serif;
font-size: 1.3rem;
font-weight: 700;
margin-bottom: 0.5rem;
line-height: 1.3;
}
.ic-detail {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.3rem 0;
border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ic-label { font-size: 0.82rem; color: var(--text-secondary); }
.ic-value { font-size: 0.9rem; font-weight: 500; }
.ic-collection-title {
font-family: 'Russo One', sans-serif;
font-size: 0.9rem;
margin-top: 0.75rem;
padding-top: 0.75rem;
border-top: 1px solid var(--border-color);
color: var(--text-color);
}
.ic-collection-list {
max-height: 200px;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 0.25rem;
margin-top: 0.4rem;
}
.ic-collection-item {
font-size: 0.8rem;
padding: 0.2rem 0.4rem;
border-radius: 4px;
transition: background 0.2s;
}
.ic-collection-item:hover { background: rgba(255,255,255,0.03); }
.ic-coll-rarity { font-weight: 600; }
.ic-sell-btn {
margin-top: 0.75rem;
width: 100%;
padding: 0.6rem;
border: none;
border-radius: 8px;
background: var(--primary-color);
color: white;
font-weight: 600;
font-size: 0.9rem;
cursor: pointer;
transition: filter 0.2s;
}
.ic-sell-btn:hover { filter: brightness(1.1); }
@media (max-width: 700px) {
.ic-layout { grid-template-columns: 1fr; }
.ic-left { min-height: 200px; }
}
</style>
</head>
<body>
@@ -965,7 +1088,104 @@
const btn = document.getElementById('soundToggle');
if (btn) btn.textContent = localStorage.getItem('sound_enabled') !== 'false' ? '🔊' : '🔇';
});
// ─── Карточка предмета (попап) ─────────────────────────────────────
document.addEventListener('DOMContentLoaded', function() {
const grid = document.getElementById('inventoryGrid');
if (!grid) return;
grid.addEventListener('click', function(e) {
const card = e.target.closest('.inventory-skin-card');
if (!card) return;
if (e.target.closest('.item-select-checkbox, .btn-sell-single')) return;
const invId = card.dataset.inventoryId;
if (!invId) return;
openItemCard(invId);
});
});
async function openItemCard(invId) {
const modal = document.getElementById('itemCardModal');
const overlay = document.getElementById('itemCardOverlay');
overlay.style.display = 'flex';
modal.innerHTML = '<div style="padding:2rem;text-align:center;color:var(--text-secondary)">Загрузка...</div>';
try {
const res = await fetch('/web/api/inventory/item-detail/' + invId);
if (!res.ok) throw new Error('Ошибка загрузки');
const data = await res.json();
renderItemCard(data);
} catch(e) {
modal.innerHTML = '<div style="padding:2rem;text-align:center;color:var(--danger-color)">Ошибка загрузки данных</div>';
}
}
function renderItemCard(data) {
const modal = document.getElementById('itemCardModal');
const item = data.item;
const colName = data.collection_name || 'Без коллекции';
const rc = (item.rarity || '').toLowerCase().replace(/\s+/g, '-');
const rarityColor = getRarityColor(item.rarity) || '#b0b0b0';
const img = item.image_url || '/static/placeholder.png';
let collHtml = '';
if (data.items && data.items.length) {
data.items.forEach(function(ci) {
const ciRc = (ci.rarity || '').toLowerCase().replace(/\s+/g, '-');
const ciColor = getRarityColor(ci.rarity) || '#b0b0b0';
let statusColor = ci.owned ? '#ffffff' : '#555';
if (data.all_owned) statusColor = '#ffd700';
collHtml += '<div class="ic-collection-item" style="color:' + statusColor + ';">'
+ '<span class="ic-coll-rarity" style="color:' + ciColor + ';">' + ci.rarity + '</span>'
+ ' <span>' + ci.market_hash_name + '</span>'
+ (ci.owned ? ' <span style="color:var(--success-color)">✓</span>' : '')
+ '</div>';
});
}
modal.innerHTML = '<div class="ic-close" onclick="closeItemCard()">✕</div>'
+ '<div class="ic-layout">'
+ '<div class="ic-left">'
+ '<img src="' + img + '" alt="' + item.name + '" onerror="this.src=\'/static/placeholder.png\'" class="ic-image">'
+ '</div>'
+ '<div class="ic-right">'
+ '<div class="ic-name" style="color:' + rarityColor + '">' + item.name + '</div>'
+ '<div class="ic-detail"><span class="ic-label">Коллекция</span><span class="ic-value">' + colName + '</span></div>'
+ '<div class="ic-detail"><span class="ic-label">Поношенность</span><span class="ic-value">' + item.wear + '</span></div>'
+ '<div class="ic-detail"><span class="ic-label">Float</span><span class="ic-value">' + (item.float != null ? item.float.toFixed(6) : '—') + '</span></div>'
+ '<div class="ic-detail"><span class="ic-label">Редкость</span><span class="ic-value" style="color:' + rarityColor + '">' + item.rarity + '</span></div>'
+ '<div class="ic-detail"><span class="ic-label">Тип</span><span class="ic-value">' + (item.type || 'Normal') + '</span></div>'
+ '<div class="ic-detail"><span class="ic-label">Цена</span><span class="ic-value" style="color:var(--success-color)">💰 ' + (item.price_rub || 0).toLocaleString() + ' ₽</span></div>'
+ (collHtml ? '<div class="ic-collection-title">🎨 Скины коллекции</div><div class="ic-collection-list">' + collHtml + '</div>' : '')
+ '<button class="btn-sell-single ic-sell-btn" onclick="sellSingleItem(' + item.id + '); closeItemCard();">Продать за ' + (item.price_rub || 0).toLocaleString() + ' ₽</button>'
+ '</div></div>';
}
function closeItemCard() {
document.getElementById('itemCardOverlay').style.display = 'none';
}
function getRarityColor(rarity) {
const colors = {
'Consumer Grade': '#b0b0b0',
'Industrial Grade': '#5e98d9',
'Mil-Spec': '#4b69ff',
'Mil-Spec Grade': '#4b69ff',
'Restricted': '#8847ff',
'Classified': '#d32ce6',
'Covert': '#eb4b4b',
'Rare Special Item': '#ffd700',
'Extraordinary': '#ffd700',
'Contraband': '#ffaa00'
};
return colors[rarity] || '#b0b0b0';
}
// ─── Попап карточки предмета (HTML в body) ─────────────────────────
</script>
<div id="itemCardOverlay" class="ic-overlay" style="display:none;" onclick="if(event.target===this)closeItemCard()">
<div id="itemCardModal" class="ic-modal"></div>
</div>
{% if not is_public %}{% include '_activity_sidebar.html' %}{% endif %}
</body>
</html>