Where people come together to learn, code, and play. Custom-built HTTP server, site generator, and website from scratch using no external libraries. Goal is to be as minimalistic and fun as possible. http://projectdivar.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
SigPlace/sitefiles/arcade.html

41 lines
1.2 KiB

$SITENAME
-SigPlace
===
<div class="gamenav">
<div class="game">DDR</div>
<div class="game">ITG</div>
<div class="game">Sound Voltex</div>
<div class="game">Pop'n Music</div>
<div class="game">Love Live</div>
</div>
<div id="arcade_content">
</div>
<br/><br/>
<script type="text/javascript">
function grabData(field,location){
fetch(location,{cache: "no-cache"}).then((data)=>data.text())
.then((data)=>{
var c = document.getElementById(field)
var split = data.split("\n")
var count=0;
for (var play of split) {
if (play!=="") {
var obj = JSON.parse(play)
c.innerHTML+=`<div id="${field}${count++}">${obj.game}: ${obj.rank} [${obj.difficulty}] ${obj.title} ${obj.score} (${obj.notes})</div>`
}
}
})
}
function recentPlays(){
var content = document.getElementById("arcade_content")
grabData("records","/RECORDS")
grabData("plays","/PLAYS")
content.innerHTML=`
<h2>Recent Records</h2>
<div id="records"></div>
<h2>Recent Plays</h2>
<div id="plays"></div>`
}
recentPlays()
</script>