<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <title>Some title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        .online-block:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
        }
        .online-block-container {
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            margin-bottom: 20px;
        }

        .online-block {
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #03a9f4;
            width: 300px;
            height: 100px;
            margin: 10px;
            border: 1px solid #ddd;
            border-radius: 8px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
            font-size: 20px;
            font-weight: bold;
            color: white;
            text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
            text-align: center;
            transition: transform 0.2s, box-shadow 0.2s;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class="online-block-container">
        <div id="online-1" class="online-block">Анархия: ...</div>
        <div id="online-2" class="online-block">FFA: ...</div>
    </div>

    <script>
        function checkServerStatus(serverIp, serverName, elementId) {
            const url = `https://mcapi.us/server/status?ip=${serverIp}`;

            fetch(url)
                .then(response => response.json())
                .then(data => {
                    const statusElement = document.getElementById(elementId);
                    if (data.online) {
                        statusElement.textContent = `${serverName}: ${data.players.now} игроков`;
                    } else {
                        statusElement.textContent = `${serverName}: Сервер не доступен`;
                    }
                })
                .catch(error => {
                    document.getElementById(elementId).textContent = `${serverName}: Ошибка при подключении к серверу.`;
                });
        }
        checkServerStatus('d3.aurorix.net:25169', 'Анархия', 'online-1');
        checkServerStatus('s25.joinserver.xyz:25660', 'FFA', 'online-2');
    </script>
</body>

</html>
