forked from NeilVdB/ThomasMoreCiscoLighthouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
explore.html
106 lines (92 loc) · 3.66 KB
/
explore.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flexboxgrid/6.3.1/flexboxgrid.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Cabin:400,500,600,700">
<title>Explore</title>
</head>
<body>
<a href="index.html">
<div class="terug">
Back
</div>
</a>
<div class="row justify-content-center">
<div class="col-9">
<h3 class="center title-padding">Want to see the world with your vote ?</h3>
<h4 class="center text-muted">Does your vote really matter?</h4>
<div class="row">
<div class="col-6">
<a href="wip.html"><button type="button" class="btn btn-vote btn-primary btn-geel btn-lg btn-block">
<img src="images/cdh.svg" width="150px"></button>
</a>
</div>
<div class="col-6">
<a href="wip.html"><button type="button" class="btn btn-vote btn-primary btn-oranje btn-lg btn-block">
<img src="images/ps.png"></button></a>
</div>
<div class="col-6">
<a href="wip.html"><button type="button" class="btn btn-vote btn-primary btn-groen btn-lg btn-block">
<img src="images/ecolo.png" height="75px">
</button>
</a>
</div>
<div class="col-6 flex">
<a href="wip.html">
<button type="button" class="btn btn-vote btn-primary btn-blauw btn-lg btn-block">
<img src="images/mr.jpg">
</button>
</a>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
var run = true;
function readcontrollers(){
if (!run){
return;
}
var input = getRemote("/cgi-bin/test.py");
input = input.replace(/'/g, '"');
input = input.replace(/True/g, 1);
input = input.replace(/False/g, 2);
console.log(input.trim());
var obj = JSON.parse(input.trim());
if (obj[0].red == 1){
navigatie("index.html");
} else if (obj[0].blue == 1){
navigatie("wip.html");
}else if (obj[0].orange == 1){
navigatie("wip.html");
}else if (obj[0].green == 1){
navigatie("wip.html");
}else if (obj[0].yellow == 1){
navigatie("wip.html");
}
}
function getRemote(remote_url) {
return $.ajax({
type: "GET",
url: remote_url,
async: false
}).responseText;
}
function navigatie(url) {
run = false;
window.location.href = url;
}
$(document).ready(function() {
setTimeout(function () {
setInterval(function(){ readcontrollers(); }, 500);
})
}, 2000);
</script>
</body>
</html>