<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>《AG》N-age Online:古惑人生 - NPC掉落道具</title>
    <link rel="stylesheet" href="Style.css">
    <link rel="icon" type="image/x-icon" href="favicon.ico">
    <style>
        .icon {
            width: 32px;
            height: 32px;
            display: inline-block;
            background-image: url('item00.bmp');
            background-size: 256px 256px;
        }
    </style>
</head>
<body class="dark-mode">
    <div class="logo-container">
        <img src="agnagelogo.png" alt="AGNAGE Logo">
    </div>
    <h1>查詢NPC掉落道具</h1>
    <div class="top-right-container">
        <select onchange="toggleDarkMode()" class="top-right-select">
            <option value="dark">深色模式</option>
            <option value="light">淺色模式</option>
        </select>
    </div>
    <form id="queryForm" onsubmit="executeQuery(event)">
        <div class="checkbox-container">
            <div class="checkbox-item">
                <input type="checkbox" id="npcNameCheckbox" name="npcNameCheckbox" value="npcName" onchange="toggleCheckbox(this)">
                <label for="npcNameCheckbox">NPC名字</label>
            </div>
            <div class="checkbox-item">
                <input type="checkbox" id="itemNameCheckbox" name="itemNameCheckbox" value="itemName" onchange="toggleCheckbox(this)">
                <label for="itemNameCheckbox">物品名字</label>
            </div>
        </div>
        <br>
        <label for="searchTerm">輸入查詢條件：</label>
        <input type="text" id="searchTerm" name="searchTerm" required>
        <button type="submit" class="center-button">查詢</button>
    </form>
    <h2 id="resultsTitle" style="display:none;">查詢結果</h2>
    <table id="resultTable">
        <thead>
            <tr>
                <th>NPC名字</th>
                <th>掉落道具</th>
                <th>掉落機率 (%)</th>
            </tr>
        </thead>
        <tbody id="resultBody">
        </tbody>
    </table>
    <footer>
        <p>2022-2025 AGN-age Online. All rights reserved.</p>
        <p>GM Contact Discord: Bobby1998</p>
    </footer>
    <script src="NpcData.js"></script>
    <script src="JavaScript.js"></script>
    <script>
        function toggleDarkMode() {
            const select = document.querySelector('.top-right-select');
            if (select.value === 'dark') {
                document.body.classList.add('dark-mode');
            } else {
                document.body.classList.remove('dark-mode');
            }
        }

        document.addEventListener('contextmenu', function(e) {
            e.preventDefault();
        });
    </script>
</body>
</html>