Шаблон:Онлайн: відмінності між версіями

Матеріал з Бастіон-16
Перейти до навігації Перейти до пошуку
Немає опису редагування
Немає опису редагування
 
(Не показані 177 проміжних версій 2 користувачів)
Рядок 1: Рядок 1:
<html><div class="card"> <div class="icon"><img src="https://i.imgur.com/uv3Dk9W.jpg" id="favicon"></div><div class="header">
<html>
  <div class="image"> <img src="https://wiki.bastion16.co.ua/images/5/5f/IMG_20240928_235304_415.jpg" alt="" /> </div>
<head>
    <script src="/resources/status.js"></script>
  <h2>play.bastion16.co.ua</h2>
    <title>MC Онлайн Гравці</title>
  </div>
    <style>
  <div id="rest">Loading ...</div>
        #widget {
</div>
            padding: 1em;
<script>//based on a pen by @robinselmer
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
var url = "https://api.minetools.eu/ping/195.95.147.160/35211";
        }
//https://mcapi.us/server/status?ip=666.fluctis.com&port=25757
        #players {
$.getJSON(url, function(r) {
            font-weight: bold;  
    //data is the JSON string
            list-style: none;
if(r.error){
            padding: 0;
    $('#rest').html('Server Offline');
            margin: 0;
  return false;
        }
}
        #players li {
var pl = '';
            display: flex;
if(r.players.sample.length > 0 ){ pl = '<br>OP: '+r.players.sample[0].name; }  
            align-items: center;
  $('#rest').html(r.description.replace(/§(.+?)/gi, '')+'<br><b>Players Online:</b> '+r.players.online+pl) ;
            padding: 5px 0;
$('#favicon').attr('src', r.favicon);
            border-bottom: 1px solid #b1b3b6;
   
        }
});
        #players li:last-child {
</script>
            border-bottom: none;
<style>
        }
 
        #players img {
 
            width: 24px;
.card {
            height: 24px;
  position: relative;
            margin-right: 10px;
  margin: 0 auto;
            border-radius: 4px;
  padding: 0;
            border: 1px solid #a2a9b1;
  width: 200px;
        }
  min-width: 300px;
        #players a {
  background: #ffffff;
            text-decoration: none;
  border-radius: 5px;
            color: #555;
  box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.3);
        }
  -webkit-animation: fadein 2s;
        #players a:hover {
          animation: fadein 2s;
            text-decoration: underline;
  overflow:hidden;
            color: #007bff;
  z-index: 999;
        }
}
        .server-header {
 
            text-align: center;
 
            margin-bottom: 15px;
.card img{
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  width:100%;
        }
  transition: all 1s ease;
        #playerCount {
  z-index:0
            font-size: 1.2em;
}
            font-weight: bold;
.image {
            margin-left: 10px;
  width: 100%;
        }
  height: 180px;
        #server-icon {
  cursor:crosshair;
            width: 64px;
  overflow:hidden;
            height: 64px;
}
            display: block;
 
            float: left;
.image:hover img{
        }
  -webkit-transform: scale(1.2, 1.2);
        .status-container {
          transform: scale(1.2, 1.2);
            display: flex;
}
            align-items: center;
 
            justify-content: flex-start;
.icon {
        }
  position: absolute;
        .status-indicator {
  background:#fff;
            width: 20px;
  right: 10px;
            height: 20px;
  top: 135px;
            border-radius: 50%;
  width: 80px;
            margin-right: 10px;
  height: 80px;
            animation: pulse 1.5s infinite;
  border-radius: 50%;
        }
  overflow:hidden;
        .status-online {
  border:3px solid #fff;
            background-color: #4caf50;
  box-shadow:0 4px 3px #0002;
            box-shadow: 0 0 10px #4caf50;
  z-index:9
        }
}
        .status-offline {
 
            background-color: #f44336;
</style></html>
            box-shadow: 0 0 10px #f44336;
        }
        .status-text {
            font-size: 1.2em;
            font-weight: bold;
        }
        .status-online-text {
            color: #4caf50;
        }
        .status-offline-text {
            color: #f44336;
        }
        @keyframes pulse {
            0%, 100% {
                transform: scale(1);
                opacity: 1;
            }
            50% {
                transform: scale(1.2);
                opacity: 0.7;
            }
        }
        #motd {
                font-size: 1.2em;
                font-weight: bold;
              font-weight: bold;
    color: #0056b3;
    background-color: #000000;
    padding: 20px 10px 10px 10px;
    /* border-radius: 4px; */
    margin-bottom: 1em;
          text-align: center;
            height: 34px;
        }
        #server-ip {
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            width: 21%;
            font-size: 1.2em; */
            margin: 1em 0 auto;
            padding: 10px;
            /* background-color: #f1f1f1; */
            /* border: 1px solid #ccc; */
            display: block;
            cursor: pointer;
            text-align: center;
            /* position: absolute; */
            top: 50%;
            background-color: #fff;
            color: #000;
          } 
        #server-ip:hover {
            background-color: #000;
            color: #fff;
        }
        #anketa {
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            width: 21%;
            font-size: 1.2em; */
            margin: 1em 0 auto;
            padding: 10px;
            /* background-color: #f1f1f1; */
            /* border: 1px solid #ccc; */
            display: block;
            cursor: pointer;
            text-align: center;
            /* position: absolute; */
            top: 50%;
            background-color: #fff;
            color: #000;
            text-decoration: none;
          } 
        #anketa:hover {
            background-color: #000;
            color: #fff;
        }
        .link-header {
            display: flex;
            align-items: center;
            justify-content: space-evenly;
        }
    </style>
</head>
<body>
        <div id="widget">
            <div class="server-header">
                <img id="server-icon" src="" alt="Іконка сервера">
                <p id="motd" class="info">Завантаження MOTD...</p>
            </div>
            <div class="link-header">
            <p id="server-ip" onclick="copyToClipboard('play.bastion16.co.ua')">IP Сервера</p>
            <a target=”_blank” href="https://bastion16.co.ua/anketa/survey" id="anketa">Анкета</a>
            <a target=”_blank” href="https://map.bastion16.co.ua/" id="anketa">Мапа</a>
            <a target=”_blank” href="https://t.me/bastionanketa_bot" id="anketa">Написати адміну</a>
            </div>
            <div class="status-container">
                <div id="status-indicator" class="status-indicator status-offline"></div>
                <div id="status-text" class="status-text status-offline-text">Offline</div>
                <p id="playerCount" class="info">Завантаження...</p>
            </div>
            <ul id="players"></ul>
        </div>
</body>
</html>

Поточна версія на 16:08, 20 вересня 2025

MC Онлайн Гравці

Іконка сервера

Завантаження MOTD...

Offline

Завантаження...