This repository has been archived by the owner on May 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinline.html
69 lines (65 loc) · 1.46 KB
/
inline.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
<html>
<head>
<title>Clio Inline</title>
<meta content="">
<style>
html, body {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0;
margin: 0;
}
body {
display: flex;
align-items: center;
justify-content: center;
}
#container {
font-size: 4em;
text-align: center;
box-sizing: border-box;
}
.c1-c2 {
display: flex;
font-size: .5em;
align-items: center;
justify-content: center;
}
.c1-c2 > div {
padding: 1em;
}
</style>
</head>
<body>
<div id="container">
<div id="message"> Server uptime: </div>
<div id="counter"></div>
<div class="c1-c2">
<div>
Since page load:
<div id="c1"></div>
</div>
<div>
Countdown:
<div id="c2"></div>
</div>
</div>
</div>
<script type="text/clio">
import source counter from ws://localhost:3000
source:#data -> set_text '#counter'
0 -> counter => c1
0 -> counter => c2
c1:#data -> set_text '#c1'
c2:#data -> dec 1000000 @ -> set_text '#c2'
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
async function set_text(i, id) {
$(id).text(i);
}
</script>
<script src="clio.js"></script>
</body>
</html>