-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
192 lines (182 loc) · 8.81 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Creative Coding Workshop</title>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
<!-- CodeMirror -->
<script src="./libraries/jshint.js"></script>
<script src="./libraries/codemirror.js"></script>
<script src="./libraries/codemirror-lint.js"></script>
<script src="./libraries/codemirror-js-mode.js"></script>
<script src="./libraries/codemirror-active-line.js"></script>
<script src="./libraries/codemirror-close-brackets.js"></script>
<script src="./libraries/codemirror-javascript-lint.js"></script>
<link rel="stylesheet" href="./libraries/codemirror.css">
<link rel="stylesheet" href="./libraries/codemirror-lint.css">
<link rel="stylesheet" href="./libraries/codemirror-solarized.css">
<!-- Tachyons -->
<link rel="stylesheet" href="./libraries/tachyons.min.css">
<!-- Processing -->
<script src="./libraries/p5.min.js"></script>
<script src="./libraries/p5.dom.min.js"></script>
<script src="./libraries/p5.sound.min.js"></script>
<!-- Custom styles -->
<style>
.bg-solarized-base03 { background-color: #002b36; }
.bg-solarized-base02 { background-color: #073642; }
.bg-solarized-base01 { background-color: #586e75; }
.bg-solarized-base00 { background-color: #657b83; }
.bg-solarized-base0 { background-color: #839496; }
.bg-solarized-base1 { background-color: #93a1a1; }
.bg-solarized-base2 { background-color: #eee8d5; }
.bg-solarized-base3 { background-color: #fdf6e3; }
.bg-solarized-yellow { background-color: #b58900; }
.bg-solarized-orange { background-color: #cb4b16; }
.bg-solarized-red { background-color: #dc322f; }
.bg-solarized-magenta { background-color: #d33682; }
.bg-solarized-violet { background-color: #6c71c4; }
.bg-solarized-blue { background-color: #268bd2; }
.bg-solarized-cyan { background-color: #2aa198; }
.bg-solarized-green { background-color: #859900; }
.solarized-base03 { color: #002b36; }
.solarized-base02 { color: #073642; }
.solarized-base01 { color: #586e75; }
.solarized-base00 { color: #657b83; }
.solarized-base0 { color: #839496; }
.solarized-base1 { color: #93a1a1; }
.solarized-base2 { color: #eee8d5; }
.solarized-base3 { color: #fdf6e3; }
.b--solarized-base03 { border-color: #002b36; }
.b--solarized-base02 { border-color: #073642; }
.b--solarized-base01 { border-color: #586e75; }
.b--solarized-base00 { border-color: #657b83; }
.b--solarized-base0 { border-color: #839496; }
.b--solarized-base1 { border-color: #93a1a1; }
.b--solarized-base2 { border-color: #eee8d5; }
.b--solarized-base3 { border-color: #fdf6e3; }
</style>
</head>
<body class="code solarized-base03">
<main class="cf">
<section id="gallery" class="fl w-50 vh-100 overflow-scroll bg-solarized-base3">
<section class="pa4 pb0">
<div class="pre lh-copy overflow-hidden">
/**
* Creative Coding with p5.js
*
* “For many decades, computers have been more than enhanced
* calculators. They’re media machines, they’re imagination
* engines, computers are tools for thought, and they’re
* design machines. Computers are a unique and emerging
* medium for the visual arts.” — Casey Reas
*
*/
</div>
</section>
<section class="pa4">
<div class="pre lh-copy overflow-hidden">
// DRAWING
Drawing with code is a lot like drawing on a graph paper.
You have a grid of points or *pixels* laid out on x and y
axis. Each pixel is described by two properties: its
position and color.
In these examples, we'll explore drawing and coloring shapes.
</div>
<img class="w-100 pa2 mv4 border-box ba" src="./shapes.png">
<div class="cf">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="001" src="./examples/001.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="002" src="./examples/002.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="003" src="./examples/003.png">
</div>
<img class="w-100 pa2 mv4 border-box ba" src="./colors.png">
<div class="cf">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="004" src="./examples/004.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="005" src="./examples/005.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="006" src="./examples/006.png">
</div>
</section>
<section class="pa4">
<div class="pre lh-copy overflow-hidden">
// REPETITION
Using loops and variables, we can create repetitive shapes
and make simple animations. These examples will explore
how to create and update variables and how to repeat drawings
with a *for* loop.
</div>
<div class="cf">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="007" src="./examples/007.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="008" src="./examples/008.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="009" src="./examples/009.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="010" src="./examples/010.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="011" src="./examples/011.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="012" src="./examples/012.png">
</div>
</section>
<section class="pa4">
<div class="pre lh-copy overflow-hidden">
// INTERACTION
Sketches can take input from the mouse and keyboard.
</div>
<div class="cf">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="013" src="./examples/013.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="014" src="./examples/014.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="015" src="./examples/015.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="016" src="./examples/016.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="017" src="./examples/017.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="018" src="./examples/018.png">
</div>
</section>
<section class="pa4">
<div class="pre lh-copy overflow-hidden">
// TRANSFORMS
Transforms let you translate, rotate and scale the
coordinate system.
</div>
<div class="cf">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="019" src="./examples/019.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="020" src="./examples/020.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="021" src="./examples/021.png">
</div>
</section>
<section class="pa4">
<div class="pre lh-copy overflow-hidden">
// EXAMPLES
</div>
<div class="cf">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="022" src="./examples/022.png">
<img class="fl w-third pa2 dim pointer border-box example-image" data-src="023" src="./examples/023.png">
</div>
</section>
</section>
<section id="playground" class="fl w-50 vh-100 relative">
<textarea
id="editor"
class="fl w-100 vh-50">
</textarea>
<div id="controls" class="absolute z-max mt3 mr3 top-0" style="right:0%">
<button
id="runner"
class="f6 link dim ph3 pv2 dib white bg-solarized-yellow pointer bn"
type="button"
title="Run sketch (⌘ + Enter)">
▶
</button>
<button
id="zenmode"
class="f6 link dim ph3 pv2 dib white bg-solarized-yellow pointer bn"
type="button">
Zen mode
</button>
</div>
<iframe
id="preview"
class="fl w-100 vh-50 bn"
sandbox="allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-forms allow-modals">
</iframe>
</section>
</main>
<script src="./app.js"></script>
</body>
</html>