-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.html
230 lines (213 loc) · 6.01 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
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
<html>
<head>
<title>Pixie Chroma by Lixie Labs</title>
<link rel="icon" href="extras/img/favicon.ico" sizes="any">
<link rel="apple-touch-icon" href="extras/img/apple_favicon.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@800&family=Source+Sans+Pro:wght@200;400;900&display=swap" rel="stylesheet">
<style>
body{
color:#cccccc;
background-color:#080808;
margin:0px;
padding:0px;
font-family: 'Source Sans Pro', sans-serif;
}
a{
color:#ff5c93;
text-decoration:none;
}
#logo {
height: 30px;
margin-left: 10px;
margin-top: 11px;
margin-right: 12px;
}
#content_frame{
width:100%;
height:calc(100% - 77px);
border:none;
}
#header{
max-height: 75px;
background-color: #181818;
border-bottom: 2px dotted #666;
}
#view_directly{
float: right;
margin-top: 18px;
margin-right: 15px;
color: #888;
font-size: 16px;
text-transform: uppercase;
}
#view_directly:hover{
color: #ff5c93;
cursor: pointer;
text-decoration:underline;
}
.menu_link {
font-family: 'Raleway', sans-serif;
display: inline-block;
height: 20px;
position: relative;
top: -10px;
padding-top: 5px;
padding-bottom: 1px;
padding-left: 8px;
padding-right: 8px;
color: #000;
background-color: #ff5c93;
margin-right: 12px;
text-transform: uppercase;
font-size: 14px;
margin-bottom: 5px;
}
.menu_link_highlight {
background-color: #fbdb00;
}
.menu_link_select{
background-color: #ffb5ce;
}
.menu_link:hover{
background-color: #cccccc;
cursor:pointer;
}
.menu_link_highlight:hover{
background-color: #fff39f;
cursor:pointer;
}
#logo_container{
display: inline-block;
max-width: 430px;
overflow: hidden;
}
.noselect {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Old versions of Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
supported by Chrome, Edge, Opera and Firefox */
}
</style>
</head>
<body>
<div id="header">
<span id="logospan">
<div id="logo_container">
<a href="https://connornishijima.github.io/Pixie_Chroma/">
<img src="extras/img/logo.png" id="logo"/>
</a>
</div>
</span>
<span id="menu_links" class="noselect"></span>
<span id="view_directly" onclick="load_frame_source();">View Page Directly</span>
</div>
<iframe id="content_frame" name="content_frame" src="about.html"></iframe>
<script>
var menu_links = [
{
"name":"About",
"short":"about",
"link":"about.html",
"target":"content_frame"
},
{
"name":"Getting Started",
"short":"getting-started",
"link":"getting_started.html",
"target":"content_frame"
},
{
"name":"Library Documentation",
"short":"docs",
"link":"docs/class_pixie_chroma.html",
"target":"content_frame"
},
{
"name":"Datasheet",
"short":"datasheet",
"link":"extras/datasheet.html",
"target":"content_frame"
},
{
"name":"Shortcodes",
"short":"shortcodes",
"link":"extras/shortcode_library.html",
"target":"content_frame"
},
{
"name":"OSHW",
"short":"oshw",
"link":"https://github.com/connornishijima/Pixie_Chroma/tree/main/extras/OSHW#readme",
"target":"window"
},
{
"name":"GitHub",
"short":"github",
"link":"https://github.com/connornishijima/Pixie_Chroma/#readme",
"target":"window"
},
{
"name":"PURCHASE",
"short":"purchase",
"link":"extras/purchase.html",
"target":"content_frame"
},
];
function update_page(section){
var elements = document.getElementsByClassName('menu_link menu_link_select');
while(elements.length > 0){
elements[0].classList.remove('menu_link_select');
}
for(x in menu_links){
var _link = menu_links[x]["link"];
var _short = menu_links[x]["short"];
var _target = menu_links[x]["target"];
var _name = menu_links[x]["name"];
if(_short == section && _target == "content_frame"){
let stateObj = { id: "100" };
window.history.replaceState(stateObj, _name, '/Pixie_Chroma/?section='+_short);
document.getElementById(_short).className += " menu_link_select";
document.getElementById("content_frame").src = _link;
}
}
}
var menu_string = "";
for(x in menu_links){
var _link = menu_links[x]["link"];
var _target = menu_links[x]["target"];
var _name = menu_links[x]["name"];
var _short = menu_links[x]["short"];
var div_class = "menu_link";
if(_short == "purchase"){
div_class = "menu_link menu_link_highlight";
}
menu_string += '<a href="' + _link + '" target="' + _target + '" class="' + div_class + '" id="' + _short + '" onclick="update_page(\'' + _short + '\');">' + _name + '</a>\n';
}
console.log(menu_string);
document.getElementById("menu_links").innerHTML = menu_string;
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
if(urlParams.has('section')){
const section = urlParams.get('section');
for(x in menu_links){
var _link = menu_links[x]["link"];
var _short = menu_links[x]["short"];
var _target = menu_links[x]["target"];
var _name = menu_links[x]["name"];
if(_short == section && _target == "content_frame"){
document.getElementById(_short).className += " menu_link_select";
document.getElementById("content_frame").src = _link;
}
}
console.log("section: "+section);
}
function load_frame_source(){
location.assign(document.getElementById("content_frame").src);
}
</script>
</body>
</html>