File size: 18,328 Bytes
354da6d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin - Add Winning Coins</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
/* Animation for notification */
@keyframes slideIn {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
from { transform: translateX(0); opacity: 1; }
to { transform: translateX(100%); opacity: 0; }
}
.notification-slide-in {
animation: slideIn 0.3s forwards;
}
.notification-slide-out {
animation: slideOut 0.3s forwards;
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="min-h-screen flex flex-col md:flex-row">
<!-- Sidebar -->
<div class="bg-indigo-800 text-white w-full md:w-64 p-4 md:min-h-screen">
<div class="flex items-center justify-between md:justify-center md:flex-col mb-8">
<div class="flex items-center space-x-2">
<i class="fas fa-coins text-2xl text-yellow-400"></i>
<h1 class="text-xl font-bold">Game Admin</h1>
</div>
<button class="md:hidden text-white focus:outline-none" id="sidebarToggle">
<i class="fas fa-bars"></i>
</button>
</div>
<nav class="space-y-2 hidden md:block" id="sidebarMenu">
<a href="#" class="block py-2 px-4 rounded hover:bg-indigo-700 transition">
<i class="fas fa-tachometer-alt mr-2"></i> Dashboard
</a>
<a href="#" class="block py-2 px-4 rounded bg-indigo-900 hover:bg-indigo-700 transition">
<i class="fas fa-coins mr-2"></i> Add Coins
</a>
<a href="#" class="block py-2 px-4 rounded hover:bg-indigo-700 transition">
<i class="fas fa-users mr-2"></i> Players
</a>
<a href="#" class="block py-2 px-4 rounded hover:bg-indigo-700 transition">
<i class="fas fa-gamepad mr-2"></i> Games
</a>
<a href="#" class="block py-2 px-4 rounded hover:bg-indigo-700 transition">
<i class="fas fa-cog mr-2"></i> Settings
</a>
<a href="#" class="block py-2 px-4 rounded hover:bg-indigo-700 transition">
<i class="fas fa-sign-out-alt mr-2"></i> Logout
</a>
</nav>
</div>
<!-- Main Content -->
<div class="flex-1 p-6">
<div class="max-w-4xl mx-auto">
<div class="flex justify-between items-center mb-8">
<h2 class="text-2xl font-bold text-gray-800">Add Winning Coins to Player</h2>
<div class="flex items-center space-x-2">
<span class="bg-indigo-100 text-indigo-800 text-xs font-medium px-2.5 py-0.5 rounded-full">Admin</span>
<img src="https://randomuser.me/api/portraits/men/1.jpg" alt="Admin" class="w-8 h-8 rounded-full">
</div>
</div>
<!-- Stats Cards -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-8">
<div class="bg-white p-4 rounded-lg shadow">
<div class="flex justify-between items-center">
<div>
<p class="text-gray-500 text-sm">Total Players</p>
<h3 class="text-2xl font-bold">1,248</h3>
</div>
<div class="bg-blue-100 p-3 rounded-full">
<i class="fas fa-users text-blue-500"></i>
</div>
</div>
</div>
<div class="bg-white p-4 rounded-lg shadow">
<div class="flex justify-between items-center">
<div>
<p class="text-gray-500 text-sm">Total Coins</p>
<h3 class="text-2xl font-bold">5.2M</h3>
</div>
<div class="bg-green-100 p-3 rounded-full">
<i class="fas fa-coins text-green-500"></i>
</div>
</div>
</div>
<div class="bg-white p-4 rounded-lg shadow">
<div class="flex justify-between items-center">
<div>
<p class="text-gray-500 text-sm">Today's Transactions</p>
<h3 class="text-2xl font-bold">87</h3>
</div>
<div class="bg-purple-100 p-3 rounded-full">
<i class="fas fa-exchange-alt text-purple-500"></i>
</div>
</div>
</div>
</div>
<!-- Add Coins Form -->
<div class="bg-white p-6 rounded-lg shadow">
<div class="mb-6">
<h3 class="text-lg font-semibold text-gray-800">Add Winning Coins</h3>
<p class="text-gray-600 text-sm">Add coins to player's wallet by their in-game name</p>
</div>
<form id="addCoinsForm" class="space-y-4">
<div>
<label for="gameName" class="block text-sm font-medium text-gray-700 mb-1">Game Name</label>
<select id="gameName" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-indigo-500 focus:border-indigo-500">
<option value="">Select a game</option>
<option value="dragon_quest">Dragon Quest</option>
<option value="treasure_hunt">Treasure Hunt</option>
<option value="space_adventure">Space Adventure</option>
<option value="kingdom_rush">Kingdom Rush</option>
<option value="puzzle_challenge">Puzzle Challenge</option>
</select>
<p id="gameNameError" class="mt-1 text-sm text-red-600 hidden">Please select a game</p>
</div>
<div>
<label for="playerName" class="block text-sm font-medium text-gray-700 mb-1">Player In-Game Name</label>
<input type="text" id="playerName" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-indigo-500 focus:border-indigo-500" placeholder="Enter player's in-game name">
<p id="playerNameError" class="mt-1 text-sm text-red-600 hidden">Please enter a valid in-game name</p>
</div>
<div>
<label for="coinAmount" class="block text-sm font-medium text-gray-700 mb-1">Coin Amount</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i class="fas fa-coins text-gray-400"></i>
</div>
<input type="number" id="coinAmount" class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:ring-indigo-500 focus:border-indigo-500" placeholder="Enter coin amount">
</div>
<p id="coinAmountError" class="mt-1 text-sm text-red-600 hidden">Please enter a valid amount (minimum 10 coins)</p>
</div>
<div>
<label for="transactionNote" class="block text-sm font-medium text-gray-700 mb-1">Transaction Note</label>
<textarea id="transactionNote" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-indigo-500 focus:border-indigo-500" placeholder="Optional note about this transaction"></textarea>
</div>
<div class="pt-2">
<button type="submit" class="w-full bg-indigo-600 text-white py-2 px-4 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition flex items-center justify-center">
<i class="fas fa-plus-circle mr-2"></i> Add Coins to Wallet
</button>
</div>
</form>
</div>
<!-- Recent Transactions -->
<div class="mt-8 bg-white p-6 rounded-lg shadow">
<div class="mb-6">
<h3 class="text-lg font-semibold text-gray-800">Recent Coin Transactions</h3>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Player</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Game</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-07-15 14:32</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">DragonSlayer42</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Dragon Quest</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-600 font-medium">+500</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Completed</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-07-15 11:45</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">SpaceExplorer</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Space Adventure</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-600 font-medium">+250</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Completed</span>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-07-14 19:18</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">PuzzleMaster</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Puzzle Challenge</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-green-600 font-medium">+750</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Completed</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Notification -->
<div id="notification" class="fixed bottom-4 right-4 hidden">
<div class="bg-green-500 text-white px-6 py-3 rounded-lg shadow-lg flex items-center">
<i class="fas fa-check-circle mr-2"></i>
<span id="notificationMessage">Coins added successfully!</span>
<button onclick="hideNotification()" class="ml-4 focus:outline-none">
<i class="fas fa-times"></i>
</button>
</div>
</div>
<script>
// Toggle mobile sidebar
document.getElementById('sidebarToggle').addEventListener('click', function() {
const sidebar = document.getElementById('sidebarMenu');
sidebar.classList.toggle('hidden');
});
// Form validation and submission
document.getElementById('addCoinsForm').addEventListener('submit', function(e) {
e.preventDefault();
// Reset errors
document.getElementById('gameNameError').classList.add('hidden');
document.getElementById('playerNameError').classList.add('hidden');
document.getElementById('coinAmountError').classList.add('hidden');
// Get values
const gameName = document.getElementById('gameName').value;
const playerName = document.getElementById('playerName').value.trim();
const coinAmount = document.getElementById('coinAmount').value;
// Validate
let isValid = true;
if (!gameName) {
document.getElementById('gameNameError').classList.remove('hidden');
isValid = false;
}
if (!playerName || playerName.length < 3) {
document.getElementById('playerNameError').classList.remove('hidden');
isValid = false;
}
if (!coinAmount || isNaN(coinAmount) || parseInt(coinAmount) < 10) {
document.getElementById('coinAmountError').classList.remove('hidden');
isValid = false;
}
if (isValid) {
// In a real app, you would send this data to your backend
console.log('Submitting:', {
gameName,
playerName,
coinAmount,
note: document.getElementById('transactionNote').value
});
// Show success notification
showNotification('Successfully added ' + coinAmount + ' coins to ' + playerName + "'s wallet");
// Reset form
this.reset();
}
});
// Notification functions
function showNotification(message) {
const notification = document.getElementById('notification');
const messageElement = document.getElementById('notificationMessage');
messageElement.textContent = message;
notification.classList.remove('hidden');
notification.classList.add('notification-slide-in');
notification.classList.remove('notification-slide-out');
// Auto-hide after 5 seconds
setTimeout(hideNotification, 5000);
}
function hideNotification() {
const notification = document.getElementById('notification');
notification.classList.add('notification-slide-out');
setTimeout(() => {
notification.classList.add('hidden');
}, 300);
}
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=guliavansh/https-complete-gaming-tour-jpsy-bolt-host" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |