Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mu/colors #245

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ dist
*.vim*
*.custom
www/public
.vscode
.DS_Store
2 changes: 1 addition & 1 deletion code/layout-analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ window.addEventListener('DOMContentLoaded', () => {
const lvl = (contrast * count) / total;
colormap[key] = impreciseData
? headingColor + `, ${lvl})` // gray scale
: `rgb(127, 127, 255, ${lvl})`; // blue scale
: `rgb(153, 19, 10, ${lvl})`; // scale with shades of --color-palette-e-dark = #99130A
});
keyboard.setCustomColors(colormap);

Expand Down
54 changes: 39 additions & 15 deletions code/x-keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ function newKeyboardLayout(keyMap = {}, deadKeys = {}, geometry = '') {
const KEY_BG = '#f8f8f8';
const SPECIAL_KEY_BG = '#e4e4e4';
const KEY_COLOR = '#333';
const KEY_COLOR_L3 = 'blue';
const KEY_COLOR_L5 = 'green';
const DEAD_KEY_COLOR = 'red';
const KEY_COLOR_L3 = '#0E9595'; // --color-palette-a-dark
const KEY_COLOR_L5 = '#CB8215'; // --color-palette-b-dark
const DEAD_KEY_COLOR = '#77372C'; // --color-palette-d-dark

const KEY_WIDTH = 60; // 1U = 0.75" = 19.05mm = 60px
const KEY_PADDING = 4; // 8px between two key edges
Expand Down Expand Up @@ -912,26 +912,50 @@ const modifiers = `

// color themes
const themes = `
/* Base color palette -- https://coolors.co/9cf6f6-f3c98b-daa588-c46d5e-f56960 */
:root {
--color-palette-a: #9CF6F6;
--color-palette-b: #F3C98B;
--color-palette-c: #DAA588;
--color-palette-d: #C46D5E;
--color-palette-e: #F56960;
}

/* Derived color palette -- when lighter or darker shades are required */
:root {
--color-palette-a-light: #DAFCFC;
--color-palette-b-light: #FBEEDA;
--color-palette-c-light: #F5E7E0;
--color-palette-d-light: #EED7D2;
--color-palette-e-light: #FBC9C5;

--color-palette-a-dark: #0E9595;
--color-palette-b-dark: #CB8215;
--color-palette-c-dark: #9C5630;
--color-palette-d-dark: #77372C;
--color-palette-e-dark: #99130A;
}

g:target rect, .press rect,
g:target path, .press path {
fill: #aad;
fill: var(--color-palette-c);
}

[theme="reach"] .pinkyKey rect { fill: hsl( 0, 100%, 90%); }
[theme="reach"] .numberKey rect { fill: hsl( 42, 100%, 90%); }
[theme="reach"] .letterKey rect { fill: hsl(122, 100%, 90%); }
[theme="reach"] .homeKey rect { fill: hsl(122, 100%, 75%); }
[theme="reach"] .press rect { fill: #aaf; }

[theme="hints"] [finger="m1"] rect { fill: hsl( 0, 100%, 95%); }
[theme="hints"] [finger="l2"] rect { fill: hsl( 42, 100%, 85%); }
[theme="hints"] [finger="r2"] rect { fill: hsl( 61, 100%, 85%); }
[theme="reach"] .numberKey rect { fill: var(--color-palette-a-light); }
[theme="reach"] .letterKey rect { fill: var(--color-palette-b-light); }
[theme="reach"] .homeKey rect { fill: var(--color-palette-d-light); }
[theme="reach"] .press rect { fill: var(--color-palette-c-light); }

[theme="hints"] [finger="m1"] rect { fill: var(--color-palette-a); }
[theme="hints"] [finger="l2"] rect { fill: var(--color-palette-a); }
[theme="hints"] [finger="r2"] rect { var(--color-palette-b); }
[theme="hints"] [finger="l3"] rect,
[theme="hints"] [finger="r3"] rect { fill: hsl(136, 100%, 85%); }
[theme="hints"] [finger="r3"] rect { fill: var(--color-palette-c); }
[theme="hints"] [finger="l4"] rect,
[theme="hints"] [finger="r4"] rect { fill: hsl(200, 100%, 85%); }
[theme="hints"] [finger="r4"] rect { fill: var(--color-palette-d); }
[theme="hints"] [finger="l5"] rect,
[theme="hints"] [finger="r5"] rect { fill: hsl(230, 100%, 85%); }
[theme="hints"] [finger="r5"] rect { fill: var(--color-palette-e); }
[theme="hints"] .specialKey rect,
[theme="hints"] .specialKey path { fill: ${SPECIAL_KEY_BG}; }
[theme="hints"] .hint rect { fill: #a33; }
Expand Down
131 changes: 131 additions & 0 deletions www/assets/css/icons.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
/* Pure CSS-shapes icons taken from https://css.gg/icons */

.gg-software-download {
box-sizing: border-box;
position: relative;
display: inline-block;
transform: scale(var(--ggs, 1));
width: 16px;
height: 6px;
border: 2px solid;
border-top: 0;
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
margin-top: 8px;
}
.gg-software-download::after {
content: "";
display: inline-block;
box-sizing: border-box;
position: absolute;
width: 8px;
height: 8px;
border-left: 2px solid;
border-bottom: 2px solid;
transform: rotate(-45deg);
left: 2px;
bottom: 4px;
}
.gg-software-download::before {
content: "";
display: inline-block;
box-sizing: border-box;
position: absolute;
border-radius: 3px;
width: 2px;
height: 10px;
background: currentColor;
left: 5px;
bottom: 5px;
}

.gg-play-button-o {
box-sizing: border-box;
position: relative;
display: inline-block;
transform: scale(var(--ggs, 1));
width: 22px;
height: 22px;
border: 2px solid;
border-radius: 20px;
}
.gg-play-button-o::before {
content: "";
display: inline-block;
box-sizing: border-box;
position: absolute;
width: 0;
height: 10px;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 6px solid;
top: 4px;
left: 7px;
}

.gg-align-bottom {
box-sizing: border-box;
position: relative;
display: inline-block;
height: 12px;
width: 12px;
border-bottom: 2px solid;
transform: scale(var(--ggs, 1));
margin-top: 4px;
}
.gg-align-bottom::after,
.gg-align-bottom::before {
content: "";
display: inline-block;
box-sizing: border-box;
position: absolute;
width: 4px;
background: currentColor;
bottom: 2px;
}
.gg-align-bottom::before {
left: 1px;
height: 12px;
}
.gg-align-bottom::after {
height: 6px;
right: 1px;
opacity: 0.5;
}

.gg-keyboard {
box-sizing: border-box;
position: relative;
display: inline-block;
transform: scale(var(--ggs, 1));
width: 18px;
height: 18px;
border: 2px solid;
border-radius: 3px;
}
.gg-keyboard::after,
.gg-keyboard::before {
content: "";
display: inline-block;
box-sizing: border-box;
position: absolute;
height: 2px;
border-radius: 4px;
background: currentColor;
}
.gg-keyboard::before {
top: 2px;
box-shadow:
4px 0 0,
8px 0 0,
0 4px 0,
4px 4px 0,
8px 4px 0;
width: 2px;
left: 2px;
}
.gg-keyboard::after {
width: 8px;
bottom: 2px;
left: 3px;
}
Loading