-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStatia4.html
175 lines (143 loc) · 4.01 KB
/
Statia4.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html>
<html lang="ro">
<meta charset="UTF-8">
<style>
html {
background-image: url("greybg.jpeg");
font-family: "Helvetica", cursive, sans-serif;
}
p {
align: center;
font-size: 1.5vw;
}
.column {
text-align: center;
}
#centerImg {
display:inline-block;
width: 500px;
height: 375px;
outline: darkgray;
outline-width: 10px;
}
#videoElement {
width: 500px;
height: 375px;
display:inline-block;
margin-left: 33%;
transform: translateX(-50%);
padding-bottom: 15px;
}
button {
background-color: whitesmoke; color: black;
padding: 10px;
text-align: center;
font-size: 1vw;
border-radius: 5px;
opacity: 1;
}
button:hover {
background: rgba(45,45,45,0.95);
color: white;
}
div.column {
background-color: whitesmoke;
opacity: 0.90;
border-radius: 5px;
}
h2 {
font-size:2vw;
text-align:center;
}
span {
background-color: whitesmoke;
opacity: 0.8;
border-radius: 5px;
padding: 2px;
}
form{
display: inline;
padding: 5px;
}
</style>
<head>
<title>Stația 4</title>
<h2><span> Stația 4 </span></h2>
</head>
<div class="row">
<div class="column">
<br>
<p id="demo"></p>
<div class="cointainer">
<form action="ServiceHTML.html">
<button type="submit">Înapoi la pagina principală</button><br><br><br>
</form>
<form action="Statia1.html">
<button id="statii" type="submit">Stația 1</button>
</form>
<form action="Statia2.html">
<button id="statii" type="submit">Stația 2</button>
</form>
<form action="Statia3.html">
<button id="statii" type="submit">Stația 3</button>
</form>
</div>
<br><br>
</div>
</div>
<br>
<video autoplay="true" id="videoElement"> </video>
<img src="statia4.png?" alt="Numar inmatriculare masina curenta" class="centerImg" id="re">
<br>
<script>
let parola4 = localStorage['parola4'];
let password4 = prompt('Introdu parola ' +parola4,"");
if(password4 !== null && parola4 === password4.toString())
alert('Bun venit');
else
{
window.location="ServiceHTML.html";
}
let video = document.querySelector("#videoElement");
if (navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true })
.then(function (stream) {
video.srcObject = stream;
})
.catch(function () {
console.log("Eroare la accesul camerei video");
});
}
let dataSalvata = parseInt(localStorage['dataSalvata']) || 0;
let distance = new Date();
// Update the count down every 1 second
setInterval(function ()
{
// Get today's date and time
let now = new Date();
// Find the distance between now and the count down date
distance = dataSalvata - now;
// Time calculations for days, hours, minutes and seconds
let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
let seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Output the result in an element with id="demo"
document.getElementById("demo").innerHTML = hours + "h "
+ minutes + "m " + seconds + "s ";
// If the count down is over, write some text
if (distance < 0) {
// clearInterval(x);
document.getElementById("demo").innerHTML = "Disponibilă";
}
}, 1000);
var reimg
window.onload=function () {
reimg=document.getElementById('re')
setInterval(function () {
reimg.src=reimg.src.replace(/\?.*/,function () {
return '?'+new Date()
})
},5000)
}
</script>
</html>