generated from ceeoinnovations/product-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
57 lines (51 loc) · 2.45 KB
/
index.js
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
import MainPage from './components/MainPage.js';
import ProjectPage from './components/ProjectPage.js';
import Navbar from './components/Navbar.js';
Promise.all([
d3.csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vT-zPPHh9Ete3XXUORGYBNQrCNCH0ooozM1zM9mi2PB5bG3hcqXz9_rQx80z8tLFe33QVZPuELZWS9y/pub?output=csv"),
d3.csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vQ6kGJZhyGiIsk-vzAj3gOOmdimxtoo0c5x4DGWb_1I1dZuuNxprORaPzaNShMKUikqjkegV6fm3r3k/pub?output=csv"),
d3.csv("https://docs.google.com/spreadsheets/d/e/2PACX-1vS4A7YN0Q9PftzDncQePwHI-XvH12oK5t3ckeRMj4K0nweJuXQ6TzMrwjNxotHwGKTtyDi_CjF6uZ-G/pub?output=csv"),
])
.then(([about, themes, projects]) => {
const data = {about, themes, projects};
console.log(data);
// determine what page to render
let params = new URLSearchParams(window.location.search);
if (params.get('project')==null){
MainPage(data);
}else{
let project = data.projects.find(d=>d.title===params.get('project'));
Navbar('project')
ProjectPage(project, data.projects);
lightGallery(document.getElementById('lightgallery'), {
plugins: [lgZoom, lgThumbnail, lgVideo],
speed: 500,
thumbnail: true
});
// apply HighlightJS
// hljs.highlightAll();
setTimeout(function () {
var pres = document.querySelectorAll("pre>code");
for (var i = 0; i < pres.length; i++) {
hljs.highlightBlock(pres[i]);
}
var options = {
contentSelector: ".container",
// Delay in ms used for `setTimeout` before badging is applied
// Use if you need to time highlighting and badge application
// since the badges need to be applied afterwards.
// 0 - direct execution (ie. you handle timing
loadDelay:0,
// CSS class(es) used to render the copy icon.
copyIconClass: "fa fa-copy",
// CSS class(es) used to render the done icon.
checkIconClass: "fa fa-check text-success",
// hook to allow modifying the text before it's pasted
onBeforeTextCopied: function(text, codeElement) {
return text; // you can fix up the text here
}
};
window.highlightJsBadge(options);
},10);
}
});