-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
362 lines (294 loc) · 13.7 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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
<html>
<head>
<title> {{title}} </title>
<meta charset="utf-8">
<meta name="description" content="eMerge Americas is a two-day technology event held in Miami Beach FL where bright and ambitious minds gather to network and share ideas. This site collects dynamic 3D portraits created at the eMerge EXPO installation by Branger_Briz.">
<meta name="author" content="Branger_Briz">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic,700,700italic,800,800italic&v1" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300|Lato:100|Source+Code+Pro:300,400,500,600,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<link rel="image_src" href="http://emerge.brangerbriz.com/eMergePortraits.png" />
<meta property="og:title" content="eMerge Portraits"/>
<meta property="og:description" content="eMerge Americas is a two-day technology event held in Miami Beach FL where bright and ambitious minds gather to network and share ideas. This site collects dynamic 3D portraits created at the eMerge EXPO installation by Branger_Briz"/>
<meta property="og:url" content="http://emerge.brangerbriz.com/"/>
<meta property="og:image" content="http://emerge.brangerbriz.com/eMergePortraits.png"/>
<meta property="og:site_name" content="Branger_Briz"/>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@branger_briz">
<meta name="twitter:creator" content="@branger_briz">
<meta name="twitter:title" content="eMerge Portraits">
<meta name="twitter:description" content="eMerge Americas is a two-day technology event held in Miami Beach FL where bright and ambitious minds gather to network and share ideas. This site collects dynamic 3D portraits created at the eMerge EXPO installation by Branger_Briz">
<meta name="twitter:image" content="http://emerge.brangerbriz.com/eMergePortraits.png">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<section id="loading">
<div class="container"> ...loading </div>
</section>
<section id="splash">
<a href="http://brangerbriz.com"><div class="logo"> <img src="images/Bx64.png" class="BBLogo"> Branger_Briz </div></a>
<iframe src="" frameborder="0" class="portraitFrame" id="pFrame"></iframe>
<div class="ntroTxt">
<h1 class="desktop-only"> {{title}} </h1>
<p class="desktop-only">
<a href="http://emergeamericas.org/" target="_blank">eMerge Americas</a> is a two-day technology event held in Miami Beach FL where bright and ambitious minds gather to network and share ideas. This site collects dynamic 3D portraits created at the eMerge EXPO installation by <a href="http://brangerbriz.com" target="_blank">Branger_Briz</a>. Visit the <a href="gallery">gallery</a> of interactive portraits or type in your unique ID below. <a href="/about">Click to learn more</a>.
</p>
<div class="desktop-only">
<input type="text" placeholder="PORTRAIT ID" id="idfield">
<a href="#" class="btnlink" id="portraitButton">view portrait</a>
</div>
</div>
<h1 class="mobile-only mobile-h1"> {{title}} </h1>
<svg class="arrow" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve" fill="#D98ACE"><path d="M23.092,44.335l26.586,12.69c0.012,0.006,0.025,0.004,0.037,0.01c0.051,0.021,0.102,0.027,0.152,0.037 c0.045,0.008,0.088,0.02,0.131,0.02c0.047,0,0.092-0.012,0.141-0.02c0.049-0.01,0.1-0.02,0.146-0.037 c0.012-0.006,0.025-0.004,0.039-0.01l26.584-12.69c0.374-0.18,0.532-0.626,0.354-1c-0.129-0.27-0.397-0.428-0.678-0.428 c-0.107,0-0.218,0.023-0.322,0.074L50,55.518L23.738,42.982c-0.105-0.049-0.215-0.072-0.322-0.072c-0.279,0-0.549,0.156-0.678,0.427 C22.561,43.709,22.717,44.156,23.092,44.335z"/></svg>
</section>
<section id="main" class="dark-purple">
<div class="mobile-info">
<p class="mobile-only">
<a href="http://emergeamericas.org/" target="_blank">eMerge Americas</a> is a two-day technology event held in Miami Beach FL where bright and ambitious minds gather to network and share ideas. This site collects dynamic 3D portraits created at the eMerge EXPO installation by <a href="http://brangerbriz.com" target="_blank">Branger_Briz</a>. Visit the <a href="gallery">gallery</a> of interactive portraits or type in your unique ID below. <a href="/about">Click to learn more</a>.
</p>
<div class="mobile-only">
<input type="text" placeholder="PORTRAIT ID" id="idfield" style="border: 1px solid #6A93FF;">
<a href="#" class="btnlink" id="portraitButton">view portrait</a>
</div>
</div>
<div class="container">
<!-- thumbnail selection goes here -->
</div>
<div class="thumb-nav">
<div id="tnav-left" class="desktop-only"> << prev </div>
<div id="tnav-gallery"> <a href="gallery"><search gallery></a> </div>
<div id="tnav-right" class="desktop-only"> next >> </div>
</div>
</section>
<script src="flaggedList.js"></script>
<script src="BB.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
if( !BB.Detect.hasWebGL ){
var bummer = document.createElement('div');
bummer.setAttribute('id','no-webgl');
bummer.innerHTML = "Bummer! looks like your device/browser either doesn't support WebGL or doesn't have WebGL enabled. try visiting this site with another device or browser ( the newer the better )."
document.body.appendChild( bummer );
}
// load list from db....
var Sessions = [];
var thumbSpot = 0;
var numOfThumbs = 0;
var transTime = 100;
var gififyLoop = null;
var gififyCount = 0;
$.getJSON( "http://"+window.location.host+"/api/sessions-list", function( json ) {
if (!json.error && json.data) {
var sesh; // load up session list && data
for (var i = 0; i < json.data.length; i++) {
sesh = {
id: json.data[i].id,
count: json.data[i].keyFrames.length,
date: new Date(json.data[i].sessionStart)
}
if( flaggedList.indexOf(sesh.id) == -1 ) Sessions.push(sesh);
};
// set random session for splash screen
var ranSesh = Sessions[ Math.floor(Math.random()*Sessions.length) ];
$('.portraitFrame').attr('src',ranSesh.id+'?frame=true');
Sessions.sort(function(a,b){ // sort from oldest to newest
return new Date(a.date) - new Date(b.date);
});
// choose 3 random sessions for thumbnails
var ranSpot = Math.floor(Math.random()* Sessions.length-3 );
if(ranSpot<0) ranSpot = 0;
thumbSpot = ranSpot;
createThumbsAt( ranSpot );
presentThumbs();
// give it a sec, then fadeout the load screen
setTimeout(function(){
$('#loading').fadeOut(1000);
},250);
} else { console.log(json); }
});
function gifify( thumb ){
var id = $(thumb).attr('id');
var obj = null
for (var i = 0; i < Sessions.length; i++) {
if( Sessions[i].id == id ){
obj = Sessions[i];
break;
}
};
gififyCount++;
if( gififyCount >= obj.count ) gififyCount = 0;
$(thumb).attr('src',obj.id+"_"+(gififyCount+1)+".png");
}
function printDate( d ){
// maybe make this more code-like ^__^
// Mon Mar 21 2016 18:02:16 GMT-0500 (CDT)
var days = ["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"];
var mons = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
var suffix = (d.getHours() >= 12) ? 'pm' : 'am';
var hours = (d.getHours() > 12) ? d.getHours() -12 : d.getHours();
hours = (hours == 00) ? 12 : hours; //if 00 then it is 12 am
var str = days[d.getDay()]+" "+mons[d.getMonth()]+" "+d.getDate()+" "+d.getFullYear()+" ";
str += hours+":"+d.getMinutes()+":"+d.getSeconds()+" "+suffix+" (EST)";
return str;
}
function createThumbsAt( spot ){
for (var i = 0; i < 3; i++) {
var div = document.createElement('div');
div.className = "item";
var img = document.createElement('img');
img.id = Sessions[spot+i].id;
img.src = Sessions[spot+i].id+"_"+(Math.floor(Math.random()*Sessions[spot+i].count)+1)+".png";
img.className = "thumb thumb-start";
img.onclick = function(){ window.location="/"+this.id }
img.onmouseover = function(){
var self = this;
$('#'+this.id).next().css('color','#FFFFFF');
gififyLoop = setInterval( function(){ gifify(self); }, 250 );
}
img.onmouseout = function(){
clearInterval( gififyLoop );
gififyCount=0;
$('#'+this.id).next().css('color','#9B91A4');
}
var nfo = document.createElement('div');
nfo.className = "thumbNfo thumbNfo-start";
nfo.innerHTML = printDate( Sessions[spot+i].date );
nfo.innerHTML += "<br>";
nfo.innerHTML += "PORTRAIT_ID: <a href='/"+Sessions[spot+i].id+"'>" + Sessions[spot+i].id +"</a>";
div.appendChild( img );
div.appendChild( nfo );
$('#main > .container').append( div );
};
}
function hideThumbs(){
var item = $('#main > .container').children();
var img = $(item[numOfThumbs]).children()[0];
var nfo = $(item[numOfThumbs]).children()[1];
nfo.className = "thumbNfo thumbNfo-start";
setTimeout(function(img){
img.className = "thumb thumb-start";
numOfThumbs--;
if(numOfThumbs==-1) numOfThumbs = 0;
setTimeout(function(){
if(numOfThumbs > 0) hideThumbs();
else {
$('#main > .container').empty();
}
},transTime/2);
}, transTime/2, img );
}
function presentThumbs(){
var item = $('#main > .container').children();
var img = $(item[numOfThumbs]).children()[0];
var nfo = $(item[numOfThumbs]).children()[1];
img.className = "thumb thumb-end";
setTimeout(function(nfo){
nfo.className = "thumbNfo thumbNfo-end";
numOfThumbs++;
setTimeout(function(){
if(numOfThumbs < 3) presentThumbs();
else numOfThumbs = 2;
},transTime/2);
},transTime/2, nfo);
}
// ------------------------ transition ( hide >> create >> present )
function transitionThumbs(){
hideThumbs();
setTimeout(function(){
createThumbsAt( thumbSpot );
presentThumbs();
}, transTime*4 );
}
// click navs -----------------------------------
function checkClickability(){
if( thumbSpot <= 0 ){
$('#tnav-left').css({'opacity': 0.25 , 'cursor':'default' });
$('#tnav-right').css({'opacity': 1 , 'cursor':'pointer' });
}
else if( thumbSpot >= Sessions.length-3 ){
$('#tnav-left').css({'opacity': 1 , 'cursor':'pointer' });
$('#tnav-right').css({'opacity': 0.25 , 'cursor':'default' });
}
else {
$('#tnav-left').css({'opacity': 1 , 'cursor':'pointer' });
$('#tnav-right').css({'opacity': 1 , 'cursor':'pointer' });
}
}
$('#tnav-left').on({
click:function(){
checkClickability();
if(thumbSpot <= 0) return;
thumbSpot -= 3;
if(thumbSpot <= 0) thumbSpot = 0;
checkClickability();
transitionThumbs();
}
});
$('#tnav-right').on({
click:function(){
checkClickability();
if(thumbSpot >= Sessions.length-3) return;
thumbSpot += 3;
if(thumbSpot >= Sessions.length-3) thumbSpot = Sessions.length-3;
checkClickability();
transitionThumbs();
}
});
// view portrait button
$('#portraitButton').on({
click:function(){
if( $('#idfield').val() == "" ) alert('forgot id');
else {
// maybe account for folks who might copy+paste '#:'
window.location = $('#idfield').val();
}
}
});
// parallax
$(document).on({
scroll:function(){
var t = - ($('body').scrollTop())/3;
var o = 1-(($('body').scrollTop()/500)/1);
$('.portraitFrame').css({
'top': t+"px",
'opacity':o
});
$('.arrow').css('opacity',0.5-(($('body').scrollTop()/500)/1));
}
});
function resize(){
$('.arrow').css('left',(window.innerWidth/2-100)+"px");
} resize();
$(window).on({
resize: function(){
resize();
}
});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-6098550-30', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>