-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
115 lines (87 loc) · 2.25 KB
/
index.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
<!doctype html>
<html lang="zh">
<head>
<title>o</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="http://unicorn-ui.com/buttons/css/buttons.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Crimson+Text" rel="stylesheet">
<style>
* { font-family: 'Crimson Text', serif; }
#buttons {
margin-top: 1em;
width: 100%%;
text-align: center;
}
#poemfield {
padding-top: 2em;
width: 100%%;
text-align: center;
}
#gitrev{
position: fixed;
bottom: 0.3em;
width: 100%%;
text-align: center;
}
@media screen and (max-width: 600px) {
#gitrev {
visibility: hidden;
clear: both;
display: none;
}
}
body {
font-size: 150%%;
}
p {
font-size: 1em;
}
h3 {
font-size: 1.3em;
}
aside {
font-size: 0.5em;
color: #999;
}
</style>
</head>
<body>
<div class="content" id='buttons'>
<button class="button button-rounded button-small" id="poem">p</button>
<button class="button button-rounded button-small" id="boem">b</button>
<button class="button button-rounded button-small" id="noem">n</button>
<button class="button button-rounded button-small" id="moem">m</button>
<button class="button button-rounded button-small" id="woem">w</button>
<button class="button button-rounded button-small" id="coem">c</button>
</div>
<div id='poemfield'>
</div>
<div id='gitrev'>
<aside>git revision: 77a0151 (18/09/2019)</aside>
</div>
<script type="text/javascript">
function add_gethook_to_button(buttonid, uri) {
var btn = document.getElementById(buttonid);
btn.addEventListener('click', function() {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
document.getElementById('poemfield').innerHTML = xmlHttp.responseText;
}
}
xmlHttp.open("GET", uri, true); // true for asynchronous
xmlHttp.send(null);
}, false);
}
document.addEventListener("DOMContentLoaded", function(event) {
add_gethook_to_button("poem", "p");
add_gethook_to_button("boem", "b");
add_gethook_to_button("noem", "n");
add_gethook_to_button("moem", "m");
add_gethook_to_button("woem", "w");
add_gethook_to_button("coem", "c");
});
</script>
</body>
</html>