-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
214 lines (190 loc) · 7.71 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
<!doctype html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0;'>
<meta charset="UTF-8">
<title>Loading...</title>
<link rel="stylesheet" href="https://cdn.rawgit.com/hakimel/reveal.js/master/css/reveal.css">
<link rel="stylesheet" href="https://cdn.rawgit.com/hakimel/reveal.js/master/css/theme/white.css">
<style>
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTYnF5uFdDttMLvmWuJdhhgs.ttf) format('truetype');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf) format('truetype');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSonF5uFdDttMLvmWuJdhhgs.ttf) format('truetype');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(https://fonts.gstatic.com/s/opensans/v13/k3k702ZOKiLJc3WVjuplzInF5uFdDttMLvmWuJdhhgs.ttf) format('truetype');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 800;
src: local('Open Sans Extrabold'), local('OpenSans-Extrabold'), url(https://fonts.gstatic.com/s/opensans/v13/EInbV5DfGHOiMmvb1Xr-honF5uFdDttMLvmWuJdhhgs.ttf) format('truetype');
}
* {
font-family: 'Open Sans' !important;
}
h1, h2, h3, h4, h5 {
font-family: Open Sans,'Helvetica Neue',Arial,Helvetica,sans-serif;
}
#book .main-content h1 {
font-weight: 900;
font-size: 4rem;
font-variant: small-caps;
}
#book .main-content h2 {
font-weight: 900;
font-size: 3rem;
font-variant: small-caps;
}
#book .main-content h3 {
font-weight: 900;
font-size: 2.25rem;
font-variant: small-caps;
}
#book .main-content h4 {
font-weight: 900;
font-size: 2rem;
font-variant: small-caps;
margin-top: 0;
margin-bottom: 0;
}
#book .main-content h5 {
font-weight: 900;
font-size: 1.75rem;
font-variant: small-caps;
margin-top: 0;
margin-bottom: 0;
}
#book .main-content h6 {
font-weight: 900;
font-size: 1.5rem;
font-variant: small-caps;
margin-top: 0;
margin-bottom: 0;
}
#book .main-content * {
font-family: Open Sans,'Helvetica Neue',Arial,Helvetica,sans-serif;
}
</style>
</head>
<body id="book" style="height: 100%;">
<div class="book-wrap" style="height: 100%;">
<div class="book-wrap__inner" style="height: 100%;">
<div class="book__col" style="display: none;">
<div class="book__colwrap ui menu inverted vertical" id="st-menu">
<div class="item colheader colitem">
<h1 id="title" class="title colheader__title">Loading...</h1>
<br>
<div class="description" id="desc">Loading...</div>
<br>
</div>
</div>
</div><!-- book__col -->
<div class="book__content js-reveal reveal" style="height: 100%;">
<div class="main-content js-content slides" style="padding-bottom: 100px; height: 100%;" id="main-content">
</div>
<div class="ui container stackable grid main-content" style="margin-top:50px; width: 100%; position: fixed; bottom: 0; left: 0; text-align: center;" id="footer">
<div class="one column row">
<div class="column" style="font-size:16px;text-align: center;">
<div class="description">
<span>Built by your boy</span>
<strong>
<a href="https://twitter.com/the_taqquikarim" target="_blank">Taq Karim</a>
</strong>
<span>with</span>
<strong>
<a href="https://github.com/chjj/marked" target="_blank">marked.js</a>,
</strong>
<strong>
<a href="https://highlightjs.org/" target="_blank">highlight.js</a>,
</strong>
<strong>pullups</strong>,
<strong>
<a href="https://open.spotify.com/track/37zu8c48O3qVkkAlfaQzj1" target="_blank">BTS</a>,
</strong>
<span>and a</span>
<strong><a href="http://www.amazon.com/A-Heartbreaking-Work-Staggering-Genius/dp/0375725784/ref=cm_cr_pr_product_top?ie=UTF8" target="_blank">Heartbreaking Work of Staggering Genius</a></strong>.
</div>
<div>
<b>Note:</b> This theme was built specifically for use in GA classrooms. <a href="http://mottaquikarim.github.io/eggers2.0/" target="_blank">Eggers</a> is a product created by Taq Karim.
</div>
</div>
</div>
</div>
</div><!-- book__content -->
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/highlight.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/marked/0.3.5/marked.min.js"></script>
<script src="https://cdn.rawgit.com/hakimel/reveal.js/master/js/reveal.js"></script>
<script>
function getJSON() {
var content = "EGGERS_CONTENTS.json";
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('GET', content);
xhr.addEventListener('load', function(e) {
resolve( JSON.parse(e.currentTarget.responseText) );
});
xhr.addEventListener('error', function(e) {
reject(e)
});
xhr.send();
});
}
function updateHTML( key, data ) {
var content = marked( data[ key ].content );
document.getElementById('main-content').innerHTML = content;
var all = document.querySelectorAll('pre code');
[].slice.call( all ).forEach(function(el) {
hljs.highlightBlock( el );
});
}
getJSON().then(function(data) {
console.log( data );
var list = data.__list__;
const content = document.getElementById('main-content');
list.forEach(function(item, index) {
var str = item.replace(/\-/g, ' ');
var processed = str.slice(0,1).toUpperCase() + str.slice(1);
if ( processed === 'Title' ) {
var info = marked( data[ 'Title'.toLowerCase() ].content );
document.getElementById('title').innerHTML = info;
document.querySelector('title').innerHTML = document.getElementById('title').innerText || document.getElementById('title').textContent;
return;
}
if ( processed === 'Desc' ) {
var info = marked( data[ 'Desc'.toLowerCase() ].content );
document.getElementById('desc').innerHTML = info;
return;
}
processed = processed.toLowerCase();
console.log(data, data[processed])
var htmlcontent = marked( data[processed].content );
const section = document.createElement('section');
section.innerHTML = htmlcontent;
content.appendChild(section);
});
Reveal.initialize();
//updateHTML( list[0], data );
});
</script>
</body>
</html>