-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·239 lines (202 loc) · 11.6 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
230
231
232
233
234
235
236
237
238
239
<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<title>Motif</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="css/fonts.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script type="text/javascript" src="lib/jquery-2.1.1.min.js"></script>
<script src="lib/materialize.min.js"></script>
<script language="javascript" src="lib/angular.js"></script>
<script language="javascript" type="text/javascript" src="lib/p5.js"></script>
<script language="javascript" src="lib/p5.dom.js"></script>
<script language="javascript" src="lib/p5.sound.js"></script>
<script language="javascript" src="js/p5.motif.js"></script>
<script language="javascript" src="js/sketch.js"></script>
<script language="javascript" src="js/app.js"></script>
<script language="javascript" src="js/directives.js"></script>
<script language="javascript" src="js/objects.js"></script>
<script language="javascript" src="js/inputs.js"></script>
<script language="javascript" src="js/effects.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta content="utf-8" http-equiv="encoding">
</head>
<body ng-app="motif" ng-controller="mainCtrl" ng-init="init()">
<!--<nav class="blue-grey lighten-4" role="navigation">
<div class="nav-wrapper container">
<a id="logo-container" href="#" class="brand-logo">Motif</a>
</div>
</nav>
-->
<ul id="nav-mobile" class="side-nav fixed">
<ul class="tabs">
<li class="tab col s3"><a href="#add-tab" class="active">Add</a></li>
</ul>
<div id="add-tab">
<subnav title="Object">
<li ng-repeat="object in objects">
<a href="#" ng-click="addObject(object)" class="waves-effect waves-teal">{{object.name}}</a>
</li>
</subnav>
<subnav title="Input">
<li ng-repeat="input in inputs">
<a href="#" ng-click="addInput(input)" class="waves-effect waves-teal">{{input.name}}</a>
</li>
</subnav>
<subnav title="Connection">
<li>
<div class="input-field listpadd">
<select id="obj-con" ng-options="obj.name for obj in scene.objects" ng-model="con.obj" ng-change="clickSel('obj-prop-con')"></select>
</div>
<div class="input-field listpadd">
<select id="obj-prop-con" ng-change="clickSel('input-con')" ng-options="name for (name, props) in con.obj.props" ng-model="con.prop">
</select>
</div>
</li>
<li class="center"><span class="grey-text">connected to</span></li>
<li>
<div class="input-field listpadd">
<select id="input-con" ng-options="input.name for input in scene.inputs" ng-model="con.input" ng-change="clickSel('out-con')"></select>
</div>
<div class="input-field listpadd">
<select id="out-con" ng-options="name for (name, out) in filtered(con.input.out, 'type', con.prop.type)" ng-model="con.output"></select>
</div>
</li>
<li class="list-action light-green accent-4 waves-effect waves-light">
<a ng-click="addConnection(con.input, getText('#out-con'), con.obj, getText('#obj-prop-con'))" class="btn-block btn-outline text-white" href="#">
<i class="material-icons">add</i> Add {{con.prName}}
</a>
</li>
</subnav>
<subnav title="Effect">
<li>
<div class="input-field listpadd">
<select ng-options="effect.name for effect in effects" ng-model="eff.eff" ng-change="clickSel('input-eff')"></select>
</div>
</li>
<li class="center"><span class="grey-text">applied to</span></li>
<li>
<div class="input-field listpadd">
<select id="input-eff" ng-options="input.name for input in scene.inputs" ng-model="eff.input" ng-change="clickSel('out-eff')"></select>
</div>
<div id="out-eff" class="input-field listpadd">
<select ng-options="name for (name, out) in eff.input.out" ng-model="eff.output"></select>
</div>
</li>
<li class="list-action light-green accent-4 waves-effect waves-light">
<a ng-click="addEffect(eff.output, eff.eff)" class="btn-block btn-outline text-white" href>
<i class="material-icons">add</i> Add effect
</a>
</li>
</subnav>
<subnav title="Saves" amount="saved">
<li class="list-action">
<div class="row">
<div class="input-field col s7">
<input id="save_name" type="text" ng-model="curSave.name" />
<label for="save_name">Name</label>
</div>
<div class="input-field col s5">
<button ng-click="save(name)" ng-disabled="curSave.name.length == 0" class="btn-block small-btn btn light-green accent-4 waves-effect waves-light text-white" href>
<i class="material-icons">file_download</i>
</button>
</div>
</div class="row">
</li>
<li ng-repeat="save in saved">
<a title="Open" class="waves-effect waves-teal">
<span ng-click="openSave(save)">{{save.name}}</span>
<span href="#" ng-click="deleteSave(save)" title="Delete" class="right waves-effect waves-red"><i class="material-icons">delete</i></span>
<span href="#" ng-click="uploadSave(save)" title="Upload" class="right waves-effect waves-teal"><i class="material-icons">cloud_upload</i></span>
</a>
</li>
<hr>
<li ng-repeat="save in cloudSaves">
<a title="Open" class="waves-effect waves-teal">
<span ng-click="openSave(save)">{{save.name}}</span>
</a>
</li>
</subnav>
<subnav title="Songs">
<li class="list-action">
<div class="row">
<div class="input-field col s7">
<input id="song_name" type="url" ng-model="songUrl" />
<label for="song_name">Song url</label>
</div>
<div class="input-field col s5">
<button title="Play" ng-click="selectSong('https://crossorigin.me/'+songUrl)" class="btn-block small-btn btn light-green accent-4 waves-effect waves-light text-white" href>
<i class="material-icons">play_arrow</i>
</button>
</div>
</div class="row">
</li>
<li>
<a href="#" ng-click="selectSong('mic')" title="Select" class="waves-effect waves-teal">
Microphone
</a>
</li>
<li ng-repeat="music in songs">
<a href="#" ng-click="selectSong('songs/'+music)" title="Select" class="waves-effect waves-teal">
{{music}}
</a>
</li>
</subnav>
</div>
</ul>
<!--<audio src="songs/pizza.mp3" autoplay="true"></audio>-->
<ul id="nav-mobile" class="side-nav right fixed">
<ul class="tabs">
<li class="tab col s3"><a href="#objects-tab">Edit</a></li>
</ul>
<div id="objects-tab">
<li><h5>{{open.name}}</h5></li>
<subnav title="Properties" ng-if="open.props">
<props list="open"></props>
</subnav>
<subnav title="Connections" ng-if="open.affected">
<subnav title="{{aff.name}}" ng-repeat="(name, aff) in open.affected" func="deleteIndex($index, open.affected)">
<div class="listpadd input-field col s12">
<label class="active">Multiplier</label>
<input type="number" ng-model="aff.modifier" />
</div>
</subnav>
</subnav>
<subnav title="Effects" ng-if="open.out">
<subnav title="{{name}}" ng-repeat="(name, out) in open.out" ng-if="out.effects.length > 0">
<subnav title="{{effect.name}}" ng-repeat="effect in out.effects">
<props list="effect"></props>
</subnav>
</subnav>
</subnav>
</div>
</ul>
<main>
<div id="canvas-container" height="0px"></div>
<div id="loading-container">
<div class="spinner">
<div class="cube1"></div>
<div class="cube2"></div>
</div>
</div>
<footer class="footer" style="display: none">
<div class="container">
<div class="row">
<div class="col s6" ng-repeat="array in [scene.objects, scene.inputs]">
<div class="collection">
<a ng-repeat="element in array" ng-click="selected(element)" href="#" class="collection-item">
{{element.name}}
<span ng-click="deleteIndex($index, array)" ng-if="!element.undeletable" title="Delete" href="#" class="right waves-effect waves-red"><i class="material-icons">delete</i></span>
<span ng-if="!element.out" ng-click="cloneElement(element)" title="Clone" href="#" class="right waves-effect waves-teal"><i class="material-icons">content_copy</i></span>
<span ng-repeat="offset in offsets" href="#" ng-click="moveIndex($parent.$index, offset.dir, array)" title="Move {{offset.name}}" class="right"><i class="material-icons">{{offset.icon}}</i></span>
</a>
</div>
</div>
</div>
</div>
</footer>
</main>
</body>
</html>