From a528142c4f852862dc9697447bde61037074fafd Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Thu, 9 Apr 2026 01:49:23 +0000 Subject: [PATCH] Autosave: 20260409-014923 --- scitemcustom.php | 2 +- scmining.php | 53 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/scitemcustom.php b/scitemcustom.php index 8838a9a..ac032ce 100644 --- a/scitemcustom.php +++ b/scitemcustom.php @@ -53,7 +53,7 @@ function scitemcustom_preview(string $sign, $value, string $unit): string { $prefix = $sign === '-' ? '-' : ($sign === '+' ? '+' : ''); - return $prefix . scitemcustom_display_value($value) . $unit; + return $prefix . scitemcustom_display_value($value) . ' ' . $unit; } function scitemcustom_current_owner_auth_id(PDO $db): int diff --git a/scmining.php b/scmining.php index 9bda8c7..039c909 100644 --- a/scmining.php +++ b/scmining.php @@ -85,6 +85,23 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } // Search for adding items +function sc_rarity_label(?string $rarity): string +{ + return match ($rarity) { + 'L' => 'Legendary', + 'E' => 'Epic', + 'R' => 'Rare', + 'U' => 'Uncommon', + 'C' => 'Common', + default => 'Non définie', + }; +} + +function sc_rarity_class(?string $rarity): string +{ + return in_array($rarity, ['L', 'E', 'R', 'U', 'C'], true) ? 'rarity-' . $rarity : 'rarity-none'; +} + $search = isset($_GET['search']) ? trim($_GET['search']) : ''; $search_results = []; if ($search !== '') { @@ -120,6 +137,12 @@ $current_session_user = $_SESSION['user'] ?? ''; --border-glow: rgba(162, 155, 120, 0.25); --danger: #ff4d4d; --success: #00ff88; + + --rarity-L: #ff8000; + --rarity-E: #a335ee; + --rarity-R: #0070dd; + --rarity-U: #1eff00; + --rarity-C: #ffffff; } @font-face { @@ -291,6 +314,30 @@ $current_session_user = $_SESSION['user'] ?? ''; .search-result-info { flex: 1; } .search-result-name { display: block; color: var(--primary); font-weight: bold; } .search-result-meta { display: block; font-size: 0.75rem; color: #888; } + .search-result-rarity { + display: inline-flex; + align-items: center; + gap: 0.35rem; + margin-top: 0.4rem; + font-size: 0.72rem; + text-transform: uppercase; + letter-spacing: 0.08em; + } + .search-result-rarity::before { + content: ''; + width: 8px; + height: 8px; + border-radius: 50%; + background: currentColor; + box-shadow: 0 0 8px currentColor; + } + + .rarity-L { color: var(--rarity-L) !important; text-shadow: 0 0 10px rgba(255, 128, 0, 0.3); } + .rarity-E { color: var(--rarity-E) !important; text-shadow: 0 0 10px rgba(163, 53, 238, 0.3); } + .rarity-R { color: var(--rarity-R) !important; text-shadow: 0 0 10px rgba(0, 112, 221, 0.3); } + .rarity-U { color: var(--rarity-U) !important; text-shadow: 0 0 10px rgba(30, 255, 0, 0.3); } + .rarity-C { color: var(--rarity-C) !important; } + .rarity-none { color: #8f96a3 !important; } .val-input { width: 100px; text-align: center; } @@ -364,12 +411,16 @@ $current_session_user = $_SESSION['user'] ?? '';
- + / + Rareté :