traque/static/tracking/vieux.html

120 lines
5.2 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
2022-09-13 23:18:13 +02:00
<title>Traque | Client vieilleux</title>
<!-- LEAFLET INCLUDE -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css"
integrity="sha512-hoalWLoI8r4UszCkZ5kL8vayOGVae1oxXe/2A4AO6J9+580uKHDO3JdHb7NzwwzK5xr/Fs0W40kiNHxM9vyTtQ=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js"
integrity="sha512-BB3hKbKWOc9Ez/TAwyWxNXeoV9c1v6FIeYiBieIWkpLjauysF18NzgR1MBNBXf8/KABdlkX68nAhlwcDFLGPCQ=="
crossorigin=""></script>
<!-- SOCKET.IO INCLUDE -->
<script src="/socket.io/socket.io.js"></script>
<style type="text/css">
#map { height: 600px; }
2022-09-14 18:09:13 +02:00
#below {
position: fixed;
bottom: 0px;
z-index: 10000;
background-color: white;
width: 100%;
}
</style>
2022-09-14 10:52:29 +02:00
2023-06-10 09:46:04 +02:00
<script type="text/javascript" src="/utils.js"></script>
</head>
<body>
<div id="map"></div><br/>
2022-09-14 18:09:13 +02:00
<div id="below">
<form id="state">
2023-06-16 20:56:58 +02:00
<input type="checkbox" id="invisibility" name="invisibility" checked onclick='sendState()' />
<label for="invisibility">Invisible</label>
2023-06-13 18:17:33 +02:00
<input type="checkbox" id="blurred" name="blurred" onclick='sendState()' />
2023-06-16 20:56:58 +02:00
<label for="blurred">Brouillé</label></br>
<input type="radio" id="npc0" name="npc" value=0 onclick='sendState()' />
<label for="npc0">Traqueur</label>
<input type="radio" id="npc1" name="npc" value=1 checked onclick='sendState()' />
2023-09-11 17:44:18 +02:00
<label for="npc1"><img src="/icons/3.png" height=15px></label>
<input type="radio" id="npc2" name="npc" value=2 checked onclick='sendState()' />
<label for="npc2"><img src="/icons/4.png" height=15px></label>
<input type="radio" id="npc3" name="npc" value=3 checked onclick='sendState()' />
<label for="npc3"><img src="/icons/5.png" height=15px></label>
<input type="radio" id="npc4" name="npc" value=4 checked onclick='sendState()' />
<label for="npc4"><img src="/icons/6.png" height=15px></label>
<input type="radio" id="npc5" name="npc" value=5 checked onclick='sendState()' />
<label for="npc5"><img src="/icons/7.png" height=15px></label>
<input type="radio" id="npc6" name="npc" value=6 checked onclick='sendState()' />
<label for="npc6"><img src="/icons/8.png" height=15px></label>
<input type="radio" id="npc7" name="npc" value=7 checked onclick='sendState()' />
<label for="npc7"><img src="/icons/9.png" height=15px></label>
<input type="radio" id="npc8" name="npc" value=8 checked onclick='sendState()' />
<label for="npc8"><img src="/icons/10.png" height=15px></label>
<input type="radio" id="npc9" name="npc" value=9 checked onclick='sendState()' />
<label for="npc9"><img src="/icons/11.png" height=15px></label>
2023-09-11 21:14:52 +02:00
</form><br/>
<br/>
2023-09-13 12:04:56 +02:00
<a href="https://dgnum.eu"><img src="/dgnum-logo.png" height=50px /></a><br/>
2023-09-11 21:14:52 +02:00
<span style="font-size: 0.8em">Merci à la <a href="https://dgnum.eu">Délégation Générale NUMérique de l'ENS</a>, qui héberge ce site.</span>
2022-09-14 18:09:13 +02:00
</div>
<script type="text/javascript">
//////////////////////////////////////////////////////////////////////////////
2022-09-14 10:52:29 +02:00
// SETUP MAP
2022-09-14 10:52:29 +02:00
setup_map();
//////////////////////////////////////////////////////////////////////////////
// UPDATE MAP
2023-06-10 09:46:04 +02:00
id = "%ID"; // %ID will be replaced by the real id.
socket = io({rejectUnauthorized: false, auth: {id: id, type:"vieux"}});
2023-09-06 18:13:40 +02:00
setup_socket_common();
//////////////////////////////////////////////////////////////////////////////
2023-06-10 09:46:04 +02:00
// SETTINGS -- State
var form = document.querySelector("#state");
function sendState(){
const data = new FormData(form);
var nState = {};
for(entry of data)
nState[entry[0]] = entry[1];
2023-06-16 20:56:58 +02:00
nState.invisibility = "invisibility" in nState;
2023-06-13 18:17:33 +02:00
nState.blurred = "blurred" in nState;
nState.tracker = nState.npc == 0;
socket.emit('changeState', nState);
}
socket.on('newState', function(state){
2023-06-16 20:56:58 +02:00
document.querySelector("#invisibility").checked = state.invisibility;
2023-06-13 18:17:33 +02:00
document.querySelector("#blurred").checked = state.blurred;
document.querySelector("#npc0").checked = state.npc == 0;
document.querySelector("#npc1").checked = state.npc == 1;
document.querySelector("#npc2").checked = state.npc == 2;
document.querySelector("#npc3").checked = state.npc == 3;
2023-09-11 17:44:18 +02:00
document.querySelector("#npc4").checked = state.npc == 4;
document.querySelector("#npc5").checked = state.npc == 5;
document.querySelector("#npc6").checked = state.npc == 6;
document.querySelector("#npc7").checked = state.npc == 7;
document.querySelector("#npc8").checked = state.npc == 8;
document.querySelector("#npc9").checked = state.npc == 9;
});
//////////////////////////////////////////////////////////////////////////////
// GEOLOCALISATION
if(%GPSLOG) setup_geoLoc();
</script>
</body>
2022-09-09 13:03:08 +02:00
</html>