record.html
2.41 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<title>Haptic Recording</title>
<link rel="stylesheet" href="{{url_for('static', filename = 'style.css')}}">
<style>
#stop, #home {
width:100px;
background-color: #f8585b;
border: none;
color:#fff;
padding: 15px 0;
border-radius:10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 20px;
margin: 4px;
cursor: pointer;
}
</style>
</head>
<body>
<div style="text-align: center; padding-top: 10%;">
<h1>Converting...</h1>
<h1 style="margin-top: 2%; color:#f8585b;"id="clock">00:00</h1>
<form method ="post" action="/stop">
<button style="margin-top: 10%;" id="stop" type="submit"> STOP </button>
</form>
<button style="margin-top: 10%; visibility: hidden;" id="home" type="button" onclick="location.href='/'"> HOME </button>
</div>
<script type="module" src="{{url_for('static', filename = 'app.js')}}"></script>
</body>
<script>
var clockTarget = document.getElementById("clock");
var seconds = 0;
var miliseconds = 0;
function clock() {
clockTarget .innerText = `${seconds < 10 ? `0${seconds }`: seconds }:${miliseconds < 10 ? `0${miliseconds }` :miliseconds}`;
miliseconds = miliseconds +1;
if(miliseconds >99){
seconds = seconds +1;
miliseconds = miliseconds %100;
}
}
var inter;
function init() {
clock();
inter = setInterval(clock, 10);
}
function stopit(){
clearInterval(inter);
document.getElementById("home").style.visibility="visible";
document.getElementById("stop").style.visibility="hidden";
}
document.getElementById('stop').addEventListener('click', stopit);
init();
</script>
</html>