Autosave: 20260409-014923
This commit is contained in:
parent
e191a6916e
commit
a528142c4f
@ -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
|
||||
|
||||
53
scmining.php
53
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'] ?? '';
|
||||
<?php else: ?>
|
||||
<?php foreach ($search_results as $res):
|
||||
if (is_array($res) && isset($res['cl_scobjs_uuid']) && isset($res['cl_scobjs_name']) && isset($res['cl_scobjs_type']) && isset($res['cl_scobjs_subtype']) && isset($res['cl_scobjs_id'])) {
|
||||
$rarity_code = $res['cl_scobjs_rarity'] ?? '';
|
||||
$rarity_class = sc_rarity_class($rarity_code);
|
||||
$rarity_label = sc_rarity_label($rarity_code);
|
||||
?>
|
||||
<div class="search-result-item">
|
||||
<img src="https://cstone.space/uifimages/<?php echo $res['cl_scobjs_uuid']; ?>.png" class="item-preview" alt="">
|
||||
<div class="search-result-info">
|
||||
<span class="search-result-name"><?php echo htmlspecialchars($res['cl_scobjs_name']); ?></span>
|
||||
<span class="search-result-name <?php echo htmlspecialchars($rarity_class); ?>"><?php echo htmlspecialchars($res['cl_scobjs_name']); ?></span>
|
||||
<span class="search-result-meta"><?php echo htmlspecialchars($res['cl_scobjs_type']); ?> / <?php echo htmlspecialchars($res['cl_scobjs_subtype']); ?></span>
|
||||
<span class="search-result-rarity <?php echo htmlspecialchars($rarity_class); ?>">Rareté : <?php echo htmlspecialchars($rarity_label); ?></span>
|
||||
</div>
|
||||
<form method="post">
|
||||
<input type="hidden" name="csrf_token" value="<?php echo htmlspecialchars($csrf_token); ?>">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user