-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
150 lines (147 loc) · 6.65 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="icons/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="icons/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="icons/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="icons/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="icons/apple-touch-icon-60x60.png" />
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="icons/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="icons/apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="icons/apple-touch-icon-152x152.png" />
<link rel="stylesheet" href="css/screen.css" />
<title>Aquarium</title>
</head>
<body>
<script>var app = {};</script>
<div class="inputs">
<input type="button" value="Reset" onclick="location.reload();" />
<input id="uploadJSON" accept=".json" type="file" />
</div>
<div id="spaceName"></div>
<div id="spaceTree"></div>
<div id="panel">
<h1>Informations</h1>
<div>
<h2>World</h2>
<a href="./" id="switchToPopWorld">Pop</a>
<a href="./" id="switchToZenWorld">Zen</a>
</div>
<div>
<h2>Members</h2>
<p>
Each member is represented by a fish depending on his Graasper level, ranging from 1 to 7. A member will appear closer to the foreground if he is more active on Graasp.
</p>
<img data-src="fishes" />
<table>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
</table>
</div>
<div>
<h2>Items</h2>
<p>
Each item is represented by a column, which shape is depending on its type, its height on its age and its inclination on its last modification date.
</p>
<img data-src="items" />
<table>
<tr>
<td>Resource</td>
<td>Application</td>
<td>Topic</td>
<td>Space</td>
</tr>
</table>
</div>
<div>
<h2>Comments</h2>
<p>
Each comment is reprensented by a seaweed, with the leaf's shape corresponding to the item's one.
</p>
<img data-src="comments" />
</div>
<div>
<h2>Private mode</h2>
<p>
In private mode, each element created by the currently logged user (including the member itself) is circled by a halo.
</p>
<img data-src="private" />
</div>
</div>
<div id="openPanel" onclick="document.getElementById('panel').classList.toggle('active'); canTouch = !canTouch;"></div>
<div id="canvas"></div>
<script src="js/p5.min.js"></script>
<script src="js/toxiclibs.min.js"></script>
<script src="js/utils.js"></script>
<script src="js/jsonReader.js"></script>
<script>
var canTouch = true;
document.body.addEventListener('touchmove', function(e) {
if(canTouch) e.preventDefault();
}, false);
var zen = false;
var switchToZenWorld = document.getElementById('switchToZenWorld'),
switchToPopWorld = document.getElementById('switchToPopWorld'),
imgs = document.getElementsByTagName('img');
if(zen) {
switchToZenWorld.classList.add('active');
switchToPopWorld.addEventListener('click', function(e) {
e.preventDefault();
window.location = window.location;
}, false);
for(var i = 0, l = imgs.length; i < l; i++) {
if(imgs[i].getAttribute('data-src') != null) {
imgs[i].src = "imgs/" + imgs[i].getAttribute('data-src') + "-zen.png";
}
}
} else {
switchToPopWorld.classList.add('active');
switchToZenWorld.addEventListener('click', function(e) {
e.preventDefault();
window.location = window.location + '?zen';
}, false);
for(var i = 0, l = imgs.length; i < l; i++) {
if(imgs[i].getAttribute('data-src') != null) {
imgs[i].src = "imgs/" + imgs[i].getAttribute('data-src') + "-pop.png";
}
}
}
var uploadJSON = document.getElementById('uploadJSON');
uploadJSON.addEventListener('change', function(e) {
var file = e.target.files[0];
if(file.type == "application/json") {
var reader = new FileReader();
reader.readAsText(file, "UTF-8");
reader.addEventListener('load', function(e) {
readJSON(JSON.parse(e.target.result), true);
intro = true;
introBeginning = frame;
uploadJSON.disabled = true;
}, false);
} else {
alert('Please select a .json file');
}
}, false);
</script>
<script src="js/flowfield.js"></script>
<script src="js/branch.js"></script>
<script src="js/algae.js"></script>
<script src="js/rock.js"></script>
<script src="js/fish.js"></script>
<script src="js/bubble.js"></script>
<script src="js/gem.js"></script>
<script src="js/sketch.js"></script>
</body>
</html>