<!DOCTYPE html>
<html lang="en">
<head>
    <title>{{ player_name }}&apos;s Tracker</title>
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles/timespinnerTracker.css') }}"/>
    <script type="application/ecmascript" src="{{ url_for('static', filename='assets/timespinnerTracker.js') }}"></script>
</head>

<body>
    {# TODO: Replace this with a proper wrapper for each tracker when developing TrackerAPI. #}
    <div style="margin-bottom: 0.5rem">
        <a href="{{ url_for("get_generic_game_tracker", tracker=room.tracker, tracked_team=team, tracked_player=player) }}">Switch To Generic Tracker</a>
    </div>

    <div id="player-tracker-wrapper" data-tracker="{{ room.tracker|suuid }}">
        <div id="inventory-table">
            <div class="table-row">
                <div class="C1"><img src="{{ icons['Timespinner Wheel'] }}" class="{{ 'acquired' if 'Timespinner Wheel' in acquired_items }}" title="Timespinner Wheel" /></div>
                <div class="C2"><img src="{{ icons['Timespinner Spindle'] }}" class="{{ 'acquired' if 'Timespinner Spindle' in acquired_items }}" title="Timespinner Spindle" /></div>
                <div class="C3"><img src="{{ icons['Timespinner Gear 1'] }}" class="{{ 'acquired' if 'Timespinner Gear 1' in acquired_items }}" title="Timespinner Gear 1" /></div>
                <div class="C4"><img src="{{ icons['Timespinner Gear 2'] }}" class="{{ 'acquired' if 'Timespinner Gear 2' in acquired_items }}" title="Timespinner Gear 2" /></div>
                <div class="C5"><img src="{{ icons['Timespinner Gear 3'] }}" class="{{ 'acquired' if 'Timespinner Gear 3' in acquired_items }}" title="Timespinner Gear 3" /></div>
            </div>
            <div class="table-row">
                <div class="C1"><img src="{{ icons['Talaria Attachment'] }}" class="{{ 'acquired' if 'Talaria Attachment' in acquired_items or 'QuickSeed' in options }}" title="Talaria Attachment" /></div>
                <div class="C2"><img src="{{ icons['Succubus Hairpin'] }}" class="{{ 'acquired' if 'Succubus Hairpin' in acquired_items }}" title="Succubus Hairpin" /></div>
                <div class="C3"><img src="{{ icons['Lightwall'] }}" class="{{ 'acquired' if 'Lightwall' in acquired_items }}" title="Lightwall" /></div>
                <div class="C4"><img src="{{ icons['Celestial Sash'] }}" class="{{ 'acquired' if 'Celestial Sash' in acquired_items }}" title="Celestial Sash" /></div>
                <div class="C5">
                    <div class="image-stack">
                        <div class="stack-back">
                            <img src="{{ icons['Twin Pyramid Key'] }}" class="{{ 'acquired' if 'Twin Pyramid Key' in acquired_items or 'UnchainedKeys' in options }}" title="Twin Pyramid Key" />
                        </div>
                        <div class="stack-front">
                    {% if 'UnchainedKeys' in options %}
                        {% if 'EnterSandman' in options %}
                            <div class="stack-top-right">
                                <img src="{{ icons['Twin Pyramid Key'] }}" class="green {{ 'acquired' if 'Mysterious Warp Beacon' in acquired_items }}" title="Mysterious Warp Beacon" />
                            </div>
                        {% endif %}
                            <div class="stack-bottum-left">
                                <img src="{{ icons['Twin Pyramid Key'] }}" class="cyan {{ 'acquired' if 'Timeworn Warp Beacon' in acquired_items }}" title="Timeworn Warp Beacon" />
                            </div>
                            <div class="stack-bottum-right">
                                <img src="{{ icons['Twin Pyramid Key'] }}" class="purple {{ 'acquired' if 'Modern Warp Beacon' in acquired_items }}" title="Modern Warp Beacon" />
                            </div>
                    {% endif %}
                        </div>
                    </div>
                </div>
            </div>
            <div class="table-row">
                <div class="C1"><img src="{{ icons['Security Keycard A'] }}" class="{{ 'acquired' if 'Security Keycard A' in acquired_items }}" title="Security Keycard A" /></div>
                <div class="C2"><img src="{{ icons['Security Keycard B'] }}" class="{{ 'acquired' if 'Security Keycard B' in acquired_items }}" title="Security Keycard B" /></div>
                <div class="C3"><img src="{{ icons['Security Keycard C'] }}" class="{{ 'acquired' if 'Security Keycard C' in acquired_items }}" title="Security Keycard C" /></div>
                <div class="C4"><img src="{{ icons['Security Keycard D'] }}" class="{{ 'acquired' if 'Security Keycard D' in acquired_items }}" title="Security Keycard D" /></div>
            {% if 'DownloadableItems' in options %}
                <div class="C5"><img src="{{ icons['Library Keycard V'] }}" class="{{ 'acquired' if 'Library Keycard V' in acquired_items }}" title="Library Keycard V" /></div>
            {% endif %}
            </div>
            <div class="table-row">
            {% if 'DownloadableItems' in options %}
                <div class="C1"><img src="{{ icons['Tablet'] }}" class="{{ 'acquired' if 'Tablet' in acquired_items }}" title="Tablet" /></div>
            {% endif %}
                <div class="C2"><img src="{{ icons['Elevator Keycard'] }}" class="{{ 'acquired' if 'Elevator Keycard' in acquired_items }}" title="Elevator Keycard" /></div>
            {% if 'EyeSpy' in options %}
                <div class="C3"><img src="{{ icons['Oculus Ring'] }}" class="{{ 'acquired' if 'Oculus Ring' in acquired_items }}" title="Oculus Ring" /></div>
            {% endif %}
                <div class="C4"><img src="{{ icons['Water Mask'] }}" class="{{ 'acquired' if 'Water Mask' in acquired_items }}" title="Water Mask" /></div>
                <div class="C5"><img src="{{ icons['Gas Mask'] }}" class="{{ 'acquired' if 'Gas Mask' in acquired_items }}" title="Gas Mask" /></div>
            </div>
            <div class="table-row">
            {% if 'GyreArchives' in options %}
                <div class="C1"><img src="{{ icons['Kobo'] }}" class="{{ 'acquired' if 'Kobo' in acquired_items }}" title="Kobo" /></div>
                <div class="C2"><img src="{{ icons['Merchant Crow'] }}" class="{{ 'acquired' if 'Merchant Crow' in acquired_items }}" title="Merchant Crow" /></div>
            {% endif %}
                <div class="C3">
                {% if 'Djinn Inferno' in acquired_items %}
                    <img src="{{ icons['Djinn Inferno'] }}" class="acquired" title="Djinn Inferno" />
                {% elif 'Pyro Ring' in acquired_items %}
                    <img src="{{ icons['Pyro Ring'] }}" class="acquired" title="Pyro Ring" />
                {% elif 'Fire Orb' in acquired_items %}
                    <img src="{{ icons['Fire Orb'] }}" class="acquired" title="Fire Orb" />
                {% elif 'Infernal Flames' in acquired_items %}
                    <img src="{{ icons['Infernal Flames'] }}" class="acquired" title="Infernal Flames" />
                {% else %}
                    <img src="{{ icons['Djinn Inferno'] }}" title="Djinn Inferno" />
                {% endif %}
                </div>
                <div class="C4">
                {% if 'Royal Ring' in acquired_items %}
                    <img src="{{ icons['Royal Ring'] }}" class="acquired" title="Royal Ring" />
                {% elif 'Plasma Geyser' in acquired_items %}
                    <img src="{{ icons['Plasma Geyser'] }}" class="acquired" title="Plasma Geyser" />
                {% elif 'Plasma Orb' in acquired_items %}
                    <img src="{{ icons['Plasma Orb'] }}" class="acquired" title="Plasma Orb" />
                {% else %}
                    <img src="{{ icons['Royal Ring'] }}" title="Royal Ring" />
                {% endif %}
                </div>
            </div>
            {% if 'PrismBreak' in options or 'LockKeyAmadeus' in options or 'GateKeep' in options %}
            <div class="table-row">
                {% if 'PrismBreak' in options %}
                <div class="C1">
                    <div class="image-stack">
                        <div class="stack-front">
                            <div class="stack-top-left">
                                <img src="{{ icons['Laser Access'] }}" class="hotpink {{ 'acquired' if 'Laser Access A' in acquired_items }}" title="Laser Access A" />
                            </div>
                            <div class="stack-top-right">
                                <img src="{{ icons['Laser Access'] }}" class="lightsalmon {{ 'acquired' if 'Laser Access I' in acquired_items }}" title="Laser Access I" />
                            </div>
                            <div class="stack-bottum-left">
                                <img src="{{ icons['Laser Access'] }}" class="crimson {{ 'acquired' if 'Laser Access M' in acquired_items }}" title="Laser Access M" />
                            </div>
                        </div>
                    </div>
		</div>
                {% endif %}
                {% if 'LockKeyAmadeus' in options %}
                <div class="C2">
                    <div class="image-stack">
                        <div class="stack-front">
                            <div class="stack-top-left">
                                <img src="{{ icons['Lab Glasses'] }}" class="{{ 'acquired' if 'Lab Access Genza' in acquired_items }}" title="Lab Access Genza" />
                            </div>
                            <div class="stack-top-right">
                                <img src="{{ icons['Eye Orb'] }}" class="{{ 'acquired' if 'Lab Access Dynamo' in acquired_items }}" title="Lab Access Dynamo" />
                            </div>
                            <div class="stack-bottum-left">
                                <img src="{{ icons['Lab Coat'] }}" class="{{ 'acquired' if 'Lab Access Research' in acquired_items }}" title="Lab Access Research" />
                            </div>
                            <div class="stack-bottum-right">
                                <img src="{{ icons['Demon'] }}" class="{{ 'acquired' if 'Lab Access Experiment' in acquired_items }}" title="Lab Access Experiment" />
                            </div>
                        </div>
                    </div>
		</div>
                {% endif %}
                {% if 'GateKeep' in options %}
                <div class="C3">
                    <span class="{{ 'acquired' if 'Drawbridge Key' in acquired_items }}" title="Drawbridge Key">&#10070;</span>
		</div>
                {% endif %}
	    </div>
            {% endif %}
        </div>

        <table id="location-table">
            {% for area in checks_done %}
            <tr class="location-category" id="{{area}}-header">
                <td>{{ area }} {{'▼' if area != 'Total'}}</td>
                <td class="counter">{{ checks_done[area] }} / {{ checks_in_area[area] }}</td>
            </tr>
            <tbody class="locations hide" id="{{area}}">
                {% for location in location_info[area] %}
                <tr>
                    <td class="location-name">{{ location }}</td>
                    <td class="counter">{{ '✔' if location_info[area][location] else '' }}</td>
                </tr>
                {% endfor %}
            </tbody>
            {% endfor %}
        </table>
    </div>
</body>
</html>
