-
Notifications
You must be signed in to change notification settings - Fork 17
/
blackboard.less
718 lines (682 loc) · 18.8 KB
/
blackboard.less
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
@font-face
{
font-family: "Noto Color Emoji";
font-style: normal;
font-weight: 400;
src: local('Noto Color Emoji'), local('NotoColorEmoji'), url('../fonts/NotoColorEmoji.ttf') format('truetype');
}
@font-face
{
font-family: "Open Sans Emoji";
font-style: normal;
font-weight: 400;
src: local('Open Sans Emoji'), local('OpenSansEmoji'), url('../fonts/OpenSansEmoji.ttf') format('truetype');
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.comma-list {
& > *::after { content: ", "; }
& > *:last-child::after { content:""; }
}
.border-box {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bb-no-wrap {
white-space: nowrap;
}
.border-radius(@radius: 5px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
@navbar-height: 101px; /* was 69px */
body {
background: url('/img/grid_noise.png');
background-attachment: fixed;
font-family: "Noto Sans", sans-serif, "Noto Color Emoji", "Open Sans Emoji";
// Override bootstrap
input, button, select, textarea {
font-family: "Noto Sans", sans-serif, "Noto Color Emoji", "Open Sans Emoji";
}
}
// For mobile devices which actually support native emojis:
body.has-emojis {
font-family: "Noto Sans", sans-serif;
input, button, select, textarea {
font-family: "Noto Sans", sans-serif;
}
}
.bb-puzzleround, .bb-chat-messages {
padding-top: 40px; /* allow space for breadcrumbs in navbar */
}
.bb-puzzleround {
padding-right: 2px; padding-left: 2px;
.navbar { margin: 0 10px; }
table.bb-round-answers { width: auto; }
.bb-spreadsheet-frame {
width: 100%;
height: 500px;
border-top: 1px solid #ccc;
}
.answer > span:first-child {
/* Vertically align answer timestamps */
display: inline-block; min-width: 120px;
}
.answer > .backsolve {
font-family: "Noto Sans", sans-serif, "Noto Color Emoji", "Open Sans Emoji";
font-size: .65em;
text-transform: none;
}
.bb-callin-btn, .bb-addquip-btn, .bb-summon-btn {
float: right; margin-top: 4px; margin-right: 3px;
}
.bb-status-stuck {
background-color: #FF0;
}
}
.bb-chat-messages {
margin-bottom: 26px; /* 41px navbar - 15px padding on #bb-body */
}
.bb-chat-callin, .bb-puzzleround {
.bb-summon-form {
.stuck-at, .stuck-need { width: auto; }
.label-stuck-other { display: block; }
}
}
#bb-body {
padding-top: @navbar-height;
padding-bottom: 15px;
@left-size: 85px;
@right-size: 45px;
@vert-padding: 4px;
.bb-buttonbar {
text-align: right;
padding-right: 5px;
.btn-group { text-align: left; }
.btn-toolbar { margin-top: 0; margin-bottom: 0; }
.tooltip-inner {
color: #000;
background-color: #eee;
border-color: black;
border-style: solid;
border-width: 0 1px 1px 1px;
}
.tooltip.bottom .tooltip-arrow {
border-bottom-color: #eee;
}
/* tweak to fix up moving buttons when tooltip appears */
.bb-protect { margin-right: -1px; }
.bb-unprotect { margin-left: 0; }
}
.bb-breadcrumbs .tooltip-inner { .bb-buttonbar .tooltip-inner; }
.bb-breadcrumbs .tooltip.bottom .tooltip-arrow { .bb-buttonbar .tooltip.bottom .tooltip-arrow; }
.bb-lastchat, .bb-lastupdate {
margin-bottom: @vert-padding;
margin-top: @vert-padding;
padding: 0 (15px + @right-size) 0 (14px + @left-size);
& > .left { margin-left: (-@left-size); }
& > .right { margin-right: (-@right-size);
text-align: right;
a[title], a[data-original-title] { position:relative; }
.bb-pop-out { font-size: 80%; }
}
&, .messageRow { .ellipsis; }
}
.bb-lastchat .messageRow {
margin-top: 0;
margin-bottom: 0;
font: 90%;
line-height: 1.25;
}
.bb-lastchat > .right { line-height: 16px; }
.bb-lastchat, .bb-lastupdate {
.timestamp { color: #555; }
}
.bb-lastupdate {
.comma-list { text-transform: uppercase; }
}
.bb-chat-presence {
.ellipsis;
/* tweak the height by 1px to get text baselines to line up. */
/* yes, this is incredibly anal. */
padding-top: 1px;
margin-bottom: -1px;
}
.bb-wiki { text-transform: uppercase; }
.answer {
font-family: 'Inconsolata', 'Andale Mono', Courier, monospace;
text-transform: uppercase;
}
}
#bb-sidebar {
.bb-sidenav {
margin-top: 10px;
background-color: #fff;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 1px 4px rgba(0,0,0,.065);
-moz-box-shadow: 0 1px 4px rgba(0,0,0,.065);
box-shadow: 0 1px 4px rgba(0,0,0,.065);
border: 1px solid #e5e5e5;
position: fixed; /* for wide screens */
& > li:first-child { text-align: center; /* wiki link */ }
li.nav-header, li > a { .ellipsis; }
/* Chevrons */
.icon-chevron-right {
float: right;
margin-top: 2px;
margin-right: -6px;
opacity: .25;
}
}
}
#bb-right-sidebar {
position: fixed;
right: 14px;
& > div { position: relative; }
.bb-hide-status {
position: absolute;
margin-top: 0;
left: -21px;
right: auto;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.bb-status-grid {
background: white;
margin-top: 10px;
margin-left: -7px;
margin-right: -7px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-border-top-left-radius: 0;
-moz-border-top-left-radius: 0;
border-top-left-radius: 0;
border: 1px solid #e5e5e5;
-webkit-box-shadow: 0 1px 4px rgba(0,0,0,0.065);
-moz-box-shadow: 0 1px 4px rgba(0,0,0,0.065);
box-shadow: 0 1px 4px rgba(0,0,0,0.065);
padding: 5px;
font-size: 80%;
.bb-status-grid-row {
padding-left: 1.5em;
text-indent: -1.5em;
& > * { text-indent: 0; }
}
.bb-status-grid-cell {
display: inline-block;
width: 1.5em;
text-align: center;
}
.bb-status-solved {
background:#AAFF99;
}
.bb-status-stuck {
background:#FFFF00;
}
.bb-status-unsolved {
background:#FCFCFC;
}
}
}
.bb-canEdit .bb-editable {
&:hover {
background: #fcffc0;
cursor: pointer;
}
input {
margin-top: 2px;
margin-bottom: 2px;
min-height: auto;
}
}
.bb-canEdit {
/* adjust height of tags layout so that things don't shift badly when
* the item is being edited (which uses a 24px input box) */
dt,dd {
&.bb-editable { min-height: 24px; }
}
.bb-tag-table td.bb-editable { min-height: 24px; }
/* tweak table column to make room for add tag/up/down icons */
td.puzzle-name > div { padding-right: (14px)*3; }
}
#bb-tables {
background: white;
margin-top: 10px;
padding-bottom: 15px;
padding-left: 15px;
padding-right: 15px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
border: 1px solid #e5e5e5;
-webkit-box-shadow: 0 1px 4px rgba(0,0,0,0.065);
-moz-box-shadow: 0 1px 4px rgba(0,0,0,0.065);
box-shadow: 0 1px 4px rgba(0,0,0,0.065);
font-size: 93%; /* 13px for body text */
h1.bb-blackboard-h1 {
font-size: 200%;
text-decoration: underline;
color: #888;
margin-bottom: 0;
}
h2 {
font-size: 200%;
.bb-edit-icon, .bb-delete-icon { margin-top: 13px; }
}
h3 {
font-size: 130%;
line-height: 28px;
.bb-edit-icon, .bb-delete-icon { margin-top: 7px; }
}
h2,h3 {
margin-bottom: 0;
position: relative; /* fixes z-order issues, makes whole width clickable */
.bb-edit-icon, .bb-delete-icon {
&.pull-right { margin-right: 5px; }
&.pull-left { margin-left: 4px; margin-right: 3px; }
}
}
.bb-top-buttons {
margin-top: 8px;
.btn-group-vertical {
margin-top: 2px;
& > .checkbox {
margin-bottom: 0;
}
}
/* ensure we can click on them */
position: relative;
z-index: 99;
}
.bb-roundgroup-buttons, .bb-round-buttons {
margin-top: 5px;
margin-bottom: 5px;
}
.bb-rg-chat {
font-size: 50%;
margin-top: 7px;
}
dl {
margin: 0;
&:empty { display: none; }
dt {
.bb-edit-icon { margin-left: 3px; }
}
dd {
position: relative; /* fixes z-order, makes whole width clickable */
.bb-edit-icon { margin-right: 5px; }
.bb-delete-icon { margin-right: 3px; }
}
dt,dd {
.bb-edit-icon, .bb-delete-icon { margin-top: 3px; }
}
}
tr.bb-status-stuck {
background-color: #FF0;
}
.bb-puzzle {
margin-bottom: 0;
th { background: #f8f8f8; }
.bb-edit-icon, .bb-delete-icon {
margin-top: 3px;
}
td .bb-delete-icon.pull-left {
margin-left: -2px;
margin-right: 3px;
}
.puzzle-name > div {
/* relative positioning context for .bb-puzzle-add-move.
* Note that firefox doesn't allow position: relative on a table cell */
position: relative;
}
.puzzle-name .bb-puzzle-add-move {
display: block; width: 14px*3; height: 14px;
position: absolute; right: -2px; top: 3px;
.bb-add-tag, .bb-move-up, .bb-move-down {
float: left;
i { margin-top: 0px; }
}
button {
padding: 0; margin: 0; border: none; text-shadow: none;
line-height: 14px; height: 14px;
}
.bb-add-tag {
display: inline-block; width: 14px; height: 14px;
position: relative;
i { position: absolute; top: 0; left: 0; }
i + i {
top: 3px;
-webkit-transform-origin: bottom left;
-moz-transform-origin: bottom left;
transform-origin: bottom left;
-webkit-transform: scale(0.5);
-moz-transform: scale(0.5);
transform: scale(0.5);
}
}
}
.bb-tag-table {
font-size: 90%;
border-collapse: collapse;
position: relative;/* fixes z-order issues, makes whole width clickable */
&, td, tr { border: none; }
td { padding: 0 3px; margin: 0; }
.bb-edit-icon {
&.pull-left { margin-left: -6px; margin-right: 4px; }
&.pull-right { margin-left: 2px; margin-right: -3px; }
}
}
td,th { padding-top: 0; padding-bottom: 0; }
/* try to make table spacing more-or-less consistent */
td,th {
position: relative; /* fix z-order issues, make whole width clickable */
}
.puzzle-working {
.background { color: #ccc; }
.bb-lots {
.bb-short { display: block; }
.bb-long { display: none; }
}
&, &:hover .bb-lots {
.bb-short { display: none; }
.bb-long { display: block; }
}
}
td.puzzle-update {
font-size: 85%;
}
}
}
.bb-hide-status {
position: fixed;
right: 0;
background: white;
margin-top: 10px;
padding-top: 25px;
padding-bottom: 25px;
-webkit-border-top-left-radius: 6px;
-moz-border-top-left-radius: 6px;
border-top-left-radius: 6px;
-webkit-border-bottom-left-radius: 6px;
-moz-border-bottom-left-radius: 6px;
border-bottom-left-radius: 6px;
border: 1px solid #e5e5e5;
border-right: none;
-webkit-box-shadow: 0 1px 4px rgba(0,0,0,0.065);
-moz-box-shadow: 0 1px 4px rgba(0,0,0,0.065);
box-shadow: 0 1px 4px rgba(0,0,0,0.065);
}
/* special hack for 100% height layout w/ vertical slider,
used on puzzle and round pages */
html.fullHeight {
&, body, #bb-body, #bb-content, .bb-puzzleround,
.bb-splitter, .bb-splitter > .bb-top-content, .bb-splitter iframe {
height: 100%;
}
#bb-body, #bb-content, .bb-puzzleround,
.bb-splitter, .bb-splitter > div, .bb-splitter iframe,
.bb-top-content > div { .border-box; }
/* splitter! */
.bb-puzzleround {
position: relative; /* establish positioning context */
width: 100%;
padding-left: 0px; padding-right: 0px;
.bb-splitter { /* horizontal */
position: relative;
&, & > div { width:100%; }
/* top padding here also anchors the margin in the embedded <h1>
element and fixes an odd-looking 10px shift */
padding-top: 6px; /* for slider (shifted to center) */
padding-bottom: 500px; /* for bottom pane */
& > .bb-top-content {
margin-top: -6px; /* shift extra space to bottom */
}
.bb-top-content, .bb-bottom-header {
padding-left: 2px; padding-right: 2px;
}
.bb-splitter-handle {
background: #ccc url('/img/hgrabber.gif') no-repeat center;
&:hover { background-color: #aaa; }
}
& > .bb-splitter-handle {
height: 6px;
cursor: n-resize;
}
&.active {
& > .bb-splitter-handle { background-color: #e88; }
.bb-top-content, .bb-bottom-content { pointer-events: none; }
}
& > .bb-bottom-content {
position: absolute;
height: 500px;
left: 0; bottom: 0;
.bb-bottom-header {
position: absolute; width: 235px; height: 20px; top: 0; right: 140px;
}
iframe {
padding-top: 0px; /* was 26px, but we're chosing to overlap header */
border-top: none;
}
}
/* vertical splitter in top half */
& > .bb-top-content {
position: relative;
padding-right: 306px; /* for right-hand pane */
& > .bb-top-left-content, & > .bb-top-right-content {
height: 100%;
overflow: auto;
}
& > .bb-splitter-handle {
width: 6px;
background-image: url('/img/vgrabber.gif');
cursor: w-resize;
position: absolute;
top: 0; bottom: 0;
right: 300px;
}
&.active {
& > .bb-splitter-handle { background-color: #e88; }
.bb-top-left-content, .bb-top-right-content { pointer-events: none; }
}
& > .bb-top-right-content {
position: absolute;
width: 300px; right: 0; top: 0;
/* chat stylin' */
background: url('/img/grid_noise.png');
background-attachment: fixed;
overflow: hidden;
.bb-message-container, .bb-chat-messages { .border-box; }
.bb-message-container {
overflow: auto;
position: absolute;
left: 0; right: 0;
top: 0; bottom: 36px;
}
.bb-chat-messages {
padding: 5px 2px 0 2px;
margin-bottom: 0;
}
.bb-chat-footer {
position: absolute;
left: 0; right: 0; margin-left: 0; margin-right: 0;
bottom: 0; height: 36px;
background: url('/img/irongrip.png');
#messageInput { margin-top: 3px; }
}
.bb-chat-pop-out {
position: absolute; top: 0; right: 14px;
background: white;
border: 1px solid #888;
padding-left: 2px; padding-right: 4px;
border-bottom-left-radius: 5px;
}
}
}
}
}
}
/* Responsive
-------------------------------------------------- */
/* tweak heading for narrow displays */
@media (max-width: 1270px) {
#bb-tables.bb-canEdit > h1 .bb-hide-when-narrow { display: none; }
}
@media (max-width: 1114px) {
#bb-tables.bb-canEdit > h1.bb-blackboard-h1 { white-space: nowrap; }
#bb-tables.bb-canEdit > h1 .bb-hide-when-narrower { display: none; }
}
@media (max-width: 1088px) {
#bb-tables > h1 .bb-hide-when-narrow { display: none; }
}
@media (max-width: 942px) {
#bb-tables > h1.bb-blackboard-h1 { white-space: nowrap; }
#bb-tables > h1 .bb-hide-when-narrower { display: none; }
}
/* Desktop large
------------------------- */
@media (min-width: 1200px) {
}
/* Desktop
------------------------- */
@media (max-width: 979px) {
/* navbar becomes unfixed below 980px */
.navbar-fixed-top, .bb-chat-messages { margin-bottom: 0; }
.navbar-fixed-bottom { margin-top: 0; }
.navbar-fixed-top .navbar-inner { padding: 0; }
.bb-chat-messages, .bb-puzzle-round { padding-top: 0 !important; }
.bb-chat-footer { margin-left: -20px; margin-right: -20px; }
#bb-body {
padding-top: 0;
padding-bottom: 0;
}
#bb-tables {
section {
padding-top: 0;
margin-top: 0;
}
}
#bb-sidebar {
.bb-sidenav {
/* unfix sidebar */
position: static;
width: 100%;
}
}
.bb-hide-status {
position: absolute; /* unfix */
}
#bb-right-sidebar {
/* unfix right sidebar */
position: static;
}
/* fixup fullHeight stuff */
html.fullHeight {
body { padding-right: 0; padding-left: 0; }
#bb-content {
& > .bb-topbar {
position: absolute;
top: 0; height: 109px;
left: 0; right: 0; width: auto;
padding: 0;
margin: 0;
}
& > .bb-puzzleround {
position: absolute;
left: 20px; right: 20px; width: auto;
top: 109px; bottom: 3px; height: auto;
padding-top: 0;
}
}
}
}
/* Tablet to desktop
------------------------- */
@media (min-width: 768px) and (max-width: 980px) {
/* Remove any padding from the body */
body {
padding-top: 0;
}
.bb-buttonbar .bb-login { float: right }
.container-fluid > .navbar-fixed-top {
/* compensate for 20px of padding on container-fluid */
margin-left: -20px;
margin-right: -20px;
}
.puzzle-answer, .puzzle-status, .puzzle-working, .puzzle-update {
word-break: break-all;
}
}
/* Tablet
------------------------- */
@media (max-width: 767px) {
/* Remove any padding from the body */
body {
padding-top: 0;
}
#roomName { width:85px; } /* narrow room name input */
.bb-omit-when-narrow, .puzzle-working, .puzzle-update { display: none; }
.bb-buttonbar .bb-login { float: right }
.puzzle-answer { word-break: break-all; }
/* fix up .dl-horizontal styles */
#bb-tables dl {
dt { width: auto; display: inline-block; vertical-align: top; }
dd { margin-left: 0; display: inline-block; }
}
/* Sidenav */
#bb-sidebar {
.bb-sidenav {
width: auto;
margin-bottom: 20px;
&.affix {
position: static;
width: auto;
top: 0;
}
}
}
.bb-hide-status {
display: none;
}
}
@media (min-width: 481px) and (max-width: 979px) {
/* re-fix the chat footer to the bottom */
.bb-chat-footer.navbar-fixed-bottom {
position: fixed;
margin-left: 0; margin-right: 0;
.navbar-inner { padding: 0; }
}
.bb-chat-messages { margin-bottom: 15px+26px; }
}
/* Landscape phones
------------------------- */
@media (max-width: 480px) {
/* Remove padding above jumbotron */
body {
padding-top: 0;
}
#bb-body {
.bb-blackboard-h1 { display: none; }
.bb-lastchat, .bb-lastupdate {
padding-left: 0px;
padding-right: 50px;
font-size: 75%;
& > .left { display: none; }
}
.table-condensed {
th, td {
padding: 2px;
font-size: 75%;
line-height: initial;
}
}
}
}