Skip to content

Commit 09a4e62

Browse files
author
Ian Prest
committed
Merge pull request #97 from ijprest/fully-generic-legends
Fully generic legends
2 parents 72564b2 + 8f09fbf commit 09a4e62

19 files changed

+552
-210
lines changed

extensions.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,18 @@
9797
return this[this.length-1];
9898
};
9999
}
100+
101+
// Extend array objects with a remove() function that removes elements
102+
// by value; from: http://stackoverflow.com/questions/3954438
103+
Array.prototype.remove = function() {
104+
var what, a = arguments, L = a.length, ax;
105+
while (L && this.length) {
106+
what = a[--L];
107+
while ((ax = this.indexOf(what)) !== -1) {
108+
this.splice(ax, 1);
109+
}
110+
}
111+
return this;
112+
};
113+
100114
}());

kb.css

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ html, body {
2424
-webkit-touch-callout: none;
2525
-webkit-user-select: none;
2626
-moz-user-select: none;
27-
-ms-user-select: none;
27+
-ms-user-select: none;
2828
user-select: none;
2929
cursor: default;
3030
}
@@ -49,8 +49,8 @@ html, body {
4949
/* The keyboard background */
5050
#keyboard {
5151
padding: 9px;
52-
position: relative;
53-
border: solid 1px #ddd;
52+
position: relative;
53+
border: solid 1px #ddd;
5454
border-radius: 6px;
5555
background-color: #eee;
5656
min-height: 56px;
@@ -70,35 +70,42 @@ html, body {
7070

7171
/* Key labels */
7272
.keylabel>div { display: table-cell; position: static !important; }
73-
.keylabel3>div, .keylabel4>div, .keylabel6>div, .keylabel8>div { text-align: right; }
74-
.keylabel7>div, .keylabel8>div { vertical-align: middle; }
75-
.keylabel2>div, .keylabel4>div { vertical-align: bottom; }
76-
.keylabel5, .keylabel6 { top: 100%; margin-top: -1px; font-size: 10px !important; white-space: nowrap; overflow: hidden;}
77-
.keylabel1.centerx-true>div, .keylabel2.centerx-true>div, .keylabel5.centerf-true>div, .keylabel7.centerx-true>div { text-align: center; }
78-
.keylabel1.centery-true>div, .keylabel3.centery-true>div { vertical-align: middle; }
79-
73+
/* Vertical alignment */
74+
.keylabel0>div, .keylabel1>div, .keylabel2>div { vertical-align: top; }
75+
.keylabel3>div, .keylabel4>div, .keylabel5>div { vertical-align: middle; }
76+
.keylabel6>div, .keylabel7>div, .keylabel8>div { vertical-align: bottom; }
77+
.keylabel9, .keylabel10, .keylabel11 { top: 100%; margin-top: -1px; font-size: 10px !important; max-height: 1em !important; white-space: nowrap; overflow: hidden; }
78+
/* Horizontal alignment */
79+
.keylabel0>div, .keylabel3>div, .keylabel6>div, .keylabel9>div { text-align: left; }
80+
.keylabel1>div, .keylabel4>div, .keylabel7>div, .keylabel10>div { text-align: center; }
81+
.keylabel2>div, .keylabel5>div, .keylabel8>div, .keylabel11>div { text-align: right; }
82+
/* Label Sizes */
8083
for i in (1..9) {
8184
.keylabel.textsize{i} {
82-
font-size: (6+2*i)px;
85+
font-size: (6+2*i)px;
8386
line-height: 1em;
8487
}
8588
}
8689
.keylabels { font-family: "Helvetica", "Arial", sans-serif; }
8790
.keylabel hr { display: inline; }
88-
.keylabel hr:before {
89-
position: relative;
90-
display: block;
91-
overflow: hidden;
92-
white-space: nowrap;
93-
content: "\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500";
91+
.keylabel hr:before {
92+
position: relative;
93+
display: block;
94+
overflow: hidden;
95+
white-space: nowrap;
96+
content: "\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500\2500";
9497
}
9598

9699
/* Keycap-Profile Modifications */
97100
.SA .keylabels, .DSA .keylabels {
98101
font-family: 'engravers_gothic_fsregular'; /* substitute for Gorton Modified */
99102
}
100-
101-
.DSA .keylabel5, .DSA .keylabel6, .SA .keylabel5, .SA .keylabel6 { margin-top: -2px; font-size: 9px !important; }
103+
104+
.DSA .keylabel9, .DSA .keylabel10, .DSA .keylabel11,
105+
.SA .keylabel9, .SA .keylabel10, .SA .keylabel11 {
106+
margin-top: -2px;
107+
font-size: 9px !important;
108+
}
102109
.DCS .keytop, .OEM .keytop {
103110
background: linear-gradient(to right, #00000000 0%, #0000001A 40%, #0000001A 60%, #00000000 100%);
104111
background-repeat: no-repeat;
@@ -123,7 +130,7 @@ for i in (1..9) {
123130
}
124131
.DSA.HOMING .keylabels, .SA.HOMING .keylabels { background-image: none; }
125132

126-
span.PETSCII {
133+
span.PETSCII {
127134
font-family: "C64ProMono";
128135
font-size: 6px !important;
129136
border: solid 1px;
@@ -134,14 +141,14 @@ span.PETSCII {
134141

135142
/* color swatches */
136143
#swatches { list-style-type: none; margin: 0px; padding: 0px; }
137-
.swatch {
138-
display: inline-block;
144+
.swatch {
145+
display: inline-block;
139146
position: relative;
140-
width: 16px;
141-
height: 32px;
142-
border: solid 1px #888;
147+
width: 16px;
148+
height: 32px;
149+
border: solid 1px #888;
143150
margin-right: -1px;
144-
margin-bottom: -6px;
151+
margin-bottom: -6px;
145152
padding: 0px;
146153
}
147154
#swatches.disabled .swatch { background-color: rgb(235,235,228) !important; }
@@ -155,7 +162,7 @@ span.PETSCII {
155162
.hidden { display: none; }
156163
.error { border: solid 2px rgb(217,83,79); }
157164
#selectionRectangle { position: absolute; border: dashed 2px red; }
158-
#rotationCrosshairs {
165+
#rotationCrosshairs {
159166
display: none;
160167
position: absolute;
161168
margin: 0px;
@@ -209,12 +216,12 @@ span.PETSCII {
209216
#wrap > .navbar, #wrap > .body > .btn-group, #keyboard ~ *, #keyboard + *, #footer, #helpDialog, #markdownDialog { display: none; margin: 0 !important; padding: 0 !important; }
210217
div.body { margin: 0 !important; padding: 0 !important; }
211218
a { color: black; text-decoration: none; }
212-
#keyboard {
213-
border: none;
214-
background-color: inherit !important;
215-
transform: scale(0.75,0.75);
219+
#keyboard {
220+
border: none;
221+
background-color: inherit !important;
222+
transform: scale(0.75,0.75);
216223
position: absolute !important;
217-
left: 0px;
224+
left: 0px;
218225
top: 0px;
219226
padding-left: 0px; padding-top: 0px;
220227
}
@@ -234,3 +241,10 @@ span.PETSCII {
234241

235242
#swap-colors { position: absolute; top: 11px; left: 200px; z-index: 1; }
236243
.color-name { display: inline-block; min-width: 3em; font-size: 10px; white-space: nowrap; }
244+
245+
.use-default:after {
246+
content: "\d7"; /* × */
247+
right: 0px;
248+
bottom: -4px;
249+
position: absolute;
250+
}

0 commit comments

Comments
 (0)