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 {
145 .lowerthird-headline-animate-in {
146 -webkit-animation: scale-out 1.0s;
148 .lowerthird-headline-animate-out {
149 -webkit-animation: scale-in 1.0s;
151 .lowerthird-headline-content {
155 .lowerthird-headline-content-hidden {
156 clip: rect(0px,0px,200px,0px);
158 .lowerthird-headline-content-animate-in {
159 -webkit-animation: wipe-out 2.0s ease;
161 .lowerthird-headline-content-animate-out {
162 -webkit-animation: wipe-in 2.0s ease;
163 clip: rect(0px,0px,200px,0px);
165 .lowerthird-subheading {
172 border-collapse: collapse;
174 border: 1px solid black;
176 align-items: center; */
177 /*background: linear-gradient(to right, #44c, #33a 15px); */
178 background-image: url(lowerthird-bg2.png);
180 .lowerthird-subheading-hidden {
181 clip: rect(0px,0px,200px,0px);
183 .lowerthird-subheading-animate-in {
184 -webkit-animation: scale-out-small 1.6s ease;
186 .lowerthird-subheading-animate-out {
187 -webkit-animation: scale-in-small 1.6s ease;
191 .lowerthird-subheading-content {
195 .lowerthird-subheading-content-hidden {
199 .lowerthird-subheading-content-animate-in {
200 -webkit-animation: wipe-out 2.2s ease;
202 .lowerthird-subheading-content-animate-out {
203 -webkit-animation: wipe-in 2.2s ease;
204 clip: rect(0px,0px,200px,0px);
207 /* these are hidden when actually run in casparcg */
223 @-webkit-keyframes from-left {
225 -webkit-transform:translateX(-200%);
228 -webkit-transform:translateX(0);
231 @-webkit-keyframes to-left {
233 -webkit-transform:translateX(0);
236 -webkit-transform:translateX(-200%);
239 @-webkit-keyframes from-top {
241 -webkit-transform:translateY(-40px);
244 -webkit-transform:translateY(0);
247 @-webkit-keyframes to-top {
249 -webkit-transform:translateY(0);
252 -webkit-transform:translateY(-40px);
256 @-webkit-keyframes scale-out {
264 @-webkit-keyframes scale-in {
267 border: 2px solid #ccc;
271 border: 2px solid #ccc;
274 @-webkit-keyframes scale-out-small {
284 border: 1px solid black;
290 @-webkit-keyframes scale-in-small {
293 border: 1px solid black;
297 border: 1px solid black;
307 @-webkit-keyframes wipe-out {
309 clip: rect(0px,0px,200px,0px);
312 clip: rect(0px,0px,200px,0px);
315 clip: rect(0px,1050px,200px,0px);
318 @-webkit-keyframes wipe-in {
320 clip: rect(0px,1050px,200px,0px);
322 20% { /* Not symmetrical! */
323 clip: rect(0px,0px,200px,0px);
326 clip: rect(0px,0px,200px,0px);
332 <div id="area"></div>
333 <table class="scorebug">
335 <td class="team1color" id="team1color"></td>
336 <td class="team1" id="team1">PCL</td>
337 <td class="score" id="score">17 – 11</td>
338 <td class="team2" id="team2">NMBUI</td>
339 <td class="team2color" id="team2color"></td>
342 <table class="clockbug clockbug-hidden" id="clockbug">
344 <td class="clock" id="clock">25:00</td>
347 <table class="commentbug commentbug-hidden" id="commentbug">
349 <td class="comment" id="comment">Pagacap: First to 9 points</td>
352 <div class="lowerthird-headline lowerthird-headline-hidden" id="lowerthird-headline"><div class="lowerthird-headline-content lowerthird-headline-content-hidden" id="lowerthird-headline-content">
353 John Doe<br>Ola Nordmann
355 <div class="lowerthird-subheading lowerthird-subheading-hidden" id="lowerthird-subheading"><div class="lowerthird-subheading-content lowerthird-subheading-content-hidden" id="lowerthird-subheading-content">
356 Commentators, Trøndisk 2016
358 <div id="manualcontrols">
360 <a href="javascript:startclock()">start clock</a>
361 <a href="javascript:stopclock()">stop clock</a>
362 <a href="javascript:setclock(25*60)">reset clock</a>
363 <a href="javascript:showclock()">show clock</a>
364 <a href="javascript:hideclock()">hide clock</a>
367 <a href="javascript:goalA()">goal team A</a>
368 <a href="javascript:goalB()">goal team B</a>
369 <a href="javascript:ungoalA()">ungoal team A</a>
370 <a href="javascript:ungoalB()">ungoal team B</a>
371 <a href="javascript:resetscore()">reset score</a>
374 <a href="javascript:showcomment()">show comment</a>
375 <a href="javascript:hidecomment()">hide comment</a>
378 <a href="javascript:showlowerthird()">show lower third</a>
379 <a href="javascript:hidelowerthird()">hide lower third</a>
384 var clock_running = false;
385 var clock_visible = false;
386 var comment_visible = false;
387 var lowerthird_visible = false;
388 var clock_left = 25 * 60;
396 document.getElementById('team1').innerHTML = state['team1'];
397 document.getElementById('team2').innerHTML = state['team2'];
402 document.getElementById('team1color').style.backgroundColor = state['team1color'];
403 document.getElementById('team2color').style.backgroundColor = state['team2color'];
408 scoreA = state['score1'];
409 scoreB = state['score2'];
413 function startclock()
415 if (!clock_running) {
416 clock_origin = Date.now();
417 clock_running = true;
424 if (!clock_running) return;
425 clock_left = time_left();
426 clock_origin = Date.now();
427 clock_running = false;
430 function setclock(amount)
433 clock_origin = Date.now();
437 function setclockfromstate()
439 var amount = parseInt(state['clock_min']) * 60 + parseInt(state['clock_sec']);
445 if (clock_visible) return;
446 var clockbug = document.getElementById('clockbug');
447 clockbug.className = 'clockbug clockbug-animate-in';
448 clock_visible = true;
453 if (!clock_visible) return;
454 var clockbug = document.getElementById('clockbug');
455 clockbug.className = 'clockbug clockbug-animate-out';
456 clock_visible = false;
459 function setcomment()
461 document.getElementById('comment').innerHTML = state['comment'];
464 function showcomment()
466 if (comment_visible) return;
467 var commentbug = document.getElementById('commentbug');
468 commentbug.className = 'commentbug commentbug-animate-in';
469 comment_visible = true;
472 function hidecomment()
474 if (!comment_visible) return;
475 var commentbug = document.getElementById('commentbug');
476 commentbug.className = 'commentbug commentbug-animate-out';
477 comment_visible = false;
480 function showlowerthird()
482 if (lowerthird_visible) return;
484 // With no flexbox, this is how it has to be...
485 var f = document.getElementById('lowerthird-headline');
486 var g = document.getElementById('lowerthird-headline-content');
487 f.style.paddingTop = Math.round((f.clientHeight - g.clientHeight) / 2) + 'px';
489 f = document.getElementById('lowerthird-subheading');
490 g = document.getElementById('lowerthird-subheading-content');
491 f.style.paddingTop = Math.round((f.clientHeight - g.clientHeight) / 2) + 'px';
493 document.getElementById('lowerthird-headline').className = 'lowerthird-headline lowerthird-headline-animate-in';
494 document.getElementById('lowerthird-headline-content').className = 'lowerthird-headline-content lowerthird-headline-content-animate-in';
495 document.getElementById('lowerthird-subheading').className = 'lowerthird-subheading lowerthird-subheading-animate-in';
496 document.getElementById('lowerthird-subheading-content').className = 'lowerthird-subheading-content lowerthird-subheading-content-animate-in';
497 lowerthird_visible = true;
500 function setandshowlowerthird()
502 document.getElementById('lowerthird-headline-content').innerHTML = state['text1'];
503 document.getElementById('lowerthird-subheading-content').innerHTML = state['text2'];
507 function hidelowerthird()
509 if (!lowerthird_visible) return;
510 document.getElementById('lowerthird-headline').className = 'lowerthird-headline lowerthird-headline-hidden lowerthird-headline-animate-out';
511 document.getElementById('lowerthird-headline-content').className = 'lowerthird-headline-content lowerthird-headline-content-animate-out';
512 document.getElementById('lowerthird-subheading').className = 'lowerthird-subheading lowerthird-subheading-animate-out';
513 document.getElementById('lowerthird-subheading-content').className = 'lowerthird-subheading-content lowerthird-subheading-content-animate-out';
514 lowerthird_visible = false;
519 var elapsed = (Date.now() - clock_origin) * 1e-3;
520 if (elapsed > clock_left) return 0;
521 return Math.ceil(clock_left - elapsed);
524 function update_clock()
526 var left = time_left();
527 var min = Math.floor(left / 60);
530 if (sec < 10) sec = "0" + sec;
531 document.getElementById('clock').innerHTML = min + ":" + sec;
548 if (scoreA > 0) --scoreA;
554 if (scoreB > 0) --scoreB;
558 function resetscore()
564 function update_score()
566 document.getElementById('score').innerHTML = scoreA + " – " + scoreB;
569 /* called by caspar only */
572 document.getElementById('manualcontrols').style.display = 'none';
573 document.getElementById('area').style.display = 'none';
575 // Old CEF workaround
576 document.getElementById('lowerthird-subheading').style.top = '638px';
581 console.log('[[[' + v + ']]]');
582 var j = JSON.parse(v);
583 for(var key in j) state[key] = j[key];
586 setInterval(function() {