Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Dungeon Leadboard: Difference between revisions

From Treeverse
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* ===========================
= 🏆 Dungeon Leaderboard =
  Dungeon Leaderboard Script
  =========================== */


mw.hook('wikipage.content').add(function ($content) {
''Fastest verified dungeon completion times.''


    const table = document.getElementById("leaderboardTable");
----
    if (!table) return;


    const dungeonFilter = document.getElementById("filterDungeon");
== 📜 How To Submit ==
    const typeFilter = document.getElementById("filterType");
    const addBtn = document.getElementById("addRunBtn");


    if (!addBtn) return;
# Upload your screenshot here: [[Special:Upload]]
# Click '''Edit''' on this page
# Copy the row template below
# Paste it at the bottom of the table
# Save


    function parseTime(t) {
Row template:
        if (!t || !t.includes(":")) return 999999;
        const parts = t.split(":");
        return parseInt(parts[0]) * 60 + parseInt(parts[1]);
    }


    function sortAndRank() {
<pre>
        const rows = Array.from(table.rows).slice(1);
|-
| Dungeon Name
| Player Name
| 04:32
| [[File:YourScreenshot.png|120px]]
</pre>


        rows.sort((a, b) => {
----
            return parseTime(a.cells[6].innerText) - parseTime(b.cells[6].innerText);
        });


        rows.forEach(row => table.appendChild(row));
== 🏆 Global Rankings ==


        rows.forEach((row, index) => {
{| class="wikitable sortable" style="width:100%; text-align:center;"
            const rankCell = row.cells[0];
! Rank
            if (index === 0) rankCell.innerHTML = "🥇 1";
! Dungeon
            else if (index === 1) rankCell.innerHTML = "🥈 2";
! Player
            else if (index === 2) rankCell.innerHTML = "🥉 3";
! Time (MM:SS)
            else rankCell.innerText = index + 1;
! Screenshot
        });
    }


    function filterTable() {
|-
        const selectedDungeon = dungeonFilter.value;
| 1
        const selectedType = typeFilter.value;
| Wolf's Den
| qtpi
| 01:10
| [[File:Example.png|120px]]


        Array.from(table.rows).slice(1).forEach(row => {
|}
            const dungeon = row.cells[1].innerText.trim();
            const type = row.cells[2].innerText.trim();
 
            const show =
                (selectedDungeon === "All" || dungeon === selectedDungeon) &&
                (selectedType === "All" || type === selectedType);
 
            row.style.display = show ? "" : "none";
        });
    }
 
    if (dungeonFilter) dungeonFilter.addEventListener("change", filterTable);
    if (typeFilter) typeFilter.addEventListener("change", filterTable);
 
    addBtn.addEventListener("click", function () {
        alert("Button working — modal should appear next.");
    });
 
    sortAndRank();
});

Latest revision as of 02:23, 1 March 2026

🏆 Dungeon Leaderboard

edit

Fastest verified dungeon completion times.


📜 How To Submit

edit
  1. Upload your screenshot here: Special:Upload
  2. Click Edit on this page
  3. Copy the row template below
  4. Paste it at the bottom of the table
  5. Save

Row template:

|-
| Dungeon Name
| Player Name
| 04:32
| [[File:YourScreenshot.png|120px]]

🏆 Global Rankings

edit
Rank Dungeon Player Time (MM:SS) Screenshot
1 Wolf's Den qtpi 01:10