-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·514 lines (417 loc) · 16.9 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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
<!DOCTYPE HTML>
<!--
Based on Halcyonic 3.1 by HTML5 UP html5up.net | @n33co
Free for personal and commercial use under the CCA 3.0 license
(html5up.net/license)
developed by iroro orife, 2014-2016
-->
<html>
<head>
<title>ruoho reviews</title>
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<script src="javascript/js/jquery.min.js"></script>
<script src="javascript/js/config.js"></script>
<script src="javascript/js/skel.min.js"></script>
<script src="javascript/js/skel-panels.min.js"></script>
<script src="javascript/src/rita_dict.js" type="text/javascript"></script>
<script src="javascript/src/rita.js" type="text/javascript"></script>
<script src="javascript/src/Queue.js" type="text/javascript"></script>
<script src="javascript/src/ruoho_reviews.js" type="text/javascript"></script>
<script src="javascript/src/labelsCache.js" type="text/javascript"></script>
<script src="javascript/src/releasesCache.js" type="text/javascript"></script>
<script src="javascript/src/artistMetaData.js" type="text/javascript"></script>
<script src="javascript/src/jquery.echonest.js" type="text/javascript"></script>
<noscript>
<link rel="stylesheet" href="css/skel-noscript.css" />
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/style-desktop.css" />
</noscript>
<!--[if lte IE 9]><link rel="stylesheet" href="javascript/css/ie9.css" /><![endif]-->
<!--[if lte IE 8]><script src="javascript/js/html5shiv.js"></script><![endif]-->
</head>
<body>
<script type="text/javascript">
/*
// Twitter integration
window.twttr = (function (d,s,id) {
var t, js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
js.src="https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
return window.twttr || (t = { _e: [], ready:function(f){ t._e.push(f)}});
}(document, "script", "twitter-wjs"));
$(document).ready(function(){
$('a[data-text]').each(function(){
// console.log($('#reviewArtist').html);
$(this).attr('data-text', "This works!");
});
$.getScript('https://platform.twitter.com/widgets.js');
});
*/
//////////////////////////////////////////////////////////////////////////////////
// A Context-Free grammar for Generative Music Criticism by iroro
// V0.1 2009.11.06 (Processing, unreleased)
// V0.2 2013.01.15 (Javascript)
//
//////////////////////////////////////////////////////////////////////////////////
// RiTa.p5Compatible(1);
var reviewRiGrammar;
var currentArtistQ = new Queue();
var imageCache;
var anonImage = "javascript/anon.jpg"
// setup
window.onload = setupCached;
// window.onmouseup = mouseClicked;
//////////////////////////////////////////////////////////////////////////////////
function setupCached()
{
// hotttArtistsCache is read, when we included it in artistMetaData.js above
reviewRiGrammar = new RiGrammar(reviewGrammar);
mouseClicked();
console.log("Setup completed. Great Success");
}
//////////////////////////////////////////////////////////////////////////////////
function mouseClicked()
{
var aReview = reviewRiGrammar.expand();
// RiString text = new RiString(aReview);
console.log("Review length: " + aReview.length);
// reviewRiGrammar.print();
var randomLabel = Math.floor((Math.random() * labelsCache.length));
var lower = 1999;
var upper = 2022;
var releaseYear = Math.floor(lower + (Math.random() * (upper - lower + 1)));
// console.log("random releaseYear " + releaseYear);
// Populate html elements
document.getElementById("ruohoreviews").innerHTML = aReview;
document.getElementById("reviewSubtitle").innerHTML = labelsCache[randomLabel] + ", " + releaseYear;
getHotttRating();
getCurrentArtistImage();
getAlbumName();
getCurrentArtist();
getCurrentArtistTwitterURL();
getCurrentArtistInfo();
//getCurrentArtistGenre();
}
//////////////////////////////////////////////////////////////////////////////////
function enQueueANewArtist() // helper
{
var currentArtist = {name:"", index:-1, imageIndex:-1};
var rand = Math.floor((Math.random() * hotttArtistsCache.length));
currentArtist.name = hotttArtistsCache[rand].name;
currentArtist.index = rand;
console.log("[DEBUG] currentArtist.index ==" + rand);
console.log("[DEBUG] currentArtist.name ==" + currentArtist.name);
var imageList = hotttArtistsCache[currentArtist.index].images;
currentArtist.imageIndex = Math.floor(Math.random() * imageList.length);
currentArtistQ.enqueue(currentArtist);
console.log(currentArtist.name);
try {
// Cache images
if(typeof imageList[currentArtist.imageIndex].url != "undefined" &&
imageList[currentArtist.imageIndex].url != null ) {
console.log("Caching images ... ");
imageCache = new Image();
imageCache.src = imageList[currentArtist.imageIndex].url;
}
} catch (err) {
if (err.name === 'TypeError')
{
console.log("TypeError: ");
}
else
{
console.log("Unknown error");
}
}
}
//////////////////////////////////////////////////////////////////////////////////
function getHotttArtists() // get a random Hottt artist
{
console.log("\n\n Queue length: " + currentArtistQ.getLength());
if(typeof currentArtistQ != "undefined" &&
currentArtistQ != null &&
currentArtistQ.getLength() > 0 ) {
console.log("enQueueNewArtists");
enQueueANewArtist();
// dequeue top item
currentArtistQ.dequeue();
} else { // empty Q, add 2 elements
console.log("Initial getHotttArtists");
enQueueANewArtist();
enQueueANewArtist();
}
// console.log(currentArtistQ.peek().name);
return currentArtistQ.peek().name;
}
//////////////////////////////////////////////////////////////////////////////////
function getCurrentArtistImage()
{
console.log("Artist Image list " +
hotttArtistsCache[currentArtistQ.peek().index].images.length);
if (hotttArtistsCache[currentArtistQ.peek().index].images.length > 0) {
// random selection from image array
var imageList = hotttArtistsCache[currentArtistQ.peek().index].images;
var imageIndex = currentArtistQ.peek().imageIndex;
// If the image is nil then use imgError in the tag to fetch anon.png
if(imageList[imageIndex].url) {
document.getElementById("artistImages").src = imageList[imageIndex].url;
} else {
document.getElementById("artistImages").src = anonImage;
console.log("RR Error: loading image @ " + imageList[imageIndex].url);
}
} else {
document.getElementById("artistImages").src = anonImage;
console.log("RR Error: image list length == " +
hotttArtistsCache[currentArtistQ.peek().index].images.length);
}
}
//////////////////////////////////////////////////////////////////////////////////
function imgError(image)
{
image.onerror = "";
image.src = anonImage;
return true;
}
//////////////////////////////////////////////////////////////////////////////////
function getCurrentArtistTwitterURL()
{
// random selection from image array
var urlList = hotttArtistsCache[currentArtistQ.peek().index].URLs;
// console.log(urlList);
var a = document.getElementById('artistTwitter');
var link = urlList["twitter_url"];
a.title = "Twitter";
a.innerHTML = "@" + hotttArtistsCache[currentArtistQ.peek().index].twitter_id;
if(!link) {
link = urlList["wikipedia_url"];
a.title = "Wikipedia";
a.innerHTML = "Wikipedia";
}
if(!link) {
link = urlList["myspace_url"];
a.title = "Myspace";
a.innerHTML = "Myspace";
}
if(!link) {
link = urlList["lastfm_url"];
a.title = "LastFM";
a.innerHTML = "LastFM";
}
if(!link) {
link = urlList["official_url"];
a.title = "Official Website";
a.innerHTML = "Official Website";
}
if(!link) {
link = " ";
a.innerHTML = " ";
}
a.href = link;
}
//////////////////////////////////////////////////////////////////////////////////
function getCurrentArtistInfo()
{
// random selection from image array
var artistID = hotttArtistsCache[currentArtistQ.peek().index].id;
var a = document.getElementById('artistInfo');
if(artistID) {
a.href = "http://static.echonest.com/echotron/?id=" + artistID;
a.title = "Echotron";
a.innerHTML = "Artist Info";
}
}
//////////////////////////////////////////////////////////////////////////////////
function getCurrentArtistGenre() // get a current artist terms
{
// IO HAVOC -- debugging
// console.log(hotttArtistsCache[currentArtist.index].genres.length);
// for (i = 0; i < hotttArtistsCache[currentArtist.index].genres.length; i++) {
// console.log(hotttArtistsCache[currentArtist.index].genres[i].name);
// }
var topArtistTerm = hotttArtistsCache[currentArtistQ.peek().index].genres[0].name;
if(topArtistTerm) {
return topArtistTerm[0].toUpperCase() + topArtistTerm.slice(1);
}
else return "Future Ruoho";
}
//////////////////////////////////////////////////////////////////////////////////
function getAlbumName()
{
// console.log(releasesCache.length);
var randReleaseTitleIndex = Math.floor((Math.random()*releasesCache.length));
document.getElementById("reviewTitle").innerHTML = releasesCache[randReleaseTitleIndex];
}
//////////////////////////////////////////////////////////////////////////////////
function clearContext(context, canvas)
{
// Store the current transformation matrix
context.save();
// Use the identity matrix while clearing the canvas
context.setTransform(1, 0, 0, 1, 0, 0);
context.clearRect(0, 0, canvas.width, canvas.height);
// Restore the transform
context.restore();
}
//////////////////////////////////////////////////////////////////////////////////
function getHotttRating() // get a random Hottt artist rating
{
var ratings = ['A+', 'B+', 'B-', 'B-', 'B-', 'C+', 'C+', 'C', 'C-', 'C-', 'C-', 'D+', 'D', 'D-', 'F+'];
var rand_rating = ratings[Math.floor(Math.random() * ratings.length)];
// start drawing
var canvas = document.getElementById("ratingCanvas");
var context = canvas.getContext("2d");
//
clearContext(context, canvas);
var offset = 10;
context.beginPath();
context.rect(offset, offset, canvas.width - 2* offset, canvas.height - 2 *offset);
context.fillStyle = 'white';
context.fill();
context.lineWidth = 3;
context.stroke();
// context.font = '14pt Yanone Kaffeesatz';
context.font = "24px Lucida Console";
context.fillStyle = 'black';
context.textAlign = 'center';
context.fillText(rand_rating, 30, 37);
}
//////////////////////////////////////////////////////////////////////////////////
function getCurrentArtist() // get current artist
{
document.getElementById("reviewArtist").innerHTML = currentArtistQ.peek().name;
}
//////////////////////////////////////////////////////////////////////////////////
function showme(id)
{
var divid = document.getElementById(id);
if (divid.style.display == 'block') divid.style.display = 'none';
else divid.style.display = 'block';
}
</script>
<!-- Header -->
<div id="header-wrapper">
<header id="header" class="container">
<div class="row">
<div class="12u">
<!-- Logo -->
<!-- <h1><a href="#" id="logo">ruoho reviews …</a></h1> -->
<img src="" class="ss"/>
<!-- IO HAVOC turn off nav -->
<!-- Nav
<nav id="nav">
</nav>
-->
<ul class="icons">
<li><a class="fa fa-twitter solo" href="https://twitter.com/ruohorecords"><span>Twitter</span></a></li>
<li><a class="fa fa-instagram solo" href="https://instagram.com/ruohoruotsi"><span>Insta</span></a></li>
<li><a class="fa fa-github solo" href="https://github.com/ruohoruotsi"><span>LinkedIn</span></a></li>
<!-- <li><a class="fa fa-youtube solo" href="https://youtube.com/ruohoreviews"><span>Youtube</span></a></li>-->
<!-- <li><a class="fa fa-tumblr solo" href="https://youtube.com/ruohoreviews"><span>Tumblr</span></a></li> -->
</ul>
</div>
</div>
</header>
</div>
<!-- Content -->
<div id="content-wrapper">
<div id="content">
<div class="container">
<div class="row">
<div class="4u">
<!-- Sidebar -->
<section>
<header>
<h5 id="reviewArtist">Artist</h5>
</header>
<img id="artistImages" class="image" src="" onerror="imgError(this);"/>
<ul class="link-list">
<li><a href="" id="artistTwitter">Artist Info</a></li>
<li><a href="" id="artistInfo">Artist Info</a></li>
<!-- <li>Play this artist</li> IO HAVOC: Not right now-->
<li>
<canvas id="ratingCanvas" width="60" height="60">
</canvas>
</li>
</ul>
</section>
</div>
<div id="screencap" class="8u skel-cell-important">
<!-- Main Content -->
<section onclick="mouseClicked()">
<header>
<h2 id="reviewTitle">Album Title</h2>
<h3 id="reviewSubtitle">Label and year</h3>
</header>
<p><h4 id="ruohoreviews"></h4>
<!-- <a id="custom-tweet-button"></a> -->
<style type="text/css" media="screen">
#custom-tweet-button a {
display: block;
padding: 2px 5px 2px 20px;
background: url('https://twitter.com/favicons/favicon.ico') 1px center no-repeat;
}
</style>
<!--
<div id="custom-tweet-button">
<a href="https://twitter.com/intent/tweet">Tweet</a>
</div> -->
<!-- <a href="https://twitter.com/share"
class="twitter-share-button"
data-text="This is what we want to change dynamically"
data-count="none" data-via="chris_camps" data-size="large">Tweet</a> -->
<!-- REFRESH BUTTON -->
<!-- <a href="#" class="btn" onclick="mouseClicked()"></a> -->
</section>
</div>
</div>
</div>
</div>
</div>
<!-- Footer -->
<div id="footer-wrapper">
<footer id="footer" class="container">
<div class="row">
<div class="11u">
<!-- About -->
<h2>
about ruoho reviews
</h2>
<p>
What if <a href="https://en.wikipedia.org/wiki/Timbaland">Timbaland</a> produced
<a href="https://en.wikipedia.org/wiki/Stromae">Stromae</a> for <a href="https://en.wikipedia.org/wiki/Kompakt">Kompakt</a> records?
What if <a href="https://instagram.com/taylorswift/">Taylor Swift</a> & <a href="https://www.residentadvisor.net/dj/theoparrish">Theo Parrish</a> fraternized to transcend
the pedestrian screeching that beleaguers her pop balladry?
What if <a href="https://en.wikipedia.org/wiki/Kanye_West">Kanye</a> indulged in tranquil, free-floating chorales?
What if <a href="https://en.wikipedia.org/wiki/Flying_Lotus">Flying Lotus</a> teamed up with <a href="https://en.wikipedia.org/wiki/Tujiko_Noriko">Tujiko Noriko</a> to
rescript pirouetting, melodic <a href="https://en.wikipedia.org/wiki/Zouglou">Zouglou</a>?
<a onclick="showme('widget');" style="color: #ED391B;">more/less</a></p>
<div id="widget" style="display:none;">
<p>
These reviews are a creative writing experiment that (re)imagines an alternative musical cosmos where
dissimilar musical expressions intermingle, unshackled by time, geography and class.
First-class criticism allows the reader to
<a href="https://www.google.com/search?q=escaping+flatland">escape flatland</a>, putting her in the front-row
or inside the recording booth. But as a critic and writer, how do you reflect the
spirit of the music? How do you avoid descriptive repetition & keep *ish fresh?
<br/>As a regular reader of the <a href="https://www.oxfordamerican.org">Oxford American</a>,
<a href="https://pitchfork.com">Pitchfork</a>, <a href="https://boomkat.com">Boomkat</a>,
<a href="https://www.thefader.com">The Fader</a> & <a href="https://www.thewire.co.uk">The Wire</a>,
Ruoho hopes these reviews will dislodge writer's block, suggest new musical vistas, artist collaborations
& even garner a few chuckles.
For connoisseurs & entertainment purposes only.
</p>
</div>
</div>
</div>
</footer>
</div>
<!-- Copyright -->
<div id="copyright">
© 2009-2019 iroro orife. All rights reserved. | Design: <a href="https://html5up.net">HTML5 UP</a>
</div>
</body>
</html>