-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgo.html
More file actions
125 lines (94 loc) · 2.3 KB
/
go.html
File metadata and controls
125 lines (94 loc) · 2.3 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<html>
<head>
<title>OpenBike</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" type="text/css">
<style>
body {
background-color: rgb(251, 174, 23);
font-family: 'Roboto', sans-serif;
}
h1 {
color: white;
text-align: center;
}
p {
font-size: 20px;
}
.button {
border-radius: 4px;
background-color: #235c66;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 28px;
padding: 20px;
width: 200px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
.fa {
font-weight: 300;
margin: 0;
padding: 0;
direction: ltr;
font-size: 10rem;
}
</style>
</head>
<body>
<div style="max-width: 600px; margin: 0px auto; text-align: center">
<h1 >UNLOCK YOUR BIKE</h1>
<p>
Unlock this bike?
</p>
<!-- This website is purely for mvp demonstration purposes, there is no authentication and therfor everybody is able to open the lock of the demonstration bicycle.
Do you like to help to improve openbike.nl further, please have a look at https://github.com/openbikeshare
-->
<p>
<button class="button" id="unlock"><span>Unlock </span></button>
</p>
<div class="content">
<i class="fa fa-lock" id="lock"></i>
</div>
</div>
<script>
document.getElementById('unlock').addEventListener('click', unlockBike);
function unlockBike(){
fetch('https://openbike.nl/api/lock/unlock')
.then(function (res) {
return res.json();
})
.then(function (data) {
if (data.openedSuccesfully === true) {
element = document.getElementById('lock');
element.classList.remove("fa-lock");
element.classList.add("fa-unlock");
}
});
}
</script>
</body>
</html>