forked from ArchipelagoMW/Archipelago
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
530 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
window.addEventListener('load', () => { | ||
// Reload tracker every 15 seconds | ||
const url = window.location; | ||
setInterval(() => { | ||
const ajax = new XMLHttpRequest(); | ||
ajax.onreadystatechange = () => { | ||
if (ajax.readyState !== 4) { return; } | ||
|
||
// Create a fake DOM using the returned HTML | ||
const domParser = new DOMParser(); | ||
const fakeDOM = domParser.parseFromString(ajax.responseText, 'text/html'); | ||
|
||
// Update item tracker | ||
document.getElementById('inventory-table').innerHTML = fakeDOM.getElementById('inventory-table').innerHTML; | ||
// Update only counters in the location-table | ||
let counters = document.getElementsByClassName('counter'); | ||
const fakeCounters = fakeDOM.getElementsByClassName('counter'); | ||
for (let i = 0; i < counters.length; i++) { | ||
counters[i].innerHTML = fakeCounters[i].innerHTML; | ||
} | ||
}; | ||
ajax.open('GET', url); | ||
ajax.send(); | ||
}, 15000) | ||
|
||
// Collapsible advancement sections | ||
const categories = document.getElementsByClassName("location-category"); | ||
for (let i = 0; i < categories.length; i++) { | ||
let hide_id = categories[i].id.split('-')[0]; | ||
if (hide_id == 'Total') { | ||
continue; | ||
} | ||
categories[i].addEventListener('click', function() { | ||
// Toggle the advancement list | ||
document.getElementById(hide_id).classList.toggle("hide"); | ||
// Change text of the header | ||
const tab_header = document.getElementById(hide_id+'-header').children[0]; | ||
const orig_text = tab_header.innerHTML; | ||
let new_text; | ||
if (orig_text.includes("▼")) { | ||
new_text = orig_text.replace("▼", "▲"); | ||
} | ||
else { | ||
new_text = orig_text.replace("▲", "▼"); | ||
} | ||
tab_header.innerHTML = new_text; | ||
}); | ||
} | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#player-tracker-wrapper{ | ||
margin: 0; | ||
} | ||
|
||
#inventory-table{ | ||
border-top: 2px solid #000000; | ||
border-left: 2px solid #000000; | ||
border-right: 2px solid #000000; | ||
border-top-left-radius: 4px; | ||
border-top-right-radius: 4px; | ||
padding: 3px 3px 10px; | ||
width: 384px; | ||
background-color: #42b149; | ||
} | ||
|
||
#inventory-table td{ | ||
width: 40px; | ||
height: 40px; | ||
text-align: center; | ||
vertical-align: middle; | ||
} | ||
|
||
#inventory-table img{ | ||
height: 100%; | ||
max-width: 40px; | ||
max-height: 40px; | ||
filter: grayscale(100%) contrast(75%) brightness(30%); | ||
} | ||
|
||
#inventory-table img.acquired{ | ||
filter: none; | ||
} | ||
|
||
#inventory-table div.counted-item { | ||
position: relative; | ||
} | ||
|
||
#inventory-table div.item-count { | ||
position: absolute; | ||
color: white; | ||
font-family: "Minecraftia", monospace; | ||
font-weight: bold; | ||
bottom: 0; | ||
right: 0; | ||
} | ||
|
||
#location-table{ | ||
width: 384px; | ||
border-left: 2px solid #000000; | ||
border-right: 2px solid #000000; | ||
border-bottom: 2px solid #000000; | ||
border-bottom-left-radius: 4px; | ||
border-bottom-right-radius: 4px; | ||
background-color: #42b149; | ||
padding: 0 3px 3px; | ||
font-family: "Minecraftia", monospace; | ||
font-size: 14px; | ||
cursor: default; | ||
} | ||
|
||
#location-table th{ | ||
vertical-align: middle; | ||
text-align: left; | ||
padding-right: 10px; | ||
} | ||
|
||
#location-table td{ | ||
padding-top: 2px; | ||
padding-bottom: 2px; | ||
line-height: 20px; | ||
} | ||
|
||
#location-table td.counter { | ||
text-align: right; | ||
font-size: 14px; | ||
} | ||
|
||
#location-table td.toggle-arrow { | ||
text-align: right; | ||
} | ||
|
||
#location-table tr#Total-header { | ||
font-weight: bold; | ||
} | ||
|
||
#location-table img{ | ||
height: 100%; | ||
max-width: 30px; | ||
max-height: 30px; | ||
} | ||
|
||
#location-table tbody.locations { | ||
font-size: 12px; | ||
} | ||
|
||
#location-table td.location-name { | ||
padding-left: 16px; | ||
} | ||
|
||
.hide { | ||
display: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>The Infinity Gauntlet</title> | ||
<style> | ||
body { | ||
font-family: sans-serif; | ||
{#background-image: url("../../../static/static/backgrounds/wallpaper.jpg");#} | ||
background-size: cover; | ||
background-color: black; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
.container { | ||
min-height: 100vh; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
padding: 1rem; | ||
} | ||
|
||
h1 { | ||
width: 100%; | ||
color: white; | ||
text-align: center; | ||
} | ||
|
||
.items { | ||
width: 100%; | ||
display: flex; | ||
justify-content: space-around; | ||
gap: 1rem; | ||
flex-wrap: wrap; | ||
} | ||
|
||
img { | ||
filter: grayscale(1) drop-shadow(0px 0px 12px #000); | ||
} | ||
|
||
.acquired { | ||
filter: grayscale(0) drop-shadow(0px 0px 12px #000); | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<h1>Found Pieces:</h1> | ||
<div class="items"> | ||
<img | ||
src="{{ icons['Space Stone'] }}" | ||
class="{{ 'acquired' if 'Space Stone' in acquired_items }}" | ||
title="Space Stone" | ||
/> | ||
<img | ||
src="{{ icons['Mind Stone'] }}" | ||
class="{{ 'acquired' if 'Mind Stone' in acquired_items }}" | ||
title="Mind Stone" | ||
/> | ||
<img | ||
src="{{ icons['Reality Stone'] }}" | ||
class="{{ 'acquired' if 'Reality Stone' in acquired_items }}" | ||
title="Reality Stone" | ||
/> | ||
<img | ||
src="{{ icons['Power Stone'] }}" | ||
class="{{ 'acquired' if 'Power Stone' in acquired_items }}" | ||
title="Power Stone" | ||
/> | ||
<img | ||
src="{{ icons['Time Stone'] }}" | ||
class="{{ 'acquired' if 'Time Stone' in acquired_items }}" | ||
title="Time Stone" | ||
/> | ||
<img | ||
src="{{ icons['Soul Stone'] }}" | ||
class="{{ 'acquired' if 'Soul Stone' in acquired_items }}" | ||
title="Soul Stone" | ||
/> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.