2022-09-08 17:48:53 +02:00
|
|
|
<!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>
|
2022-09-08 17:48:53 +02:00
|
|
|
|
|
|
|
<!-- 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">
|
2022-09-14 14:45:51 +02:00
|
|
|
#map { height: 600px; }
|
2022-09-14 18:09:13 +02:00
|
|
|
#below {
|
|
|
|
position: fixed;
|
|
|
|
bottom: 0px;
|
|
|
|
z-index: 10000;
|
|
|
|
background-color: white;
|
|
|
|
width: 100%;
|
|
|
|
}
|
2022-09-08 17:48:53 +02:00
|
|
|
</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>
|
2022-09-08 17:48:53 +02:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="map"></div><br/>
|
|
|
|
|
2022-09-14 18:09:13 +02:00
|
|
|
<div id="below">
|
2023-06-10 13:53:20 +02:00
|
|
|
<form id="state">
|
|
|
|
<input type="checkbox" id="shown" name="shown" onclick='sendState()' />
|
|
|
|
<label for="shown">Visible</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()' />
|
|
|
|
<label for="npc1">NPC Violet</label>
|
|
|
|
|
|
|
|
<input type="radio" id="npc2" name="npc" value=2 onclick='sendState()' />
|
|
|
|
<label for="npc2">NPC Vert</label>
|
|
|
|
|
|
|
|
<input type="radio" id="npc3" name="npc" value=3 onclick='sendState()' />
|
|
|
|
<label for="npc3">NPC Orange</label>
|
|
|
|
</form>
|
2022-09-14 18:09:13 +02:00
|
|
|
</div>
|
2022-09-08 17:48:53 +02:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2022-09-14 10:52:29 +02:00
|
|
|
// SETUP MAP
|
2022-09-08 17:48:53 +02:00
|
|
|
|
2022-09-14 10:52:29 +02:00
|
|
|
setup_map();
|
|
|
|
|
2022-09-08 17:48:53 +02:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// 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"}});
|
2022-09-14 10:52:29 +02:00
|
|
|
setup_socket_common();
|
2022-09-08 17:48:53 +02:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2023-06-10 09:46:04 +02:00
|
|
|
// SETTINGS -- State
|
2022-09-08 17:48:53 +02:00
|
|
|
|
2023-06-10 13:53:20 +02:00
|
|
|
var form = document.querySelector("#state");
|
|
|
|
function sendState(){
|
|
|
|
const data = new FormData(form);
|
|
|
|
var nState = {};
|
|
|
|
for(entry of data)
|
|
|
|
nState[entry[0]] = entry[1];
|
|
|
|
nState.shown = "shown" in nState;
|
|
|
|
nState.tracker = nState.npc == 0;
|
|
|
|
socket.emit('changeState', nState);
|
|
|
|
}
|
|
|
|
|
|
|
|
socket.on('newState', function(state){
|
|
|
|
document.querySelector("#shown").checked = state.shown;
|
|
|
|
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;
|
|
|
|
});
|
|
|
|
|
2022-09-08 17:48:53 +02:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// GEOLOCALISATION
|
|
|
|
|
2023-06-11 17:07:47 +02:00
|
|
|
if(%GPSLOG) setup_geoLoc();
|
2022-09-08 17:48:53 +02:00
|
|
|
</script>
|
|
|
|
</body>
|
2022-09-09 13:03:08 +02:00
|
|
|
</html>
|