forked from connornishijima/Pixie_Chroma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
172 lines (160 loc) · 4.75 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
<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 solid #242424;
}
.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_select{
background-color: #ffb5ce;
}
.menu_link:hover{
background-color: #cccccc;
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>
</div>
<iframe id="content_frame" name="content_frame" src="https://connornishijima.github.io/Pixie_Chroma/docs/class_pixie_chroma.html"></iframe>
<script>
var menu_links = [
{
"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":"GitHub",
"short":"github",
"link":"https://github.com/connornishijima/Pixie_Chroma/#readme",
"target":"window"
},
];
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";
}
}
}
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"];
menu_string += '<a href="' + _link + '" target="' + _target + '" class="menu_link" 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);
}
</script>
</body>
</html>