task.hbs 3.55 KB
Newer Older
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
<!DOCTYPE html>
<html lang="de">
  <head>
    <meta charset="utf-8">
<style>
body{
margin: 0px;
font-family:sans-serif;
}


#bar, #bar>div {
display:inline-block;
padding: 8px;
margin:0px;
background: #84bd00;
color:white;
font-size:14pt;
height: 40px;
overflow-y:hidden;
}

#bar {
display:block;
padding:0px;
}

28
#bar>.nav {
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
float:right;
}
#bar>#time {
float:right;
padding:0px 8px;
text-align:right;
}
#timetext{
padding:0px;
margin:0px;
font-size:10pt;
}
#timetime{
padding:0px;
margin:0px;
margin-top:-2px;
font-size:18pt;
}
#ttsec {
font-size:10pt;
}

#bar>#hamburger, #bar>#menu, #bar>#time {
background: #608a00;
font-weight:bold;
}

#bar>div.highlight {
background: #f4f9e8;
color:black;
}

iframe {
width: 100vw;border: 0px;height: calc(100vh - 45px);
}
64
65
66
67
68

a {
color: #ddd;
text-decoration: none;
}
69
70
71
72
73
74
</style>
</head><body style="">

<div id="bar">

<div id="menu">
75
<a href="/contest/{{contestid}}">{{contestname}}</a>
76
77
78
79
</div>
<div>
{{name}}
</div>
80
81
82
83
84
85
86
87
88
89
90
91

{{#each subtasks}}
  {{#if active}}
    <div class="highlight">
      {{linktext}}
    </div>
  {{else}}
    <div>
      <a href="/task/{{id}}">{{linktext}}</a>
   </div>
  {{/if}}
{{/each}}
92

93
{{#if duration}}
94
95
96
97
98
<div id="time">
<div id="timetext">
Verbleibende Zeit
</div>
<div id="timetime">
Robert Czechowski's avatar
Robert Czechowski committed
99
{{time_left}}<span id="ttsec">{{time_left_sec}}</span>
100
</div>
101
<script>
Robert Czechowski's avatar
Robert Czechowski committed
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
  var seconds_left_at_start = {{seconds_left}};
  var timerStart = Date.now();

  function lz(a) {
    var b = a.toString();
    if (b.length < 2) {
      return "0" + b;
    }
    return b;
  }
  
  function updateTimer() {
    var seconds_passed = (Date.now() - timerStart) / 1000;
    var seconds_left = seconds_left_at_start - seconds_passed;

    var hour = seconds_left / 3600 | 0;
    var min = seconds_left / 60 | 0 % 60 | 0;
    var sec = seconds_left % 60 | 0;

    text = hour.toString() + ":" + lz(min) + "<span id=\"ttsec\">:" + lz(sec) + "</span>";
    document.getElementById("timetime").innerHTML = text;
  }
  
  setInterval(updateTimer, 300);
126
</script>
127
</div>
128
{{/if}}
129

130
<div class="nav">
131
<a href="/contest/{{contestid}}">🡅 Übersicht</a>
132
</div>
133
{{#if nexttask}}
134
<div class="nav">
135
<a href="{{ nexttask }}">🡆</a>
136
</div>
137
138
{{/if}}
{{#if prevtask}}}
139
<div class="nav">
140
<a href="{{ prevtask }}">🡄</a>
141
</div>
142
{{/if}}
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
<script>

function enterFullscreen(element) {
  if(element.requestFullscreen) {
    element.requestFullscreen();
  } else if(element.mozRequestFullScreen) {
    element.mozRequestFullScreen();
  } else if(element.msRequestFullscreen) {
    element.msRequestFullscreen();
  } else if(element.webkitRequestFullscreen) {
    element.webkitRequestFullscreen();
  }
}
function exitFullscreen() {
  if(document.exitFullscreen) {
    document.exitFullscreen();
  } else if(document.mozCancelFullScreen) {
    document.mozCancelFullScreen();
  } else if(document.webkitExitFullscreen) {
    document.webkitExitFullscreen();
  }
}
var fullscreen = false;
function toggleFullscreen(element) {
if (fullscreen) {
  exitFullscreen();
169
170
171
fullscreen = false;
    document.getElementById("tgfs").innerText = "";
}
172
173
174
else {
  enterFullscreen(element);
  fullscreen = true;
175
    document.getElementById("tgfs").innerText = "";
176
177
178
  }
}
</script>
179
180
<div class="nav" onclick="toggleFullscreen(document.documentElement);">
<a href="javascript:;"><span id="tgfs"></span> Vollbild</a>
181
182
183
184
185
</div>

</div>
</div>

186
<iframe src="/{{taskpath}}#taskid={{taskid}}&csrftoken={{csrftoken}}" name="taskframe">Leider unterstützt ihr Browser keine Frames. Sie können die Aufgabe auch manuell aufrufen: <a href="/{{taskpath}}#taskid={{taskid}}&csrftoken={{csrftoken}}">Aufgabe manuell bearbeiten</a>.</iframe>
187
188
189
</body></html>


190
191