	
<script>
document.addEventListener("DOMContentLoaded", function() {
    const searchInput = document.getElementById("server_search");
    const searchResults = document.getElementById("search_results");
    const searchCat = document.getElementById("search_cat");

    searchInput.addEventListener("keyup", function() {
        let keyword = this.value.trim();
        let cat = searchCat.value;

        if (keyword.length < 2) {
            searchResults.style.display = "none";
            return;
        }

        fetch("./ajax_search.php?q=" + encodeURIComponent(keyword) + "&cat=" + cat)
            .then(r => r.json())
            .then(data => {
                searchResults.innerHTML = "";
                if (data.results && data.results.length > 0) {
                    data.results.forEach(item => {
                        let div = document.createElement("a");
                        div.className = "item";
                        div.href = "/server-" + item.seo_name + "." + item.id;
                        div.innerHTML = `<i class="server icon"></i> ${item.title} <span style="color:gray;">(${item.description || ''})</span>`;
                        searchResults.appendChild(div);
                    });
                    searchResults.style.display = "block";
                } else {
                    searchResults.style.display = "none";
                }
            }).catch(err => {
                console.error(err);
                searchResults.style.display = "none";
            });
    });

    // Sayfada boş tıklayınca dropdown kapanması
    document.addEventListener("click", function(e) {
        if (!e.target.closest("#server_search") && !e.target.closest("#search_results")) {
            searchResults.style.display = "none";
        }
    });
});

</script>
	<style>
#search_results {
    display: none;
    position: absolute;
    z-index: 999;
    max-height: 300px;
    overflow-y: auto;
    background: #1b1c1d;
    border: 1px solid #555;
    border-radius: 4px;
}
#search_results a.item {
    color: #fff;
    padding: 8px 12px;
    display: block;
    cursor: pointer;
}
#search_results a.item:hover {
    background: #333;
}

	</style>
<!-- CSS -->
<style>
.popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
}
.popup-content {
    background: #fff;
    max-width: 700px;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    position: relative;
	height: max-content;
}
.popup-content p {
    padding: 0 10px!important;
    width: 100%!important;
    display: inline-block!important;
    white-space: normal!important;
    text-overflow: ellipsis!important;
	color: #424242;
}
.popup-section { 
	margin: 15px 0;
	text-align: left;
}
.popup-content input {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: left;
    cursor: pointer;
}
.close-btn {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 24px;
    cursor: pointer;
}
</style>

<!-- JS -->
<script>
function openPopup(name, host, bedrock_host, bedrock_port) {
    document.getElementById("popupName").innerText = name;
    document.getElementById("popupJava").value = host;
    document.getElementById("popupBedrockIP").value = bedrock_host || "N/A";
    document.getElementById("popupBedrockPort").value = bedrock_port || "19132";
    document.getElementById("serverPopup").style.display = "flex";
}

function closePopup() {
    document.getElementById("serverPopup").style.display = "none";
}

function copyToClipboard(el) {
    el.select();
    document.execCommand("copy");
}
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
    const nextBtn = document.getElementById("btn-next");
    const prevBtn = document.getElementById("btn-prev");
    const tagsSliderTrack = document.querySelector(".tags-track");
    const sliderLeftOverlay = document.querySelector(".left-overlay");
    const sliderRightOverlay = document.querySelector(".right-overlay");

    // Eğer track bulunmadıysa kodu çalıştırma
    if (!tagsSliderTrack || !tagsSliderTrack.parentElement) {
        console.warn("⚠️ .tags-track bulunamadı veya parent eksik.");
        return;
    }

    const tags = Array.from(tagsSliderTrack.querySelectorAll(".tag"));

    // Step değeri: toplam kaydırma mesafesini 4'e böl
    const step = Math.floor(
        (tagsSliderTrack.clientWidth - tagsSliderTrack.parentElement.clientWidth) / 4
    );

    // Slider butonları eventleri
    if (nextBtn) {
        nextBtn.addEventListener("click", () => moveTagsSlider(-1));
    }
    if (prevBtn) {
        prevBtn.addEventListener("click", () => moveTagsSlider(1));
    }

    function moveTagsSlider(direc) {
        // body'de tanımlı CSS değişkenini al
        let transValue = parseInt(
            getComputedStyle(document.body).getPropertyValue("--sliderTransX")
        );

        if (isNaN(transValue)) transValue = 0; // ilk başta boşsa 0 yap

        transValue = transValue + step * direc;

        updateActionBtns(transValue);

        document.body.style.setProperty("--sliderTransX", `${transValue}px`);
    }

    function updateActionBtns(moveValue) {
        // Sol buton & overlay kontrolü
        if (moveValue < 0) {
            prevBtn?.classList.remove("hide");
            sliderLeftOverlay?.classList.remove("hide");
        } else {
            prevBtn?.classList.add("hide");
            sliderLeftOverlay?.classList.add("hide");
        }

        // Sağ buton & overlay kontrolü
        if (
            tagsSliderTrack.scrollWidth - Math.abs(moveValue) <=
            tagsSliderTrack.parentElement.clientWidth
        ) {
            nextBtn?.classList.add("hide");
            sliderRightOverlay?.classList.add("hide");
        } else {
            nextBtn?.classList.remove("hide");
            sliderRightOverlay?.classList.remove("hide");
        }
    }

    // Tag tıklama eventleri
    tags.forEach((tag) => {
        tag.addEventListener("click", (e) => updateActiveTag(e));
    });

    function updateActiveTag(e) {
        const clickedTag = e.target;
        tags.forEach((tag) => tag.classList.remove("active"));
        clickedTag.classList.add("active");
    }
});
</script><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://craftserverlist.com</loc>
    <priority>1.0</priority>
    <changefreq>daily</changefreq>
    <lastmod>2026-04-06</lastmod>
  </url>
  <url>
    <loc>https://craftserverlist.com</loc>
    <priority>1.0</priority>
    <changefreq>daily</changefreq>
    <lastmod>2026-04-06</lastmod>
  </url>
    <url>
    <loc>https://craftserverlist.com/versions</loc>
    <priority>1.0</priority>
    <changefreq>daily</changefreq>
    <lastmod>2026-04-06</lastmod>
  </url>
    <url>
    <loc>https://craftserverlist.com/types</loc>
    <priority>1.0</priority>
    <changefreq>daily</changefreq>
    <lastmod>2026-04-06</lastmod>
  </url>
    <url>
    <loc>https://craftserverlist.com/status-checker</loc>
    <priority>1.0</priority>
    <changefreq>daily</changefreq>
    <lastmod>2026-04-06</lastmod>
  </url>
  <url>
    <loc>https://craftserverlist.com/votifier-tester</loc>
    <priority>1.0</priority>
    <changefreq>daily</changefreq>
    <lastmod>2026-04-06</lastmod>
  </url>
</urlset>
