| | <!DOCTYPE html> |
| | <html> |
| | <head> |
| | <title>Void City Admin</title> |
| | <style> |
| | body { background: #222; color: white; font-family: sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; } |
| | button { padding: 20px 40px; font-size: 24px; margin: 10px; cursor: pointer; border: none; border-radius: 5px; } |
| | .start { background: #2ecc71; color: white; } |
| | .stop { background: #e74c3c; color: white; } |
| | </style> |
| | <script src="https://cdn.socket.io/4.7.4/socket.io.min.js"></script> |
| | </head> |
| | <body> |
| | <h1>Admin Control Panel</h1> |
| | <button class="start" onclick="send('start_tournament')">Start Tournament</button> |
| | <button class="stop" onclick="send('stop_tournament')">Stop & Show Results</button> |
| | |
| | <script> |
| | |
| | |
| | const token = sessionStorage.getItem('game_token'); |
| | const socket = io({ auth: { token: token } }); |
| | |
| | function send(cmd) { |
| | if(confirm("Are you sure?")) { |
| | socket.emit('admin_cmd', { cmd: cmd }); |
| | } |
| | } |
| | </script> |
| | </body> |
| | </html> |