-
Notifications
You must be signed in to change notification settings - Fork 19
/
index.html
160 lines (148 loc) · 5.18 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Kiibohd Controller Wiki</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Input Club Wiki">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/docsify-themeable/dist/css/theme-simple.css">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-100354276-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-100354276-1');
</script>
<style>
:root {
--cover-background-color: #f0f0f0;
--cover-heading-color: #000000;
--link-color: #589cbd;
--link-color--hover: #5fae5a;
--kbd-margin: 0.3em 0 0.3em 0.3em;
--kbd-padding: 0.4em;
}
.markdown-section kbd + kbd {
margin-left: 0 !important;
}
.image_normal, .comparison:hover ~ .image_hover {
display: block;
}
.image_hover, .comparison:hover ~ .image_normal {
display: none;
}
.image_inactive, .toggle:checked ~ .image_active {
display: block;
}
.toggle, .image_active, .toggle:checked ~ .image_inactive {
display: none;
}
input[type="checkbox"] {
display: none;
}
.comparison, input[type="checkbox"] + .btn {
background-color: ##008CBA;
border: 1px solid black;
color: black;
}
.comparison:hover, input[type="checkbox"]:checked + .btn {
background-color: #008CBA;
border: 1px solid white;
color: white;
}
.btn {
padding: 5px 20px;
margin: 5px;
display: inline-block;
border-radius: 5px;
}
</style>
<script type="text/javascript">
let layers = [false, false];
function layerState(e, preview, dir) {
layers[e.value] = e.checked;
let state = 0;
for (var i=layers.length-1; i>=0; i--) {
state = (state<<1) + (layers[i]? 1 : 0);
}
var preview = document.getElementById(preview); //.src = dir + state + ".png";
for (var i=0; i<preview.children.length; i++) {
preview.children[i].style.display = (i == state) ? "inline-block" : "none";
}
}
function parseColor(color) {
return [
parseInt(color.substr(1,2), 16),
parseInt(color.substr(3,2), 16),
parseInt(color.substr(5,2), 16)
];
}
function reverseGamma(gamma, r, g, b) {
return [
Math.round(Math.pow(r/255, 1/gamma) * 255),
Math.round(Math.pow(g/255, 1/gamma) * 255),
Math.round(Math.pow(b/255, 1/gamma) * 255)
];
}
function correctColors(gamma) {
let elements = document.getElementsByClassName("color");
for (var i=0; i<elements.length; i++) {
// Correct for a monitors gamma to better depect the real life led color
let color = parseColor(elements[i].dataset.color);
let rgb = reverseGamma(gamma, color[0], color[1], color[2]);
elements[i].style.backgroundColor = "rgb(" + rgb[0] + ", " + rgb[1] + ", " + rgb[2] + ")";
//elements[i].innerHTML = elements[i].dataset.color;
}
}
</script>
</head>
<body>
<div id="app"></div>
<script src="//unpkg.com/docsify-edit-on-github/index.js"></script>
<script>
window.$docsify = {
name: 'Kiibohd Firmware',
repo: 'https://github.com/kiibohd/controller',
logo: 'https://input.club/wp-content/uploads/2015/04/ic_logo_favi.png',
auto2top: true,
//routerMode: 'history',
coverpage: true,
onlyCover: false,
autoHeader: true,
loadNavbar: true,
//mergeNavbar: true
loadSidebar: true,
subMaxLevel: 2,
plugins: [
EditOnGithubPlugin.create(
'https://github.com/kiibohd/wiki/blob/master/',
undefined,
'📝 Edit'
),
function(hook) {
hook.doneEach(function(html) {
correctColors(2.2);
})
}
]
};
if (typeof navigator.serviceWorker !== 'undefined') {
navigator.serviceWorker.register('sw.js')
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.min.js"></script>
<script src="//unpkg.com/[email protected]/dist/js/docsify-themeable.min.js"></script>
<script src="//unpkg.com/[email protected]/dist/docsify-copy-code.min.js"></script>
<script src="//unpkg.com/[email protected]/dist/docsify-tabs.min.js"></script>
<script src="//unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-c.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-json.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-makefile.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-python.min.js"></script>
</body>
</html>