-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
112 lines (103 loc) · 2.8 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
<!DOCTYPE html>
<html>
<head>
<title>EESUR | NODEBOX SKETCHES</title>
<!-- eesur.com -->
<meta charset="utf-8">
<!-- CSS -->
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600' rel='stylesheet' type='text/css'>
<link href="https://npmcdn.com/[email protected]/css/basscss.min.css" rel="stylesheet">
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, Consolas, monaco, monospace;
font-weight: 500;
line-height: 1.5;
background-color: #a5a6a9;
color: #dfe0e2;
}
a {
text-decoration: none;
}
.disabled {
pointer-events: none;
opacity: 0.4;
}
.max-width-1600 {
max-width: 1600px;
}
.img-wrap {
/*min-height: 230px;*/
background: #dfe0e2;
margin-right: 5px;
margin-left: 5px;
padding-top: 20px;
position: relative;
}
.img-wrap:hover {
background: #f45844;
}
a .img-wrap figcaption {
text-decoration: none;
color: #2f292b;
}
.img-wrap figcaption {
position: relative;
color: #2f292b;
margin-top: 10px;
padding-bottom: 15px;
}
.img-wrap figcaption::after {
content: '→'; /*→*/
position: absolute;
right: -20px;
top: 2px;
color: #eee;
}
</style>
<body>
<header class="max-width-4 mx-auto">
<h1>Daily NodeBox 3 Sketches</h1>
<p class="pb3 max-width-3">Img references for sketches built using NodeBox platform. <br>
Each img links to the NodeBox code file (XML)</p>
</header>
<div class="flex flex-wrap max-width-1600 mx-auto my2 js-ndbx-links"></div>
<script src="//d3js.org/d3.v4.min.js"></script>
<script>
(function() {
d3.queue()
.defer(d3.json, 'codeTree.json')
.defer(d3.json, 'imgTree.json')
.await(ready);
function ready(error, codeTree, imgTree) {
if (error) throw error;
console.log(codeTree[0])
console.log(imgTree[0])
var figure = d3.select('.js-ndbx-links')
.selectAll('a')
.data(imgTree)
.enter().append('a')
.attr('class', 'block col-6')
.attr('href', function(d, i) {
// use the index to ref the code data
return 'https://github.com/eesur/nodebox-daily-sketches/tree/master/' + codeTree[i].path;
})
.append('div')
.attr('class', 'img-wrap')
.append('figure')
figure.append('img')
.attr('class', 'rounded fit')
.attr('src', function(d) {
return d.path;
})
figure.append('figcaption')
.attr('class', 'center')
.text(function(d) {
// return the name minus the extension
var str = d.name;
return str.substring(0, str.length-4);
})
}
})()
</script>
</body>
</html>