-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscoreboard.html
More file actions
754 lines (659 loc) · 18.2 KB
/
Copy pathscoreboard.html
File metadata and controls
754 lines (659 loc) · 18.2 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Scoreboard</title>
<link type="text/css" href="lib/jqui/css/smoothness/jquery-ui-1.8.13.custom.css" rel="stylesheet" />
<script type="text/javascript" src="lib/jquery/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="lib/jqui/js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="lib/marquee/jquery.marquee.js"></script>
<script type="text/javascript" src="lib/jqueryshortcutslibrary/jquery.shortcuts.min.js"></script>
<script type="text/javascript">
sending = false;
ScoreAlwaysVisible = false;
$(document).ready(function(){
$("#teamdata").tabs();
$("#sb_content").draggable();
$("#team1inc").bind("click", function(e)
{
increment("team1"); remoteinfo('send'); animate();
})
$("#team2inc").bind("click", function(e)
{
increment("team2"); remoteinfo('send'); animate();
})
$("#showscores").bind("click", function(e)
{
ScoreAlwaysVisible = false;
$("#showscores").addClass("recording")
$("#sb_content").show("fast");
})
$("#showforever").bind("click", function(e)
{
ScoreAlwaysVisible = true;
$("#showscores").addClass("recording")
$("#sb_content").show("fast");
})
$("#hidescores").bind("click", function(e)
{
ScoreAlwaysVisible = false;
$("#showscores").removeClass("recording");
$("#sb_content").slideUp("medium");
})
$("#showexperimentalstuff").bind("click", function(e)
{
$("#sb_text_container").removeClass("experimental")
})
$("#slide").bind("click", function(e)
{
showtext();
})
$("#alternativetext").bind("click", function(e)
{
$("#sb_content .team_container").removeClass("hicontrast").addClass("alternate");
})
$("#originaltext").bind("click", function(e)
{
$("#sb_content .team_container").removeClass("alternate hicontrast");
})
$("#hicontrast").bind("click", function(e)
{
$("#sb_content .team_container").removeClass("alternate").addClass("hicontrast");
})
$("#linear").bind("click", function(e)
{
$("#sb_content .team_container").removeClass("linear1").removeClass("linear2");
})
$("#linear1").bind("click", function(e)
{
$("#sb_content .team_container").removeClass("linear2").addClass("linear1");
})
$("#linear2").bind("click", function(e)
{
$("#sb_content .team_container").removeClass("linear1").addClass("linear2");
})
$("#bumptext1").bind("click", function(e)
{
$("#sb_content").removeClass("bump2 bump3 bump4 bump5 bump6").addClass("bump1");
})
$("#bumptext2").bind("click", function(e)
{
$("#sb_content").removeClass("bump1 bump3 bump4 bump5 bump6").addClass("bump2");
})
$("#bumptext3").bind("click", function(e)
{
$("#sb_content").removeClass("bump1 bump2 bump4 bump5 bump6").addClass("bump3");
})
$("#bumptext4").bind("click", function(e)
{
$("#sb_content").removeClass("bump1 bump3 bump2 bump5 bump6").addClass("bump4");
})
$("#bumptext5").bind("click", function(e)
{
$("#sb_content").removeClass("bump1 bump3 bump2 bump4 bump6").addClass("bump5");
})
$("#bumptext6").bind("click", function(e)
{
$("#sb_content").removeClass("bump1 bump3 bump2 bump4 bump5").addClass("bump6");
})
$("#originaltextpos").bind("click", function(e)
{
$("#sb_content").removeClass("bump1");
$("#sb_content").removeClass("bump2");
$("#sb_content").removeClass("bump3");
$("#sb_content").removeClass("bump4");
$("#sb_content").removeClass("bump5");
})
$("#sizebumptext1").bind("click", function(e)
{
$("#scoreboard").removeClass("res720p").addClass("res360p");
})
$("#sizebumptext2").bind("click", function(e)
{
$("#scoreboard").removeClass("res360p").addClass("res720p");
})
$("#originaltextsize").bind("click", function(e)
{
$("#scoreboard").removeClass("res360p");
$("#scoreboard").removeClass("res720p");
})
$("#connect").bind("click", function(e)
{
switch($("input[name=connecttype]:checked").val())
{
case "send":
$(this).val("Connecting...");
//remotetimer = window.setInterval( "remoteinfo('send')", 5000 );
//clearInterval("remotetimer");
sending = true;
$("#scoreboard").addClass("recording")
$(".scorelabel").css("color", "#FF0000");
remoteinfo('send');
break;
case "receive":
$(this).val("Waiting first send");
remotetimer = window.setInterval( "remoteinfo('receive')", 5000);
}
// Turn the darn thing off
$(this).attr("disabled",true)
})
$("input.score").bind("change", function(e)
{
if (sending)
{
remoteinfo('send');
}
$("#showscores").removeClass("recording");
animate();
}
)
$("input[name=bgtype]").bind("change", function(e)
{
switch(this.value)
{
case "none":
$("#scoreboard").removeClass("imagebg standardbg");
break;
case "standard":
$("#scoreboard").removeClass("imagebg").addClass("standardbg");
break;
case "image":
$("#scoreboard").removeClass("standardbg").addClass("imagebg");
}
}
)
$("#bgcolor").bind("change", function(e)
{
var newcolor = "#" + $("#bgcolor").val();
$("#scoreboard").css('backgroundColor', newcolor);
})
// KB Shortcuts
// $(document).bind('keydown', 'Ctrl+c', function(){ alert('copy anyone?');});
//$(document).bind('keydown', 'a', function() { `ment("team1") });
//$(document).bind('keydown', 'b', function() { increment("team2") });
/* $(document).bind('keydown', 'control+shift+[', decrement("team1"))
$(document).bind('keydown', 'control+shift+]', decrement("team2"))
*/
});
$.Shortcuts.add({
type: 'down',
mask: 'Ctrl+Left',
handler: function() { increment("team1"); remoteinfo('send'); animate(); } }
);
$.Shortcuts.add({
type: 'down',
mask: 'Ctrl+Right',
handler: function() { increment("team2"); remoteinfo('send'); animate(); } }
);
$.Shortcuts.add({
type: 'down',
mask: 'Ctrl+Shift+Left',
handler: function() { decrement("team1"); remoteinfo('send'); animate(); } }
);
$.Shortcuts.add({
type: 'down',
mask: 'Ctrl+Shift+Right',
handler: function() { decrement("team2"); remoteinfo('send'); animate(); } }
);
$.Shortcuts.start();
function increment(team)
{
var tempval = ($("#"+team+"score").val()*1) + 1;
$("#"+team+"score").val(tempval)
//animate();
}
function decrement(team)
{
var tempval = ($("#"+team+"score").val()*1) - 1;
$("#"+team+"score").val(tempval)
}
function showtext()
{
var scrollertext = $("#sb_text_input").val();
var newscroll = '<marquee id="sb_text" loop=1 scrollamount=2>'+scrollertext+'</marquee>';
// You can try queuing it up with $("#sb_team1_score").marquee({"loop": "1"}); ... however fix the hardcoding.
$("#sb_text_container").removeClass("experimental");
$("#sb_text_container").empty();
$("#sb_text_container").append(newscroll);
$("#sb_text_container").not(":animated").slideDown("fast");
$("#sb_text").marquee();
}
function removescroller()
{
$("#sb_text_container").slideUp("fast");
}
function animate()
{
// Globals
var delaytime = $("#delaytime").val()
var team2_score = $("#team2score").val()
$("#sb_team2_score").html(team2_score)
var team1_score = $("#team1score").val()
$("#sb_team1_score").html(team1_score)
var team1_name = $("#team1name").val()
$("#sb_team1_name").html(team1_name)
var team2_name = $("#team2name").val()
$("#sb_team2_name").html(team2_name)
// $("#sb_content").show("slow").delay(delaytime).hide("slow")
if (!ScoreAlwaysVisible)
{
$("#sb_content").not(":animated").slideDown("slow").delay(delaytime).slideUp("slow")
}
else {
$("#sb_content").not(":animated").slideDown("slow").delay(delaytime)
}
}
function remoteinfo(type)
{
switch (type)
{
case "receive":
$.getJSON('scdata.php', function(json) {
var team1score = $("#team1score").val()
var team2score = $("#team2score").val()
if ( (json.team1score != team1score) || (json.team2score != team2score) )
{
$("#team1score").val(json.team1score);
$("#team2score").val(json.team2score);
animate();
}
});
break;
case "send":
if (sending) {
var team1score = $("#team1score").val()
var team2score = $("#team2score").val()
var currentdate = new Date()
// fucking hacks.
senddata = 'team1score='+team1score+'&team2score='+team2score+'&action=fuckingyeah'
$.ajax({
url:'updatescoreboard.php',
data: senddata,
success: function(){
$("#connect").val("Connected, got an update!");
},
type:'post'
})
datestring = currentdate.getHours() + ":" + currentdate.getMinutes() + " " + currentdate.getSeconds() +"s";
$("#connect").val("Sent Stuff at " + datestring);
}
}
}
</script>
<style type="text/css">
#scoreboard {
position:relative; /* This is to allow abs positioning on child blocks */
}
#scoreboard {
background:#00FF00 /* alpha map me */
}
#scoreboard {
width:320px;
height:180px;
border:1px solid black;
}
/* set reasonable margins to allow for alignment */
#sb_team2_name, #sb_team1_name
{ min-width:70px; }
#sb_team1_score, #sb_team2_score
{ min-width:30px; }
.linear1 #sb_team2_name, .linear1 #sb_team1_name
{ min-width:100px; }
.res360p
{
width:640px !important;
height:360px !important;
}
.res720p
{
width:1280px !important;
height:720px !important;
}
.score
{
width:50px;
}
.teamname
{
width: 150px; /* or 45% */
}
.nameformatting
{
width:180px;
}
label {
font-weight:bold
}
.recording
{
border: 1px solid red !important;
}
.sb_name {
letter-spacing:-.8px;
font-size:130%;
font-family:verdana;
/*Is there a font stroke thing for it that I can use :p*/
/* Mac hack */
-webkit-font-smoothing:none;
color:#D12C10;
}
.sb_score {
font-family:verdana;
font-size:130%;
color:#675E55;
/* Mac hack */
-webkit-font-smoothing:none;
}
#teamdata
{
width:55%
}
#sb_text_container
{
position: absolute;
width:100%;
top:80%;
}
.linear1.team_container
{
width:60%;
}
.team_container
{
width:45%
}
#sb_team1_container,#sb_team2_container
{
padding:5px;
}
#sb_team2_container
{
float:right;
}
#sb_team1_container
{
float:left;
}
.sb_score, .sb_name
{
/*text-shadow: 2px 2px white;*/
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white
}
#sb_text
{
font-weight:bold;
font-size:1.4em;
}
.experimental
{
display:none !important;
}
.hicontrast .sb_name
{
color:#FFF;
letter-spacing:1px;
font-weight:bold;
font-size:16px;
text-shadow: 1px 1px #222222, -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black
}
.hicontrast .sb_score
{
text-shadow: 1px 1px #000;
color:#FFF;
font-family:arial;
font-size:18px;
}
.alternate .sb_name
{
color:#22CCFF;
letter-spacing:1px;
font-weight:bold;
font-size:16px;
text-shadow: 1px 1px #222222, -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black
}
.alternate .sb_score
{
text-shadow: 1px 1px #1022FF;
color:#FFF;
font-family:arial;
font-size:18px;
}
#sb_team2_container.linear1
{
float:none;
}
.linear1 #sb_team1_score, .linear1 #sb_team2_score
{
float:left;
}
.linear1 #sb_team1_name, .linear1 #sb_team2_name
{
margin-left:5px;
margin-right:10px;
float:left;
}
.linear2 #sb_team1_name, .linear2 #sb_team2_name
{
margin-left:5px;
margin-right:10px;
float:left;
}
#sb_team2_container.linear2
{
float:left;
}
.bump1
{margin-top:5%;}
.bump2
{margin-top:10%;}
.bump3
{
margin-top:25%;
}
.bump4
{margin-top:30%;}
.bump5
{margin-top:32%;}
.bump6
{margin-top:37%;}
.standardbg #sb_team1_name, .standardbg #sb_team2_name
{
background:black;
}
.standardbg #sb_team1_score, .standardbg #sb_team2_score {
background:black;
}
/* Image background method */
.imagebg #sb_team1_container
{
background-attachment: scroll;
background-clip: border-box;
background-color: transparent;
background-image: url("images/leftslider.png");
background-origin: padding-box;
background-position: -60px 50%;
background-repeat: no-repeat;
background-size: 130% auto;
}
.imagebg #sb_team2_container
{
background-attachment: scroll;
background-clip: border-box;
background-color: transparent;
background-image: url("images/rightslider.png");
background-origin: padding-box;
background-position: 30px 50%;
background-repeat: no-repeat;
background-size: 130% auto;
}
.imagebg #sb_team2_name, .imagebg #sb_team2_score
{
text-align:right;
}
.imagebg #sb_team2_name, .imagebg #sb_team2_score
{
}
#scoreboard.imagebg .sb_score, #scoreboard.imagebg .sb_name
{ text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black }
#remoteid
{
width:30px;
}
#sb_text
{
height:25px;
padding:3px;
font-family:verdana;
font-size:1.2em;
font-weight:normal;
letter-spacing:-.8px;
text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
}
#sb_text_container
{
clear:both;
background:white;
}
</style>
</head>
<body>
<h1>Scoreboard</h1>
<p>A project to help with dynamic scoreboards.</p>
<p>To use, screen region the green backgrounded area, then chromakey it out.</p>
<div id="scoreboard">
<div id="sb_content">
<div id="sb_team1_container" class="team_container">
<div id="sb_team1_name" class="sb_name">
Team 1
</div>
<div id="sb_team1_score" class="sb_score">
15
</div>
</div>
<div id="sb_team2_container" class="team_container">
<div id="sb_team2_name" class="sb_name">
Team 2
</div>
<div id="sb_team2_score" class="sb_score">
141
</div>
</div>
</div>
<div id="sb_text_container" class="experimental">
<marquee id="sb_text" loop=12>
Content
</marquee>
</div>
</div>
<div id="teamdata">
<ul>
<li><a href="#tabs-scores">Team/Scores</a></li>
<li><a href="#tabs-delay">Delay</a></li>
<li><a href="#tabs-textsize">Board Size</a></li>
<li><a href="#tabs-textstyle">Text Style</a></li>
<li><a href="#tabs-textformatting">Text Format</a></li>
<li><a href="#tabs-textposition">Text Position</a></li>
<li><a href="#tabs-textbackground">Text Background</a></li>
<li><a href="#tabs-background">BG Color</a></li>
<li><a href="#tabs-remoteupdate">Remote Updates</a></li>
<li><a href="#tabs-experimental">Testing</a></li>
</ul>
<div id ="tabs-scores">
<form name="teamdata" action="post">
<label for="team1score" class="scorelabel">Team 1 score: </label>
<input type="text" id="team1score" name="team1score" class="score" value="0" >
<label for="team2score" class="scorelabel">Team 2 score: </label>
<input type="text" id="team2score" name="team2score" class="score" value="0" >
<div class="scorebuttons">
<input type="button" id="team1inc" name="team1inc" value="team1+" >
<input type="button" id="team2inc" name="team2inc" value="team2+" >
</div>
<div class="nameformatting">
<label for="team1name">Team 1 name: </label>
<input type="text" id="team1name" name="team1name" class="teamname" value="Randoms" >
<label for="team2name">Team 2 name: </label>
<input type="text" id="team2name" name="team2name" class="teamname" value="H*EA*T" >
</div>
</form>
</div>
<form name="teamoptions" action="post">
<div id="tabs-delay">
<fieldset>
<legend>Delays and show/hide</legend>
<label for="delaytime">Delay time (in milliseconds - 1000 = 1 second): </label>
<input type="text" id="delaytime" name="delaytime" class="delaytime" value="1800" >
<input type="button" id="showscores" name="showscores" value="Show scoreboard till next change" >
<input type="button" id="showforever" name="showforever" value="Show scoreboard forever" >
<input type="button" id="hidescores" name="hidescores" value="Hide scoreboard now" >
</fieldset>
</div>
<div id="tabs-textsize">
<fieldset>
<legend>Board size</legend>
<input type="button" id="originaltextsize" name="originaltextsize" value="Original Size" >
<input type="button" id="sizebumptext1" name="sizebump1" value="360p" >
<input type="button" id="sizebumptext2" name="sizebump2" value="720p" >
</fieldset>
</div>
<div id="tabs-textstyle">
<fieldset>
<legend>Text Style</legend>
<input type="button" id="originaltext" name="originaltext" value="Original Text Format" >
<input type="button" id="alternativetext" name="alternativetext" value="Alternative Text" >
<input type="button" id="hicontrast" name="hicontrast" value="High Contrast Text" >
</fieldset>
</div>
<div id="tabs-textformatting">
<fieldset>
<legend>Text formatting</legend>
<input type="button" id="linear" name="linear" value="Left/Right Corners" >
<input type="button" id="linear1" name="linear1" value="linear layout stacked" >
<input type="button" id="linear2" name="linear2" value="one line layout" >
</fieldset>
</div>
<div id="tabs-textposition">
<fieldset>
<legend>Text position</legend>
<input type="button" id="originaltextpos" name="originaltext" value="Original Position" >
<input type="button" id="bumptext1" name="bump1" value="Bump1" >
<input type="button" id="bumptext2" name="bump2" value="Bump2" >
<input type="button" id="bumptext3" name="bump3" value="Bump3" >
<input type="button" id="bumptext4" name="bump4" value="Bump4" >
<input type="button" id="bumptext5" name="bump5" value="Bump5" >
<input type="button" id="bumptext6" name="bump6" value="Bump6" >
</fieldset>
</div>
<div id="tabs-background">
<fieldset>
<legend>Background color</legend>
<label for="bgcolor">In HEX (RRGGBB)</label><input type="text" id="bgcolor" name="bgcolor" value="00FF00" maxlength=6 >
</fieldset>
</div>
<div id="tabs-textbackground">
<fieldset>
<legend>Background type</legend>
<input type="radio" checked name="bgtype" id="bgtype_none" value="none"> <label for="bgtype_none">None</label>
<input type="radio" name="bgtype" id="bgtype_standard" value="standard"> <label for="bgtype_standard">Standard</label>
<input type="radio" name="bgtype" id="bgtype_image" value="image"> <label for="bgtype_image">Image</label>
</fieldset>
</div>
<div id="tabs-remoteupdate">
<fieldset>
<legend>Remote updates</legend>
<label for="bgcolor">Remote partner id: </label><input type="text" id="remoteid" name="delaytime" class="delaytime" maxlength=3 >
<input type="button" id="connect" name="connect" value="Connect" >
<input type="radio" checked name="connecttype" id="connecttype_send" value="send"> <label for="connecttype_send">Send</label>
<input type="radio" name="connecttype" id="connecttype_receive" value="receive"> <label for="connecttype_receive">Receive</label>
</fieldset>
</div>
<div id="tabs-experimental">
<fieldset>
<legend>Experimental options</legend>
<input type="button" id="showexperimentalstuff" name="showexperimentalstuff" value="There is no cow" >
<input type="button" id="slide" name="slide" value="slide" ><br>
<input type="input" id="sb_text_input" name="sb_text_input" value="Visit us for more cool stuff." >
</fieldset>
</div>
</form>
</div>
</body>
</html>