-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.html
149 lines (143 loc) · 5.57 KB
/
main.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" ; charset="UTF-8">
<title>AtCoderじゃんけん</title>
<link rel="stylesheet" type="text/css" href="static/css/style.css">
<link rel="stylesheet" href="static/css/bootstrap.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.2/css/all.css"
integrity="sha384-/rXc/GQVaYpyDdyxK+ecHPVYJSN9bmVFBvjA/9eOB+pb3F2w2N6fc5qB9Ew5yIns" crossorigin="anonymous">
<script src="static/js/jquery-3.3.1.min.js"></script>
</head>
<body class="bg-light">
<nav class="navbar navbar-dark bg-dark fixed-top d-block">
<div>
<a href="https://atcoder-janken.appspot.com" id="future-link" class="navbar-brand">AtCoderじゃんけん</a>
<a href="https://github.com/nomikura/atcoder-janken" target="_blank" id="about-link" class="navbar-brand"><i
class="fab fa-github"></i> GitHub</a>
</div>
</nav>
<div id="main-form">
<form>
<div class="form-row">
<div class="form-group col-md-6">
<label for="id1">Player 1</label>
<input type="text" class="form-control" name="id1" id="id1" placeholder="player1" value="{{ .ID1 }}">
</div>
<div class="form-group col-md-6">
<label for="id2">Player 2</label>
<input type="text" class="form-control" name="id2" id="id2" placeholder="player2" value="{{ .ID2 }}">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="id1">開始</label>
<input type="month" class="form-control" name="date_start" id="date_start" value="{{ .Date_start }}">
</div>
<div class="form-group col-md-6">
<label for="id2">終了</label>
<input type="month" class="form-control" name="date_end" id="date_end" value="{{ .Date_end }}">
</div>
</div>
<div class="form-check mb-1">
<input class="form-check-input" type="checkbox" value="1" id="abc" name="abc">
<label class="form-check-label" for="abc">
AtCoder Beginner Contest
</label>
</div>
<div class="form-check mb-1">
<input class="form-check-input" type="checkbox" value="1" id="arc" name="arc">
<label class="form-check-label" for="arc">
AtCoder Regular Contest
</label>
</div>
<div class="form-check mb-1">
<input class="form-check-input" type="checkbox" value="1" id="agc" name="agc">
<label class="form-check-label" for="agc">
AtCoder Grand Contest
</label>
</div>
<div class="form-check mb-1">
<input class="form-check-input" type="checkbox" value="1" id="other" name="other">
<label class="form-check-label" for="other">
その他のコンテスト
</label>
</div>
<button type="submit" class="btn btn-primary">じゃんけん!</button>
</form>
</div>
<span class="d-none" id="abc-v">{{ .ABC }}</span>
<span class="d-none" id="arc-v">{{ .ARC }}</span>
<span class="d-none" id="agc-v">{{ .AGC }}</span>
<span class="d-none" id="other-v">{{ .Other }}</span>
<span class="d-none" id="start">{{ .ID1 }}{{ .ID2 }}</span>
<div class="card mt-3">
<div class="card-body h5 text-center" id="result">
{{ .ResultHTML }}
<a href="https://twitter.com/share?ref_src=twsrc%5Etfw" class="twitter-share-button" data-text={{ .Result }}
data-show-count="false">Tweet</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
<div>
<table class="table">
<thead>
<tr>
<th scope="col">{{ .ID1 }} (順位)</th>
<th scope="col">Contest</th>
<th scope="col">{{ .ID2 }} (順位)</th>
</tr>
</thead>
<tbody>
{{ range .Results }}
<tr>
<td bgcolor={{ .BackGroundColor1 }}>{{ .Place1 }}</td>
<td bgcolor="white">{{ .Title }}</td>
<td bgcolor={{ .BackGroundColor2 }}>{{ .Place2 }}</td>
</tr>
{{ end }}
</tbody>
</table>
</div>
</body>
<script type="text/javascript">
var today = new Date();
var date_txt = today.getFullYear() + '-' + ("0" + (today.getMonth() + 1)).slice(-2);
var is_default = true;
$(document).ready(function () {
var date_start = $("#date_start").val();
var date_end = $("#date_end").val();
if (date_start == "") {
$("#date_start").val("2010-01");
}
if (date_end == "") {
$("#date_end").val(date_txt);
}
if ($("#abc-v").text()) {
$("#abc").prop("checked", true);
is_default = false;
}
if ($("#arc-v").text()) {
$("#arc").prop("checked", true);
is_default = false;
}
if ($("#agc-v").text()) {
$("#agc").prop("checked", true);
is_default = false;
}
if ($("#other-v").text()) {
$("#other").prop("checked", true);
is_default = false;
}
if (is_default) {
$("#abc").prop("checked", true);
$("#arc").prop("checked", true);
$("#agc").prop("checked", true);
$("#other").prop("checked", true);
}
if($("#start").text() == ""){
$("#result").text("プレイヤーIDを入力してください...")
}
});
</script>
</html>