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"> -->
7 <link href="fonts/lato.css" rel="stylesheet">
10 -webkit-box-sizing: border-box;
11 Box-Sizing: border-box;
12 -webkit-backface-visibility: hidden;
13 -webkit-transition: translate3d(0,0,0);
20 background: transparent;
22 -webkit-font-smoothing: antialiased !important;
25 font-family: 'Lato', sans-serif;
35 border-collapse: collapse;
37 border: 3px solid black;
41 border: 3px solid #008;
43 .team1color, .team2color {
67 /* Clock, to the right of score */
73 border-collapse: collapse;
75 border: 3px solid black;
78 border: 3px solid #008;
85 -webkit-transform:translateX(-200%);
87 .clockbug-animate-in {
88 -webkit-animation: from-left 1s ease;
90 .clockbug-animate-out {
91 -webkit-animation: to-left 1s ease;
92 -webkit-transform:translateX(-200%);
95 /* Comment, below score */
101 border-collapse: collapse;
103 border: 3px solid black;
106 border: 3px solid #008;
114 -webkit-transform:translateY(-40px);
116 .commentbug-animate-in {
117 -webkit-animation: from-top 0.5s ease;
119 .commentbug-animate-out {
120 -webkit-animation: to-top 0.5s ease;
121 -webkit-transform:translateY(-40px);
125 .lowerthird-headline {
130 border-collapse: collapse;
132 border: 2px solid #ccc;
136 /*background: linear-gradient(to right, #ccc, #fff 15px); */
137 background-image: url(lowerthird-bg.png);
139 /* padding-top: 20px; */
141 .lowerthird-headline-hidden {
146 .lowerthird-headline-animate-in {
147 -webkit-animation: scale-out 1.0s;
149 .lowerthird-headline-animate-out {
150 -webkit-animation: scale-in 1.0s;
152 .lowerthird-headline-content {
156 .lowerthird-headline-content-hidden {
157 clip: rect(0px,0px,200px,0px);
159 .lowerthird-headline-content-animate-in {
160 -webkit-animation: wipe-out 2.0s ease;
162 .lowerthird-headline-content-animate-out {
163 -webkit-animation: wipe-in 2.0s ease;
164 clip: rect(0px,0px,200px,0px);
166 .lowerthird-subheading {
173 border-collapse: collapse;
175 border: 1px solid black;
177 align-items: center; */
178 /*background: linear-gradient(to right, #44c, #33a 15px); */
179 background-image: url(lowerthird-bg2.png);
181 .lowerthird-subheading-hidden {
182 clip: rect(0px,0px,200px,0px);
184 .lowerthird-subheading-animate-in {
185 -webkit-animation: scale-out-small 1.6s ease;
187 .lowerthird-subheading-animate-out {
188 -webkit-animation: scale-in-small 1.6s ease;
192 .lowerthird-subheading-content {
196 .lowerthird-subheading-content-hidden {
200 .lowerthird-subheading-content-animate-in {
201 -webkit-animation: wipe-out 2.2s ease;
203 .lowerthird-subheading-content-animate-out {
204 -webkit-animation: wipe-in 2.2s ease;
205 clip: rect(0px,0px,200px,0px);
208 /* these are hidden when actually run in casparcg */
222 /* background: rgba(0, 0, 170, 0.8); */
223 background: transparent;
228 border-spacing: 0px 7px;
230 border-collapse: separate;
231 text-transform: uppercase;
235 text-transform: none;
239 text-transform: none;
242 -webkit-animation: fade-in 1.0s ease;
243 -webkit-animation-delay: 0.0s;
244 -webkit-animation-fill-mode: both;
246 #carousel tr.subfooter {
247 -webkit-animation: fade-in 1.0s ease;
248 -webkit-animation-delay: 0.25s;
249 -webkit-animation-fill-mode: both;
252 /* background: rgba(0, 0, 170, 0.8); */
253 background: linear-gradient(to bottom, rgba(0, 0, 170, 0.8), rgba(0, 0, 130, 0.8));
254 /* -webkit-animation: fade-in calc(counter(rowNumber) * 1.0)s ease; */
255 -webkit-animation: fade-in calc(counter-value(rowNumber) * 1.0s) ease;
257 #carousel tr.footer {
258 -webkit-animation: fade-in 2.0s ease;
259 -webkit-animation-delay: 0.5s;
260 -webkit-animation-fill-mode: both;
262 #carousel td, #carousel th {
266 #carousel tr.footer td {
268 text-transform: none;
277 .nplayed, .gd, .pts {
288 @-webkit-keyframes from-left {
290 -webkit-transform:translateX(-200%);
293 -webkit-transform:translateX(0);
296 @-webkit-keyframes to-left {
298 -webkit-transform:translateX(0);
301 -webkit-transform:translateX(-200%);
304 @-webkit-keyframes from-top {
306 -webkit-transform:translateY(-40px);
309 -webkit-transform:translateY(0);
312 @-webkit-keyframes to-top {
314 -webkit-transform:translateY(0);
317 -webkit-transform:translateY(-40px);
321 @-webkit-keyframes scale-out {
329 @-webkit-keyframes scale-in {
332 border: 2px solid #ccc;
336 border: 2px solid #ccc;
339 @-webkit-keyframes scale-out-small {
349 border: 1px solid black;
355 @-webkit-keyframes scale-in-small {
358 border: 1px solid black;
362 border: 1px solid black;
372 @-webkit-keyframes wipe-out {
374 clip: rect(0px,0px,200px,0px);
377 clip: rect(0px,0px,200px,0px);
380 clip: rect(0px,1050px,200px,0px);
383 @-webkit-keyframes wipe-in {
385 clip: rect(0px,1050px,200px,0px);
387 20% { /* Not symmetrical! */
388 clip: rect(0px,0px,200px,0px);
391 clip: rect(0px,0px,200px,0px);
394 @-webkit-keyframes fade-in {
405 <div id="area"></div>
406 <table class="scorebug">
408 <td class="team1color" id="team1color"></td>
409 <td class="team1" id="team1">PCL</td>
410 <td class="score" id="score">17 – 11</td>
411 <td class="team2" id="team2">NMBUI</td>
412 <td class="team2color" id="team2color"></td>
415 <table class="clockbug clockbug-hidden" id="clockbug">
417 <td class="clock" id="clock">25:00</td>
420 <table class="commentbug commentbug-hidden" id="commentbug">
422 <td class="comment" id="comment">Pagacap: First to 9 points</td>
425 <div class="lowerthird-headline lowerthird-headline-hidden" id="lowerthird-headline"><div class="lowerthird-headline-content lowerthird-headline-content-hidden" id="lowerthird-headline-content">
426 John Doe<br>Ola Nordmann
428 <div class="lowerthird-subheading lowerthird-subheading-hidden" id="lowerthird-subheading"><div class="lowerthird-subheading-content lowerthird-subheading-content-hidden" id="lowerthird-subheading-content">
429 Commentators, Trøndisk 2016
431 <table id="carousel">
434 <th colspan="5">Current standings, TrønDisk 2017<br />Group A</th>
437 <tr class="subfooter">
438 <th class="rank"></th>
439 <th class="team"></th>
440 <th class="nplayed">P</th>
441 <th class="gd">GD</th>
442 <th class="pts">Pts</th>
446 <th class="rank">1</th>
447 <td class="team">Trondheim Frisbeeklubb</td>
448 <td class="nplayed">3</td>
449 <td class="gd">+7</td>
450 <td class="pts">6</td>
453 <th class="rank">2</th>
454 <td class="team">Pancake Circle Ltd.</td>
455 <td class="nplayed">2</td>
456 <td class="gd">+2</td>
457 <td class="pts">4</td>
460 <th class="rank">3</th>
461 <td class="team">Norges Handelshøyskole 1</td>
462 <td class="nplayed">2</td>
463 <td class="gd">-2</td>
464 <td class="pts">2</td>
467 <th class="rank">3</th>
468 <td class="team">Pick-up Team</td>
469 <td class="nplayed">2</td>
470 <td class="gd">-2</td>
471 <td class="pts">2</td>
474 <th class="rank">5</th>
475 <td class="team">Whatever Team</td>
476 <td class="nplayed">3</td>
477 <td class="gd">-11</td>
478 <td class="pts">0</td>
481 <td colspan="5">www.trondheimfrisbeeklubb.no | #trøndisk</td>
485 <div id="manualcontrols">
487 <a href="javascript:startclock()">start clock</a>
488 <a href="javascript:stopclock()">stop clock</a>
489 <a href="javascript:setclock(25*60)">reset clock</a>
490 <a href="javascript:showclock()">show clock</a>
491 <a href="javascript:hideclock()">hide clock</a>
494 <a href="javascript:goalA()">goal team A</a>
495 <a href="javascript:goalB()">goal team B</a>
496 <a href="javascript:ungoalA()">ungoal team A</a>
497 <a href="javascript:ungoalB()">ungoal team B</a>
498 <a href="javascript:resetscore()">reset score</a>
501 <a href="javascript:showcomment()">show comment</a>
502 <a href="javascript:hidecomment()">hide comment</a>
505 <a href="javascript:showlowerthird()">show lower third</a>
506 <a href="javascript:hidelowerthird()">hide lower third</a>
510 <script src="carousel.js" type="text/javascript" />
512 var clock_running = false;
513 var clock_visible = false;
514 var comment_visible = false;
515 var lowerthird_visible = false;
516 var clock_left = 25 * 60;
524 document.getElementById('team1').innerHTML = state['team1'];
525 document.getElementById('team2').innerHTML = state['team2'];
530 document.getElementById('team1color').style.backgroundColor = state['team1color'];
531 document.getElementById('team2color').style.backgroundColor = state['team2color'];
536 scoreA = state['score1'];
537 scoreB = state['score2'];
541 function startclock()
543 if (!clock_running) {
544 clock_origin = Date.now();
545 clock_running = true;
552 if (!clock_running) return;
553 clock_left = time_left();
554 clock_origin = Date.now();
555 clock_running = false;
558 function setclock(amount)
561 clock_origin = Date.now();
565 function setclockfromstate()
567 var amount = parseInt(state['clock_min']) * 60 + parseInt(state['clock_sec']);
573 if (clock_visible) return;
574 var clockbug = document.getElementById('clockbug');
575 clockbug.className = 'clockbug clockbug-animate-in';
576 clock_visible = true;
581 if (!clock_visible) return;
582 var clockbug = document.getElementById('clockbug');
583 clockbug.className = 'clockbug clockbug-animate-out';
584 clock_visible = false;
587 function setcomment()
589 document.getElementById('comment').innerHTML = state['comment'];
592 function showcomment()
594 if (comment_visible) return;
595 var commentbug = document.getElementById('commentbug');
596 commentbug.className = 'commentbug commentbug-animate-in';
597 comment_visible = true;
600 function hidecomment()
602 if (!comment_visible) return;
603 var commentbug = document.getElementById('commentbug');
604 commentbug.className = 'commentbug commentbug-animate-out';
605 comment_visible = false;
608 function showlowerthird()
610 if (lowerthird_visible) return;
612 // With no flexbox, this is how it has to be...
613 var f = document.getElementById('lowerthird-headline');
614 var g = document.getElementById('lowerthird-headline-content');
615 f.style.paddingTop = Math.round((f.clientHeight - g.clientHeight) / 2) + 'px';
617 f = document.getElementById('lowerthird-subheading');
618 g = document.getElementById('lowerthird-subheading-content');
619 f.style.paddingTop = Math.round((f.clientHeight - g.clientHeight) / 2) + 'px';
621 document.getElementById('lowerthird-headline').className = 'lowerthird-headline lowerthird-headline-animate-in';
622 document.getElementById('lowerthird-headline-content').className = 'lowerthird-headline-content lowerthird-headline-content-animate-in';
623 document.getElementById('lowerthird-subheading').className = 'lowerthird-subheading lowerthird-subheading-animate-in';
624 document.getElementById('lowerthird-subheading-content').className = 'lowerthird-subheading-content lowerthird-subheading-content-animate-in';
625 lowerthird_visible = true;
628 function setandshowlowerthird()
630 document.getElementById('lowerthird-headline-content').innerHTML = state['text1'];
631 document.getElementById('lowerthird-subheading-content').innerHTML = state['text2'];
635 function hidelowerthird()
637 if (!lowerthird_visible) return;
638 document.getElementById('lowerthird-headline').className = 'lowerthird-headline lowerthird-headline-hidden lowerthird-headline-animate-out';
639 document.getElementById('lowerthird-headline-content').className = 'lowerthird-headline-content lowerthird-headline-content-animate-out';
640 document.getElementById('lowerthird-subheading').className = 'lowerthird-subheading lowerthird-subheading-animate-out';
641 document.getElementById('lowerthird-subheading-content').className = 'lowerthird-subheading-content lowerthird-subheading-content-animate-out';
642 lowerthird_visible = false;
647 var elapsed = (Date.now() - clock_origin) * 1e-3;
648 if (elapsed > clock_left) return 0;
649 return Math.ceil(clock_left - elapsed);
652 function update_clock()
654 var left = time_left();
655 var min = Math.floor(left / 60);
658 if (sec < 10) sec = "0" + sec;
659 document.getElementById('clock').innerHTML = min + ":" + sec;
676 if (scoreA > 0) --scoreA;
682 if (scoreB > 0) --scoreB;
686 function resetscore()
692 function update_score()
694 document.getElementById('score').innerHTML = scoreA + " – " + scoreB;
697 /* called by caspar only */
700 document.getElementById('manualcontrols').style.display = 'none';
701 document.getElementById('area').style.display = 'none';
703 // Old CEF workaround
704 document.getElementById('lowerthird-subheading').style.top = '638px';
709 console.log('[[[' + v + ']]]');
710 var j = JSON.parse(v);
711 for(var key in j) state[key] = j[key];
714 setInterval(function() {