-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
310 lines (265 loc) · 11.3 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>A @property to unlock the World</title>
<meta name="description" content="Why Houdini is dead, but @property is not">
<meta name="robots" content="noindex, nofollow">
<meta property="og:type" content="article">
<meta property="og:title" content="A @property to unlock the World">
<meta property="og:site_name" content="Why Houdini is dead, but @property is not">
<meta property="og:url" content="https://schepp.github.io/a-property-to-unlock-the-world/">
<meta property="og:image" content="https://schepp.github.io/a-property-to-unlock-the-world/images/captain-america-shield.jpg">
<meta property="article:published_time" content="2019-01-04">
<meta property="article:author" content="https://twitter.com/derSchepp">
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="bower_components/reveal.js/css/reveal.min.css">
<link rel="stylesheet" href="bower_components/reveal.js/css/theme/moon.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="bower_components/reveal.js/lib/css/zenburn.css">
<!-- Custom Styles -->
<link href="https://fonts.googleapis.com/css?family=Bangers" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
<link rel="stylesheet" href="css/extra-styles.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write('<link rel="stylesheet" href="bower_components/reveal.js/css/print/' + (window.location.search.match(/print-pdf/gi) ? 'pdf' : 'paper') + '.css" type="text/css" media="print">');
</script>
<!--[if lt IE 9]>
<script src="bower_components/reveal.js/lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section data-markdown="markdown/slides.md"
data-separator="^-----\n"
data-vertical="^---\n"
data-notes="^Note:"
data-charset="utf-8">
</section>
</div>
</div>
<script src="bower_components/reveal.js/lib/js/head.min.js"></script>
<script src="bower_components/reveal.js/js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
// The "normal" size of the presentation, aspect ratio will be preserved
// when the presentation is scaled to fit different resolutions. Can be
// specified using percentage units.
width: 1920,
height: 1080,
controls: true,
progress: true,
history: true,
center: false,
slideNumber: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none
// Parallax scrolling
// parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg',
// parallaxBackgroundSize: '2100px 900px',
chart: {
defaults: {
global: {
title: {fontColor: "#000"},
tooltip: {bodyFontSize: 20, titleFontSize: 20, backgroundColor: "#000"},
legend: {
labels: {
fontColor: "#000",
fontSize: 20
},
},
},
scale: {
scaleLabel: {
fontColor: "#000",
fontSize: 20
},
gridLines: {color: "#000", zeroLineColor: "#000"},
ticks: {
fontColor: "#000",
fontSize: 20
},
}
},
line: {
borderColor: ["rgba(20,220,220,.8)", "rgba(220,120,120,.8)", "rgba(20,120,220,.8)"],
"borderDash": [[5, 10], [0, 0]]
},
bar: {backgroundColor: ["rgba(20,220,220,.8)", "rgba(220,120,120,.8)", "rgba(20,120,220,.8)"]},
pie: {backgroundColor: [["rgba(0,0,0,.8)", "rgba(220,20,20,.8)", "rgba(20,220,20,.8)", "rgba(220,220,20,.8)", "rgba(20,20,220,.8)"]]},
radar: {borderColor: ["rgba(20,220,220,.8)", "rgba(220,120,120,.8)", "rgba(20,120,220,.8)"]},
},
// Optional libraries used to extend on reveal.js
dependencies: [
{
src: 'bower_components/reveal.js/lib/js/classList.js', condition: function () {
return !document.body.classList;
}
},
{
src: 'bower_components/reveal.js/plugin/markdown/marked.js', condition: function () {
return !!document.querySelector('[data-markdown]');
}
},
{
src: 'bower_components/reveal.js/plugin/markdown/markdown.js', condition: function () {
return !!document.querySelector('[data-markdown]');
}
},
{
src: 'bower_components/reveal.js/plugin/highlight/highlight.js', async: true, callback: function () {
hljs.initHighlightingOnLoad();
}
},
{
src: 'bower_components/reveal.js/plugin/zoom-js/zoom.js', async: true, condition: function () {
return !!document.body.classList;
}
},
{
src: 'bower_components/reveal.js/plugin/notes/notes.js', async: true, condition: function () {
return !!document.body.classList;
}
},
{
src: 'bower_components/reveal.js/plugin/live-coding/live-coding.js',
async: true,
condition: function () {
return !!document.body.classList;
}
},
{src: 'bower_components/reveal.js/plugin/chart/Chart.min.js'},
{src: 'bower_components/reveal.js/plugin/chart/csv2chart.js'}
]
});
</script>
<script>
Reveal.addEventListener( 'ready', () => {
(function(){
//canvas init
var canvas = document.getElementById("canvas");
if (!canvas) return;
var ctx = canvas.getContext("2d");
//canvas dimensions
var W = window.innerWidth;
var H = window.innerHeight;
canvas.width = W;
canvas.height = H;
//snowflake particles
var mp = 25; //max particles
var particles = [];
for(var i = 0; i < mp; i++)
{
particles.push({
x: Math.random()*W, //x-coordinate
y: Math.random()*H, //y-coordinate
r: Math.random()*4+1, //radius
d: Math.random()*mp //density
})
}
//Lets draw the flakes
function draw()
{
ctx.clearRect(0, 0, W, H);
ctx.fillStyle = "rgba(255, 255, 255, 0.8)";
ctx.beginPath();
for(var i = 0; i < mp; i++)
{
var p = particles[i];
ctx.moveTo(p.x, p.y);
ctx.arc(p.x, p.y, p.r, 0, Math.PI*2, true);
}
ctx.fill();
update();
}
//Function to move the snowflakes
//angle will be an ongoing incremental flag. Sin and Cos functions will be applied to it to create vertical and horizontal movements of the flakes
var angle = 0;
function update()
{
angle += 0.01;
for(var i = 0; i < mp; i++)
{
var p = particles[i];
//Updating X and Y coordinates
//We will add 1 to the cos function to prevent negative values which will lead flakes to move upwards
//Every particle has its own density which can be used to make the downward movement different for each flake
//Lets make it more random by adding in the radius
p.y += Math.cos(angle+p.d) + 1 + p.r/2;
p.x += Math.sin(angle) * 2;
//Sending flakes back from the top when it exits
//Lets make it a bit more organic and let flakes enter from the left and right also.
if(p.x > W+5 || p.x < -5 || p.y > H)
{
if(i%3 > 0) //66.67% of the flakes
{
particles[i] = {x: Math.random()*W, y: -10, r: p.r, d: p.d};
}
else
{
//If the flake is exitting from the right
if(Math.sin(angle) > 0)
{
//Enter from the left
particles[i] = {x: -5, y: Math.random()*H, r: p.r, d: p.d};
}
else
{
//Enter from the right
particles[i] = {x: W+5, y: Math.random()*H, r: p.r, d: p.d};
}
}
}
}
}
//animation loop
setInterval(draw, 33);
})();
});
window.CSS.registerProperty({
name: '--multiplier',
syntax: '<number>',
inherits: false,
initialValue: '0'
});
window.CSS.registerProperty({
name: '--cross-fade',
syntax: '<number>',
inherits: false,
initialValue: '0'
});
window.CSS.registerProperty({
name: '--x-zoom',
syntax: '<number>',
inherits: false,
initialValue: 1
});
document.addEventListener('click', (e) => {
const link = e.target.closest('a[href$=".txt"]');
if (!link) return;
const section = link.closest('section[data-markdown]');
if (!section) return;
const editor = section.querySelector('.liveCoding[contenteditable]');
if (!editor) return;
fetch(link.href).then(result => result.text()).then((result) => {
editor.textContent = result;
const keyupEvent = document.createEvent('HTMLEvents');
keyupEvent.initEvent('keyup', false, true);
editor.dispatchEvent(keyupEvent);
const focusoutEvent = document.createEvent('HTMLEvents');
focusoutEvent.initEvent('focusout', false, true);
editor.dispatchEvent(focusoutEvent);
});
e.preventDefault();
}, true);
</script>
</body>
</html>