Favicon for Vaultcraft Minecraft Server

Vaultcraft

Players 0 playing now
Votes 0
Country Flag of United States
Rating N/A
MOTD VAULTCRAFT Seeking Players Join Today! Land Protection | v1.21 | Diamond Economy
gtag('event', 'conversion', { 'send_to': 'AW-17016135656/jYkdCOC8kroaEOi_9rE_', 'value': 0.65, 'currency': 'AUD' }); const [bedrock_ip, bedrock_port] = bedrock.split(':') document.querySelector('#bedrock_elements').style.display = (!!bedrock_ip && bedrock_ip != "0") ? "flex" : "none" document.querySelector('#java_address > span').textContent = java document.querySelector('#bedrock_address > span').textContent = bedrock_ip document.querySelector('#bedrock_port > span').textContent = bedrock_port copyToClipboard(java).then(function() { // Send an AJAX request to record the copy count let xhr = new XMLHttpRequest(); xhr.open('POST', '/scripts/record_copy_count.php', true); xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xhr.send('server_id=' + id); gtag('event', 'IPCopy', {'event_category': 'UserActions', 'event_label': 'IPCopyEvent'}); }); } function setActiveButton(name) { if (name === "vote_success") name = "vote" let buttons = document.getElementById("tab_buttons").children for (let i = 0; i < buttons.length; i++) { let button = buttons.item(i) if (button.id != `${name}_button` && button.hasAttribute("data-active")) { button.removeAttribute("data-active") } else if (button.id === `${name}_button`) { button.setAttribute("data-active", "true") } } } function changetab(name) { setActiveButton(name.split("_tab")[0]); // Only modify URL if the tab is not 'about' if (name !== 'about') { let url = new URL(window.location.href); let pathParts = url.pathname.split('/').filter(Boolean); // filter out any empty strings due to extra slashes // Remove 'send-vote' from pathParts const sendVoteIndex = pathParts.indexOf('send-vote'); if (sendVoteIndex !== -1) { pathParts.splice(sendVoteIndex, 1); } // List of valid tab names (excluding 'about' for URL manipulation logic) let validTabsForUrl = ["vote", "vote_success", "reviews", "statistics"]; // If the last part is a valid non-about tab, replace it. Otherwise, add the new tab. if (validTabsForUrl.includes(pathParts[pathParts.length - 1])) { pathParts[pathParts.length - 1] = name; } else { pathParts.push(name); } url.pathname = pathParts.join('/'); history.pushState({}, "", url.toString()); } else { // If switching back to 'about', remove the last path segment if it's a valid tab name let url = new URL(window.location.href); let pathParts = url.pathname.split('/').filter(Boolean); let validTabs = ["vote", "vote_success", "reviews", "statistics"]; // Check against other tabs if (validTabs.includes(pathParts[pathParts.length - 1])) { pathParts.pop(); // Remove the last element (the tab name) url.pathname = pathParts.join('/'); // Use replaceState to avoid creating extra history entries when going back to the default state history.replaceState({}, "", url.toString()); } } let tabs = document.getElementById("tabs").children; for (let i = 0; i < tabs.length; i++) { let tab = tabs.item(i); if (tab.id === `${name}_tab`) { tab.style = ""; } else { tab.style = "display: none;"; } } } // URL MANAGING { let currentPath = new URL(window.location.href).pathname; let paths = currentPath.split('/').filter(Boolean); // filter out any empty strings due to extra slashes let tabName = paths[paths.length - 1]; // List of valid tab names let validTabs = ["about", "vote", "vote_success", "reviews", "statistics"]; // If there's a tab in the URL, change to that tab. Otherwise, default to the "about" tab. if (validTabs.includes(tabName)) { changetab(tabName); } else { changetab("about"); } } /** * @param {string} serverId * @param {"ip-copies" | "player-count"} chartType * @param {"daily" | "weekly" | "monthly"} timeframe */ function fetchData(serverId, chartType, timeframe) { return fetch(`/scripts/${chartType}_data.php?server_id=${serverId}&timeframe=${timeframe}`) .then((response) => response.json()) } function sendIpCopyCount(serverid) { return fetch("/scripts/record_copy_count.php", { method: "POST", body: new URLSearchParams({ server_id: serverid }), headers: { "Content-Type": "application/x-www-form-urlencoded" } }) } Chart.defaults.plugins.legend.display = false const ccCTX = document.getElementById("copy_count") const copyCountChart = new Chart(ccCTX, { type: "line", data: { datasets: [{ type: 'line', label: `Copy count`, data: [] }], labels: [] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { min: 0, max: 10 } } }, }); /** * @param {"daily" | "weekly" | "monthly"} timeframe */ function updateIpCopyData(timeframe = "daily") { return fetchData("227", "ip-copies", timeframe).then((data) => { copyCountChart.data.datasets = [{ type: 'line', label: `IP Copy Count (${timeframe.toUpperCase()})`, data: data.map((d) => d.count), }] copyCountChart.data.labels = data.map((d) => d.date) copyCountChart.options.scales.y.max = Math.max(...data.map((d) => d.count)) + 5 copyCountChart.update() }); } const pcCTX = document.getElementById("player_count") const pcChart = new Chart(pcCTX, { type: "line", data: { datasets: [{ type: 'line', label: `Player Count (DAILY)`, data: [] }], labels: [] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { min: 0, max: 10 } } }, }); /** * @param {"daily" | "weekly" | "monthly"} timeframe */ function updatePlayerCountData(timeframe = "daily") { fetchData("227", "player-count", timeframe).then((data) => { pcChart.data.datasets = [{ type: 'line', label: `Player Count (${timeframe.toUpperCase()})`, data: data.map((d) => d.count), }] pcChart.data.labels = data.map((d) => d.date) pcChart.options.scales.y.max = Math.max(...data.map((d) => d.count)) + 5 pcChart.update() }); } function startCountdown() { // Define your target time as 24 hours from now var targetTime = new Date().getTime() + 24 * 60 * 60 * 1000; // Set up a function to update the timer function updateTimer() { var now = new Date().getTime(); var timeLeft = targetTime - now; // If the countdown is finished, stop the interval and allow the user to vote again if (timeLeft < 0) { clearInterval(countdown); document.getElementById("timer").innerText = "You can vote now"; return; } // Calculate hours, minutes, and seconds var hours = Math.floor(timeLeft / (1000 * 60 * 60)); var minutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((timeLeft % (1000 * 60)) / 1000); // Update the countdown timer document.getElementById("timer").innerText = hours + "h " + minutes + "m " + seconds + "s "; } // Call the update function immediately, then set an interval to call it every second updateTimer(); var countdown = setInterval(updateTimer, 1000); } // Call the startCountdown function startCountdown(); updateIpCopyData("daily") updatePlayerCountData("daily") -->

About Vaultcraft