-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
142 lines (125 loc) · 3.88 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Formation API HTML 5 et CSS 3</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/white.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match(/print-pdf/gi) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName('head')[0].appendChild(link);
</script>
<style>
section > section.past:first-child {
display: block !important;
opacity: 1 !important;
transform: translate(0, 0) !important;
top: 0px !important;
transition: top !important;
}
.reveal section img {
border: none;
outline: 4px solid black;
}
.reveal pre code {
max-height: 460px;
}
.reveal pre {
width: 100%;
}
small, .small {
font-size: 28px !important;
}
.smaller {
font-size: 22px !important;
}
</style>
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-markdown="README.md" data-separator="\n---\r?\n" data-separator-vertical="\n___\r?\n"></section>
</div>
</div>
<script src="js/reveal.js"></script>
<script src="plugin/markdown/marked.js"></script>
<script src="plugin/markdown/markdown.js"></script>
<script>
// More info about config & dependencies:
// - https://github.com/hakimel/reveal.js#configuration
// - https://github.com/hakimel/reveal.js#dependencies
Reveal.initialize({
history : true,
dependencies : [
{ src : 'plugin/notes/notes.js', async : true },
{ src : 'plugin/highlight/highlight.js', async : true, callback : function() { hljs.initHighlightingOnLoad(); } }
],
markdown : {
sanitize : false,
smartypants : false,
}
});
function shaderProgram(gl, vs, fs) {
var prog = gl.createProgram();
var addshader = function(type, source) {
var s = gl.createShader((type == 'vertex') ?
gl.VERTEX_SHADER : gl.FRAGMENT_SHADER);
gl.shaderSource(s, source);
gl.compileShader(s);
if (!gl.getShaderParameter(s, gl.COMPILE_STATUS)) {
throw 'Could not compile '+type+
' shader:\n\n'+gl.getShaderInfoLog(s);
}
gl.attachShader(prog, s);
};
addshader('vertex', vs);
addshader('fragment', fs);
gl.linkProgram(prog);
if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) {
throw 'Could not link the shader program!';
}
return prog;
}
function attributeSetFloats(gl, prog, attr_name, rsize, arr) {
gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(arr),
gl.STATIC_DRAW);
var attr = gl.getAttribLocation(prog, attr_name);
gl.enableVertexAttribArray(attr);
gl.vertexAttribPointer(attr, rsize, gl.FLOAT, false, 0, 0);
}
function initGL() {
try {
const c = document.getElementById('canvas2');
const gl = c.getContext('webgl');
var prog = shaderProgram(gl,
'attribute vec3 pos;'+
'void main() {'+
' gl_Position = vec4(pos, 2.0);'+
'}',
'void main() {'+
' gl_FragColor = vec4(0.5, 0.5, 1.0, 1.0);'+
'}'
);
gl.useProgram(prog);
attributeSetFloats(gl, prog, 'pos', 3, [
-1, 0, 0,
0, 1, 0,
0, -1, 0,
1, 0, 0
]);
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
} catch (e) {
alert('Error: '+e);
}
}
</script>
</body>
</html>