small update

This commit is contained in:
2025-07-07 03:11:52 -04:00
parent 75a0840ca1
commit 389107e06d
2 changed files with 139 additions and 138 deletions

View File

@@ -65,7 +65,7 @@
<h2 class="text-3xl minecraft-font mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500"> <h2 class="text-3xl minecraft-font mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-teal-400 to-blue-500">
Public Server List</h2> Public Server List</h2>
<p class="text-lg mb-8 max-w-3xl mx-auto opacity-90 leading-relaxed text-center"> <p class="text-lg mb-8 max-w-3xl mx-auto opacity-90 leading-relaxed text-center">
Discover servers publically hosted on My-MC.<BR>Our public Realms list resets daily at 12 AM EST daily. Discover servers publically hosted on My-MC.<BR>Our public Realms list resets daily at 12 AM EST.
</p> </p>
<div class="search-container"> <div class="search-container">
<input type="text" id="search-input" class="search-input" placeholder="Search by owner, MOTD, version, or status..."> <input type="text" id="search-input" class="search-input" placeholder="Search by owner, MOTD, version, or status...">

View File

@@ -1,5 +1,5 @@
// Function to copy text to clipboard and trigger animation // Function to copy text to clipboard and trigger animation
function copyToClipboard(text, button) { function copyToClipboard(text, button) {
navigator.clipboard.writeText(text).then(() => { navigator.clipboard.writeText(text).then(() => {
button.classList.add('copied'); button.classList.add('copied');
setTimeout(() => { setTimeout(() => {
@@ -8,10 +8,11 @@
}).catch(err => { }).catch(err => {
console.error('Failed to copy:', err); console.error('Failed to copy:', err);
}); });
} }
// Function to create a server card // Function to create a server card
function createServerCard(server, isNew = false) { // Function to create a server card
function createServerCard(server, isNew = false) {
const ownerName = server.ops && server.ops.length > 0 ? server.ops[0].name : 'Unknown'; const ownerName = server.ops && server.ops.length > 0 ? server.ops[0].name : 'Unknown';
const serverCard = document.createElement('div'); const serverCard = document.createElement('div');
serverCard.className = `feature-card tilt-card ${isNew ? 'new-server-animation' : ''}`; serverCard.className = `feature-card tilt-card ${isNew ? 'new-server-animation' : ''}`;
@@ -40,10 +41,10 @@
</div> </div>
`; `;
return serverCard; return serverCard;
} }
// Function to update server list dynamically // Function to update server list dynamically
function updateServerList(newServers) { function updateServerList(newServers) {
const serverList = document.getElementById('server-list'); const serverList = document.getElementById('server-list');
const currentCards = Array.from(serverList.children); const currentCards = Array.from(serverList.children);
const currentConnects = currentCards.map(card => card.dataset.connect); const currentConnects = currentCards.map(card => card.dataset.connect);
@@ -82,10 +83,10 @@
removed: serversToRemove.length, removed: serversToRemove.length,
total: newServers.length total: newServers.length
}); });
} }
// Function to fetch and display servers // Function to fetch and display servers
async function fetchServers() { async function fetchServers() {
const serverList = document.getElementById('server-list'); const serverList = document.getElementById('server-list');
const loadingMessage = document.getElementById('loading-message'); const loadingMessage = document.getElementById('loading-message');
const errorMessage = document.getElementById('error-message'); const errorMessage = document.getElementById('error-message');
@@ -141,10 +142,10 @@
errorMessage.classList.remove('hidden'); errorMessage.classList.remove('hidden');
console.error('Error fetching servers:', error); console.error('Error fetching servers:', error);
} }
} }
// Initial fetch // Initial fetch
fetchServers(); fetchServers();
// Fetch servers every 60 seconds // Fetch servers every 60 seconds
setInterval(fetchServers, 60000); setInterval(fetchServers, 60000);