-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
312 lines (306 loc) · 11 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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OFALib</title>
<link rel="stylesheet"
href="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/atom-one-dark.min.css">
<script src="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap');
@import url('https://site-assets.fontawesome.com/releases/v6.3.0/css/all.css');
@import url('modal.css');
.grid-container {
padding: 5px;
display: grid;
width: calc(100vw-15px);
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
grid-gap: 10px;
align-items: start; /* add this line to stretch boxes vertically */
}
body {
margin: 0;
padding: 0;
background-color: #333;
color: white;
font-family: 'Roboto';
}
.grid-item {
width: auto;
height: auto;
background-color: #444;
padding: 5px;
border: 5px solid black;
box-sizing: border-box;
cursor: pointer;
}
.grid-item i {
margin-top: 10px;
}
nav {
margin: 0px;
padding-top: 30px;
padding-left: 30px;
height: 100px;
width: calc(100vw-30px);
background-color: #1a1a1a;
}
nav b {
font-size: 25px;
}
select {
border-radius: 10px; /* round the edges */
padding: 8px; /* add padding per element */
background-color: #333;
color: white;
}
input {
border-radius: 10px; /* round the edges */
padding: 8px; /* add padding per element */
background-color: #333;
color: white;
border: 1px solid #767676;
margin-left: 4px;
}
button {
cursor: pointer;
border-radius: 10px; /* round the edges */
padding: 8px; /* add padding per element */
background-color: #333;
color: white;
border: 1px solid #767676;
transition: font-size 0.25s ease;
}
button:hover {
font-size: 14px;
}
.popup {
position: absolute;
z-index: 9999;
}
footer {
position: fixed;
bottom: 0;
width: 100vw;
height: 5vh;
background-color: #555;
text-align: center;
}
a:visited {
color: lightcoral;
}
a:link {
color: coral;
}
</style>
</head>
<body>
<nav><b><i class="fa-solid fa-book-open-cover"></i> Fico Library (OFALib)</b><center>
<select class=select>
<option value="None">Select one...</option>
<option value="Solid">Solid</option>
<option value="Brands">Brands</option>
<option value="Duotone Solids">Duotone Solids</option>
<option value="Light Solids">Light Solids</option>
<option value="Regular Solids">Regular Solids</option>
<option value="Thin Solids">Thin Solids</option>
</select><input id='search' placeholder='Search'>
<!--select class=sharp>
<option value="No">Smooth</option>
<option value="No2">Sharp - Coming Soon</option>
</select-->
<button id="install">FontAwesome Pro Download</button>
</center></nav>
<span class='content'>
<div class='grid-container'>
<center class='none'>
<h2>No style selected</h2>
</center>
</div>
<div class="modal installbox">
<div class="modal-content">
<span class="close"><i class='fa-solid fa-circle-x'></i></span>
<h2>Installing FontAwesome Pro</h2>
This site is barely updated anymore :/
<pre><code>@import url('https://site-assets.fontawesome.com/releases/v6.6.0/css/all.css');</code></pre>
<pre><code>@import url('https://site-assets.fontawesome.com/releases/v6.6.0/css/sharp-solid.css');</code></pre>
<pre><code>@import url('https://site-assets.fontawesome.com/releases/v6.6.0/css/sharp-thin.css');</code></pre>
<pre><code>@import url('https://site-assets.fontawesome.com/releases/v6.6.0/css/sharp-duotone-solid.css');</code></pre>
<pre><code>@import url('https://site-assets.fontawesome.com/releases/v6.6.0/css/sharp-regular.css');</code></pre>
<pre><code>@import url('https://site-assets.fontawesome.com/releases/v6.6.0/css/sharp-light.css');</code></pre>
<script>hljs.highlightAll();</script>
</div>
</div>
<div class="modal embedding">
<div class="modal-content">
<select name="Style Used" id="eSelect">
<option value="solid">Solids</option>
<option value="brands">Brands</option>
<option value="duotone">Duotone Solids</option>
<option value="light">Light Solids</option>
<option value="regular">Regular Solids</option>
<option value="thin">Thin Solids</option>
</select><br>
<button id="eConfirm">Generate Embed</button>
<pre><code class="language-plaintext" id="eLink"></code></pre>
<a href="https://codepen.io/GavinGoGaming/full/eYLGqWx" style="color: rgb(73, 97, 255);">See the example: <i class="fa-brands fa-codepen"></i> codepen.io/GavinGoGaming/eYLGqWx</a>
</div>
</div>
<div class="modal m2">
<div class="modal-content">
<span class="close"><i class='fa-solid fa-circle-x'></i></span>
<h2 id='mname'>Empty</h2>
ID: <kbd id='mid'>empty</kbd><br>
Categories: <b id='mct'>a, b, c</b><br>
<h3>Use in code</h3>
HTML:
<pre><code id='mhtml'><i class="fa-empty fa-empty"></i></code></pre>
React:
<pre><code id='mreact'><i class="fa-empty fa-empty"></i></code></pre>
Vue:
<pre><code id='mvue'><i class="fa-empty fa-empty"></i></code></pre>
</div>
</div>
</span>
<footer>
<a>Website created by <a href='https://gavingogaming.com'>GavinGoGaming</a></a>
<button id="embed">Embed Fico into your page</button>
</footer>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script async>
let arry = [/*{
id: 'fico-fake-icon',
label: 'Fico / OFALib',
categories: ['Fake Icon - Not in FontAwesome!'],
styles: ['brands', 'duotone', 'light', 'regular', 'solid', 'thin']
}*/];
async function initArry() {
await fetch('https://keho.nl/mb/codepenfiles/fontawesome/v6/v6_icons.json')
.then(res => res.json())
.then(array => {
for(var i__ of array.data.allIcons.icons) {
arry.push(i__);
}
});
}
initArry();
var translations = {
'Brands': 'brands',
'Duotone Solids': 'duotone',
'Light Solids': 'light',
'Regular Solids': 'regular',
'Solid': 'solid',
'Thin Solids': 'thin'
};
var revtranslations = {
'brands': 'Brands',
'duotone': 'Duotone Solids',
'light': 'Light Solids',
'regular': 'Regular Solids',
'solid': 'Solid',
'thin': 'Thin Solids'
};
function folder() {
// return (document.querySelector('.sharp').value == 'Sharp') ?
// 'sharp fa-'+translations[document.querySelector('.select').value]
/*:*/
return translations[document.querySelector('.select').value];
}
var modals = document.querySelectorAll(".modal");
var modal = document.querySelector('.m2');
var ibm = document.querySelector('.installbox');
var span = document.querySelectorAll(".close");
span.forEach(elem => {
elem.onclick = function() {
for (var mdl of modals) {
mdl.style.display = "none";
}
}
});
var mname = document.querySelector('#mname');
var mid = document.querySelector('#mid');
var mreact = document.querySelector('#mreact');
var mvue = document.querySelector('#mvue');
var mhtml = document.querySelector('#mhtml');
var mct = document.querySelector('#mct');
window.onclick = function(event) {
if (modals.forEach(e => event.target == e)) {
for (var mdl of modals) {
mdl.style.display = "none";
}
}
}
function update() {
document.querySelector('.grid-container').innerHTML = '';
for (var itm of arry) {
console.log(itm);
if (itm.styles.includes(folder())) {
if (document.getElementById('search').value === '' ||
itm.label.toLowerCase().includes(document.getElementById('search').value.toLowerCase())) {
var elem = document.createElement('div');
elem.classList.add('grid-item');
elem.innerHTML = `<center><b>${itm.label}</b><br><i class='fa-${folder()} fa-${itm.id} fa-4x'></i></center>`;
var il = "" + itm.label + "";
elem.onclick = function(item) {
return function() {
setIconDetails(item);
modal.style.display = 'block';
};
}(itm);
document.querySelector('.grid-container').appendChild(elem);
}
}
}
}
function setIconDetails(item) {
mname.innerHTML = 'Icon: ' + item.label + `<i style='margin-left: 10px;' class="fa-${folder()} fa-${item.id} fa-2x"></i>`;
mid.textContent = item.id;
mhtml.textContent = `<i class="fa-${folder()} fa-${item.id}"></i>`;
mreact.textContent = `<FontAwesomeIcon icon="fa-${folder()} fa-${item.id}" />`;
mvue.textContent = `<font-awesome-icon icon="fa-${folder()} fa-${item.id}" />`;
var cts = folder();
for(var ctgry of item.categories) {
cts += ', ';
cts += ctgry;
}
mct.textContent = `${cts}`;
hljs.highlightAll();
}
document.querySelector('.select').addEventListener('change', () => {
if (document.querySelector('.select').value == 'None') {
document.querySelector('.grid-container').innerHTML = `
<center class='none'>
<h2>No style selected</h2>
</center>`;
}
update();
});
document.querySelector('#search').addEventListener('input', (e) => {
update();
});
document.querySelector('#install').addEventListener('click', () => {
ibm.style.display = "block";
});
document.querySelector('#eConfirm').addEventListener('click', (e) => {
var code = `https://fico.fly.dev/embeds/${document.querySelector('#eSelect').value}`;
document.querySelector('#eLink').textContent = code;
hljs.highlightAll();
});
document.querySelector('#embed').addEventListener('click', (e) => {
document.querySelector('.embedding').style.display = 'block';
});
const params = new Proxy(new URLSearchParams(window.location.search), {
get: (searchParams, prop) => searchParams.get(prop),
});
function updateUsingParams() {
if(params.style != '' && params.style != undefined && params.style != null) {
$('.select').val(revtranslations[params.style]).change();
update();
}
}
updateUsingParams();
</script>
</body>
</html>