-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.html
82 lines (68 loc) · 2.22 KB
/
examples.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
<html>
<head>
<title>Elm WebGL Examples</title>
<style>
@import url("https://fonts.googleapis.com/css?family=Raleway");
html {
box-sizing: border-box;
background-image: linear-gradient(141deg, #ddd9c5 0%, #eeeee7 71%, #f8f9f6 100%);
font-size: 16px;
color: #073746;
}
body {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
}
h1, h2 {
margin: 0 0 20px 0;
font-family: "Raleway", BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
font-weight: normal;
line-height: 1.2;
text-transform: none;
text-shadow: none;
word-wrap: break-word;
}
h1 { font-size: 3.77em; }
h2 { font-size: 2.11em; }
main {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
grid-gap: 20px;
}
section {
background-color: rgba(255, 255, 255, 0.15);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.15) !important;
padding: 20px;
display: flex;
align-content: flex-start;
flex-direction: column;
}
section div,
section canvas {
position: relative;
width: 100%;
max-height: 100%;
}
</style>
</head>
<body>
<header><h1>Elm WebGL Examples</h1></header>
<main></main>
<script src="elm.js"></script>
<script>
var apps = Object.keys(Elm).map((key) => {
const section = document.createElement('section')
section.id = key.toLowerCase()
const container = document.createElement('div')
const heading = document.createElement('h2')
heading.innerHTML = `${key}.elm`
const main = document.querySelector('main')
main.appendChild(section)
section.appendChild(heading)
section.appendChild(container)
return Elm[key].embed(container)
})
</script>
</body>
</html>