-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
229 lines (188 loc) · 9.97 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
<!doctype html>
<html>
<head>
<title>WaveDraw</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="lib/bootstrap/dist/css/bootstrap-theme.css" />
<link rel="stylesheet" href="lib/jquery-ui/themes/dot-luv/jquery-ui.css" />
<link rel="stylesheet" href="lib/jquery-ui/themes/dot-luv/jquery.ui.theme.css" />
<link rel="stylesheet" href="lib/select2/select2.css" />
<link rel="stylesheet" href="css/main.css" />
</head>
<body ng-app="waveDraw">
<div id="overlay">
<div class="body">
<h1>Loading...</h1>
</div>
</div>
<div class="toolbar" ng-controller="toolbarCtrl" ng-cloak>
<span class="{{getGalleryStateClass()}}"></span>
<a href="" title="{Ctrl+G}" ng-click="toggleGallery()">Gallery</a>
<span class="{{getControlPanelStateClass()}}"></span>
<a href="" title="{Ctrl+C}" ng-click="toggleControlPanel()">Controls</a>
<!--<a download="image.png" href="" target="_blank" title="Can crash Chrome :/"
onclick="this.setAttribute('href', document.getElementById('viewport').toDataURL());">Download</a>
-->
<a href="" title="{Ctrl+S}" ng-click="download()">Download</a>
<a href="" title="{F11}" ng-click="fullScreen()">Full screen</a>
<a href="" title="{Ctrl+Z}" class="clear" ng-click="reset()">Clear</a>
<span class="pause" ng-show="running && particles"></span>
<a href="" title="{Ctrl+Space}" class="pause" ng-click="toggle()" ng-show="running && particles">Pause</a>
<span class="resume" ng-show="!running && particles"></span>
<a href="" title="{Ctrl+Space}" class="resume" ng-click="toggle()" ng-show="!running && particles">Resume</a>
<div class="save">
<form ng-submit="save()">
<input type="text" placeholder="preset name" ng-model="presetName" />
<button class="btn btn-primary" type="submit" ng-disabled="!presetName">Save</button>
</form>
</div>
<img class="working" src="working.gif" ng-show="working" />
<img class="done" src="done.gif" ng-show="done" />
<div class="pull-right indicator {{getIndicatorClass()}}"></div>
<div class="pull-right particles {{getIndicatorClass()}}">{{particles}} particles</div>
<div class="pull-right fps" ng-show="fps > 0" style="{{getFpsColor()}}">{{fps}} fps</div>
</div>
<canvas id="viewport"></canvas>
<div class="gallery clearfix" ng-controller="galleryCtrl" ng-show="showGallery" ng-cloak>
<div class="preset" ng-repeat="(name, preset) in presets">
<div class="body {{selected}}" ng-click="select(name)">
<div class="name">{{name}}</div>
<img src="" ng-show="preset.preview" ng-src="{{preset.preview}}" />
</div>
</div>
</div>
<div class="control-panel clearfix" ng-controller="controlPanelCtrl" ng-show="showControlPanel" ng-cloak>
<div class="block hack">
<h3>Drawing</h3>
<div class="slider" ui-slider="{ min: 0, max: 999 }" ng-model="preset.delay">
<label>Delay</label>
<input type="text" maxlength="3" ng-model="preset.delay" />
</div>
<div class="slider" ui-slider="{ min: 1, max: 100 }" ng-model="preset.drawOpacity">
<label>Draw opacity</label>
<input type="text" maxlength="3" class="slider-start-value" ng-model="preset.drawOpacity" />
</div>
<label>
<input type="checkbox" ng-model="preset.persistence" />
<span>Persistence</span>
</label>
</div>
<div class="block">
<h3>Particles</h3>
<div class="slider" ui-slider="{ min: 1, max: 999 }" ng-model="preset.count">
<label>Number (performance!)</label>
<input type="text" maxlength="3" ng-model="preset.count" />
</div>
<div class="slider" ui-slider="{ min: 1, max: 999 }" ng-model="preset.ttl">
<label>Lifetime (performance!)</label>
<input type="text" maxlength="3" ng-model="preset.ttl" />
</div>
<label>
<input type="checkbox" ng-model="preset.reflection" />
<span>Screen edge reflection</span>
</label>
</div>
<div class="block">
<h3>Physics</h3>
<div class="slider" ui-slider="{ min: 0.1, max: 10, step: 0.1 }" ng-model="preset.velocity">
<label>Diffusion</label>
<input type="text" maxlength="3" ng-model="preset.velocity" />
</div>
<div class="slider" ui-slider="{ min: -9, max: 9, step: 0.1 }" ng-model="preset.rotation">
<label>Rotation</label>
<input type="text" maxlength="3" ng-model="preset.rotation" />
</div>
<div class="slider" ui-slider="{ min: 0, max: 10, step: 0.1 }" ng-model="preset.friction">
<label>Friction</label>
<input type="text" maxlength="3" ng-model="preset.friction" />
</div>
</div>
<div class="block">
<h3>Particle size</h3>
<div class="slider" ui-slider="{ min: 1, max: 10 }" ng-model="preset.particleSize">
<input type="text" maxlength="3" ng-model="preset.particleSize" />
</div>
</div>
<hr />
<div class="block hack">
<h3>Color range</h3>
<div class="slider" ui-slider="{ range: true, min: 0, max: 255 }" ng-model="preset.r.range">
<div class="color red">R</div>
<input type="text" maxlength="3" class="slider-start-value" ng-model="preset.r.range[0]" />
<input type="text" maxlength="3" class="slider-end-value" ng-model="preset.r.range[1]" />
</div>
<div class="slider" ui-slider="{ range: true, min: 0, max: 255 }" ng-model="preset.g.range">
<div class="color green">G</div>
<input type="text" maxlength="3" class="slider-start-value" ng-model="preset.g.range[0]" />
<input type="text" maxlength="3" class="slider-end-value" ng-model="preset.g.range[1]" />
</div>
<div class="slider" ui-slider="{ range: true, min: 0, max: 255 }" ng-model="preset.b.range">
<div class="color blue">B</div>
<input type="text" maxlength="3" class="slider-start-value" ng-model="preset.b.range[0]" />
<input type="text" maxlength="3" class="slider-end-value" ng-model="preset.b.range[1]" />
</div>
</div>
<div class="block">
<h3>Mod. speed (s)</h3>
<div class="slider" ui-slider="{ min: 0.1, max: 2, step: 0.05 }" ng-model="preset.r.velocity">
<input type="text" maxlength="3" class="slider-start-value" ng-model="preset.r.velocity" />
</div>
<div class="slider" ui-slider="{ min: 0.1, max: 2, step: 0.05 }" ng-model="preset.g.velocity">
<input type="text" maxlength="3" class="slider-start-value" ng-model="preset.g.velocity" />
</div>
<div class="slider" ui-slider="{ min: 0.1, max: 2, step: 0.05 }" ng-model="preset.b.velocity">
<input type="text" maxlength="3" class="slider-start-value" ng-model="preset.b.velocity" />
</div>
</div>
<div class="block">
<h3>Mod. phase</h3>
<div class="slider" ui-slider="{ min: -90, max: 90 }" ng-model="preset.r.phase">
<input type="text" maxlength="3" class="slider-start-value" ng-model="preset.r.phase" />
</div>
<div class="slider" ui-slider="{ min: -90, max: 90 }" ng-model="preset.g.phase">
<input type="text" maxlength="3" class="slider-start-value" ng-model="preset.g.phase" />
</div>
<div class="slider" ui-slider="{ min: -90, max: 90 }" ng-model="preset.b.phase">
<input type="text" maxlength="3" class="slider-start-value" ng-model="preset.b.phase" />
</div>
</div>
<hr />
<div class="block big">
<h3>Effects</h3>
<select class="select2 big" multiple ui-select2="{ multiple: true }" ng-model="preset.processing.effects">
<option ng-repeat="(name, p) in processing" value="{{name}}">{{name}}</option>
</select>
</div>
<div class="block">
<h3>Effect params.</h3>
<div class="slider" ui-slider="{ min: -10, max: 10, step: 0.1 }" ng-model="preset.processing.params[0]">
<input type="text" maxlength="3" ng-model="preset.processing.params[0]" />
</div>
<div class="slider" ui-slider="{ min: -10, max: 10, step: 0.1 }" ng-model="preset.processing.params[1]">
<input type="text" maxlength="3" ng-model="preset.processing.params[1]" />
</div>
<div class="slider" ui-slider="{ min: -10, max: 10, step: 0.1 }" ng-model="preset.processing.params[2]">
<input type="text" maxlength="3" ng-model="preset.processing.params[2]" />
</div>
</div>
<div class="block">
<h3>Renderers</h3>
<select class="select2" multiple ui-select2="{ multiple: true }" ng-model="preset.renderers">
<option ng-repeat="name in renderers" value="{{name}}">{{name}}</option>
</select>
</div>
</div>
<iframe id="download-iframe" style="display: none;"></iframe>
<script data-main="app/main" src="lib/requirejs/require.js"></script>
</body>
</html>