diff --git a/admin.php b/admin.php index 0596acc..d2201b1 100644 --- a/admin.php +++ b/admin.php @@ -404,6 +404,10 @@ if ($tab === 'users') { .slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; } input:checked + .slider { background-color: #a3be8c; } input:checked + .slider:before { transform: translateX(20px); } + + /* Color picker custom style */ + .color-group { display: flex; gap: 5px; } + .color-picker-input { width: 45px !important; height: 34px !important; padding: 2px !important; border: 1px solid #334155 !important; background: #0f172a !important; cursor: pointer; } @@ -626,8 +630,11 @@ if ($tab === 'users') {
- - + +
+ + +
@@ -717,7 +724,10 @@ if ($tab === 'users') {
- +
+ + +
@@ -984,10 +994,17 @@ if ($tab === 'users') { document.getElementById('st_name').value = data.name; document.getElementById('st_slug').value = data.slug; document.getElementById('st_color').value = data.color; + if (document.getElementById('st_color_picker')) { + document.getElementById('st_color_picker').value = data.color.startsWith('#') ? data.color : '#000000'; + } document.getElementById('st_desc').value = data.description; window.scrollTo(0,0); } - function resetStatusForm() { document.getElementById('statusForm').reset(); document.getElementById('st_id').value = 0; } + function resetStatusForm() { + document.getElementById('statusForm').reset(); + document.getElementById('st_id').value = 0; + document.getElementById('st_color_picker').value = '#000000'; + } function editSettlementType(data) { document.getElementById('set_t_id').value = data.id; @@ -1012,11 +1029,20 @@ if ($tab === 'users') { document.getElementById('fac_id').value = data.id; document.getElementById('fac_name').value = data.name; document.getElementById('fac_slug').value = data.slug || ''; - document.getElementById('fac_color').value = data.color || '#808080'; + const color = data.color || '#808080'; + document.getElementById('fac_color').value = color; + if (document.getElementById('fac_color_picker')) { + document.getElementById('fac_color_picker').value = color.startsWith('#') ? color : '#808080'; + } document.getElementById('fac_fa_icon').value = data.fa_icon || ''; window.scrollTo(0,0); } - function resetFactionForm() { document.getElementById('factionForm').reset(); document.getElementById('fac_id').value = 0; document.getElementById('fac_color').value = '#808080'; } + function resetFactionForm() { + document.getElementById('factionForm').reset(); + document.getElementById('fac_id').value = 0; + document.getElementById('fac_color').value = '#808080'; + document.getElementById('fac_color_picker').value = '#808080'; + } function editResource(data) { document.getElementById('res_id').value = data.id;