4 <meta http-equiv="content-type" value="text/html; charset=utf-8" />
5 <meta charset="utf-8" />
6 <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
9 -webkit-box-sizing: border-box;
10 Box-Sizing: border-box;
11 -webkit-backface-visibility: hidden;
12 -webkit-transition: translate3d(0,0,0);
19 background: transparent;
21 -webkit-font-smoothing: antialiased !important;
24 font-family: 'Lato', sans-serif;
34 border-collapse: collapse;
36 border: 3px solid black;
40 border: 3px solid #008;
42 .team1color, .team2color {
66 /* Clock, to the right of score */
72 border-collapse: collapse;
74 border: 3px solid black;
77 border: 3px solid #008;
84 -webkit-transform:translateX(-200%);
86 .clockbug-animate-in {
87 -webkit-animation: from-left 1s ease;
89 .clockbug-animate-out {
90 -webkit-animation: to-left 1s ease;
91 -webkit-transform:translateX(-200%);
94 /* Comment, below score */
100 border-collapse: collapse;
102 border: 3px solid black;
105 border: 3px solid #008;
113 -webkit-transform:translateY(-40px);
115 .commentbug-animate-in {
116 -webkit-animation: from-top 0.5s ease;
118 .commentbug-animate-out {
119 -webkit-animation: to-top 0.5s ease;
120 -webkit-transform:translateY(-40px);
124 .lowerthird-headline {
129 border-collapse: collapse;
131 border: 2px solid #ccc;
135 /*background: linear-gradient(to right, #ccc, #fff 15px); */
136 background-image: url(lowerthird-bg.png);
138 /* padding-top: 20px; */
140 .lowerthird-headline-hidden {
144 .lowerthird-headline-animate-in {
145 -webkit-animation: scale-out 1.0s;
147 .lowerthird-headline-animate-out {
148 -webkit-animation: scale-in 1.0s;
150 .lowerthird-headline-content {
154 .lowerthird-headline-content-hidden {
155 clip: rect(0px,0px,200px,0px);
157 .lowerthird-headline-content-animate-in {
158 -webkit-animation: wipe-out 2.0s ease;
160 .lowerthird-headline-content-animate-out {
161 -webkit-animation: wipe-in 2.0s ease;
162 clip: rect(0px,0px,200px,0px);
164 .lowerthird-subheading {
171 border-collapse: collapse;
173 border: 1px solid black;
175 align-items: center; */
176 /*background: linear-gradient(to right, #44c, #33a 15px); */
177 background-image: url(lowerthird-bg2.png);
179 .lowerthird-subheading-hidden {
180 clip: rect(0px,0px,200px,0px);
182 .lowerthird-subheading-animate-in {
183 -webkit-animation: scale-out-small 1.6s ease;
185 .lowerthird-subheading-animate-out {
186 -webkit-animation: scale-in-small 1.6s ease;
190 .lowerthird-subheading-content {
194 .lowerthird-subheading-content-hidden {
198 .lowerthird-subheading-content-animate-in {
199 -webkit-animation: wipe-out 2.2s ease;
201 .lowerthird-subheading-content-animate-out {
202 -webkit-animation: wipe-in 2.2s ease;
203 clip: rect(0px,0px,200px,0px);
206 /* these are hidden when actually run in casparcg */
222 @-webkit-keyframes from-left {
224 -webkit-transform:translateX(-200%);
227 -webkit-transform:translateX(0);
230 @-webkit-keyframes to-left {
232 -webkit-transform:translateX(0);
235 -webkit-transform:translateX(-200%);
238 @-webkit-keyframes from-top {
240 -webkit-transform:translateY(-40px);
243 -webkit-transform:translateY(0);
246 @-webkit-keyframes to-top {
248 -webkit-transform:translateY(0);
251 -webkit-transform:translateY(-40px);
255 @-webkit-keyframes scale-out {
263 @-webkit-keyframes scale-in {
266 border: 2px solid #ccc;
270 border: 2px solid #ccc;
273 @-webkit-keyframes scale-out-small {
283 border: 1px solid black;
289 @-webkit-keyframes scale-in-small {
292 border: 1px solid black;
296 border: 1px solid black;
306 @-webkit-keyframes wipe-out {
308 clip: rect(0px,0px,200px,0px);
311 clip: rect(0px,0px,200px,0px);
314 clip: rect(0px,1050px,200px,0px);
317 @-webkit-keyframes wipe-in {
319 clip: rect(0px,1050px,200px,0px);
321 20% { /* Not symmetrical! */
322 clip: rect(0px,0px,200px,0px);
325 clip: rect(0px,0px,200px,0px);
331 <div id="area"></div>
332 <table class="scorebug">
334 <td class="team1color" id="team1color"></td>
335 <td class="team1" id="team1">PCL</td>
336 <td class="score" id="score">17 – 11</td>
337 <td class="team2" id="team2">NMBUI</td>
338 <td class="team2color" id="team2color"></td>
341 <table class="clockbug clockbug-hidden" id="clockbug">
343 <td class="clock" id="clock">25:00</td>
346 <table class="commentbug commentbug-hidden" id="commentbug">
348 <td class="comment" id="comment">Pagacap: First to 9 points</td>
351 <div class="lowerthird-headline lowerthird-headline-hidden" id="lowerthird-headline"><div class="lowerthird-headline-content lowerthird-headline-content-hidden" id="lowerthird-headline-content">
352 John Doe<br>Ola Nordmann
354 <div class="lowerthird-subheading lowerthird-subheading-hidden" id="lowerthird-subheading"><div class="lowerthird-subheading-content lowerthird-subheading-content-hidden" id="lowerthird-subheading-content">
355 Commentators, Trøndisk 2016
357 <div id="manualcontrols">
359 <a href="javascript:startclock()">start clock</a>
360 <a href="javascript:stopclock()">stop clock</a>
361 <a href="javascript:setclock(25*60)">reset clock</a>
362 <a href="javascript:showclock()">show clock</a>
363 <a href="javascript:hideclock()">hide clock</a>
366 <a href="javascript:goalA()">goal team A</a>
367 <a href="javascript:goalB()">goal team B</a>
368 <a href="javascript:ungoalA()">ungoal team A</a>
369 <a href="javascript:ungoalB()">ungoal team B</a>
370 <a href="javascript:resetscore()">reset score</a>
373 <a href="javascript:showcomment()">show comment</a>
374 <a href="javascript:hidecomment()">hide comment</a>
377 <a href="javascript:showlowerthird()">show lower third</a>
378 <a href="javascript:hidelowerthird()">hide lower third</a>
383 var clock_running = false;
384 var clock_visible = false;
385 var comment_visible = false;
386 var lowerthird_visible = false;
387 var clock_left = 25 * 60;
395 document.getElementById('team1').innerHTML = state['team1'];
396 document.getElementById('team2').innerHTML = state['team2'];
401 document.getElementById('team1color').style.backgroundColor = state['team1color'];
402 document.getElementById('team2color').style.backgroundColor = state['team2color'];
407 scoreA = state['score1'];
408 scoreB = state['score2'];
412 function startclock()
414 if (!clock_running) {
415 clock_origin = Date.now();
416 clock_running = true;
423 if (!clock_running) return;
424 clock_left = time_left();
425 clock_origin = Date.now();
426 clock_running = false;
429 function setclock(amount)
432 clock_origin = Date.now();
436 function setclockfromstate()
438 var amount = parseInt(state['clock_min']) * 60 + parseInt(state['clock_sec']);
444 if (clock_visible) return;
445 var clockbug = document.getElementById('clockbug');
446 clockbug.className = 'clockbug clockbug-animate-in';
447 clock_visible = true;
452 if (!clock_visible) return;
453 var clockbug = document.getElementById('clockbug');
454 clockbug.className = 'clockbug clockbug-animate-out';
455 clock_visible = false;
458 function setcomment()
460 document.getElementById('comment').innerHTML = state['comment'];
463 function showcomment()
465 if (comment_visible) return;
466 var commentbug = document.getElementById('commentbug');
467 commentbug.className = 'commentbug commentbug-animate-in';
468 comment_visible = true;
471 function hidecomment()
473 if (!comment_visible) return;
474 var commentbug = document.getElementById('commentbug');
475 commentbug.className = 'commentbug commentbug-animate-out';
476 comment_visible = false;
479 function showlowerthird()
481 if (lowerthird_visible) return;
483 // With no flexbox, this is how it has to be...
484 var f = document.getElementById('lowerthird-headline');
485 var g = document.getElementById('lowerthird-headline-content');
486 f.style.paddingTop = Math.round((f.clientHeight - g.clientHeight) / 2) + 'px';
488 f = document.getElementById('lowerthird-subheading');
489 g = document.getElementById('lowerthird-subheading-content');
490 f.style.paddingTop = Math.round((f.clientHeight - g.clientHeight) / 2) + 'px';
492 document.getElementById('lowerthird-headline').className = 'lowerthird-headline lowerthird-headline-animate-in';
493 document.getElementById('lowerthird-headline-content').className = 'lowerthird-headline-content lowerthird-headline-content-animate-in';
494 document.getElementById('lowerthird-subheading').className = 'lowerthird-subheading lowerthird-subheading-animate-in';
495 document.getElementById('lowerthird-subheading-content').className = 'lowerthird-subheading-content lowerthird-subheading-content-animate-in';
496 lowerthird_visible = true;
499 function setandshowlowerthird()
501 document.getElementById('lowerthird-headline-content').innerHTML = state['text1'];
502 document.getElementById('lowerthird-subheading-content').innerHTML = state['text2'];
506 function hidelowerthird()
508 if (!lowerthird_visible) return;
509 document.getElementById('lowerthird-headline').className = 'lowerthird-headline lowerthird-headline-hidden lowerthird-headline-animate-out';
510 document.getElementById('lowerthird-headline-content').className = 'lowerthird-headline-content lowerthird-headline-content-animate-out';
511 document.getElementById('lowerthird-subheading').className = 'lowerthird-subheading lowerthird-subheading-animate-out';
512 document.getElementById('lowerthird-subheading-content').className = 'lowerthird-subheading-content lowerthird-subheading-content-animate-out';
513 lowerthird_visible = false;
518 var elapsed = (Date.now() - clock_origin) * 1e-3;
519 if (elapsed > clock_left) return 0;
520 return Math.ceil(clock_left - elapsed);
523 function update_clock()
525 var left = time_left();
526 var min = Math.floor(left / 60);
529 if (sec < 10) sec = "0" + sec;
530 document.getElementById('clock').innerHTML = min + ":" + sec;
547 if (scoreA > 0) --scoreA;
553 if (scoreB > 0) --scoreB;
557 function resetscore()
563 function update_score()
565 document.getElementById('score').innerHTML = scoreA + " – " + scoreB;
568 /* called by caspar only */
571 document.getElementById('manualcontrols').style.display = 'none';
572 document.getElementById('area').style.display = 'none';
574 // Old CEF workaround
575 document.getElementById('lowerthird-subheading').style.top = '638px';
580 console.log('[[[' + v + ']]]');
581 var j = JSON.parse(v);
582 for(var key in j) state[key] = j[key];
585 setInterval(function() {