-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex2.html
More file actions
70 lines (63 loc) · 2.48 KB
/
index2.html
File metadata and controls
70 lines (63 loc) · 2.48 KB
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
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js" type="text/javascript"></script>
<script src="js/two.js"></script>
<script src="js/require.js"></script>
<script src="js/echonest.js"></script>
</head>
<body>
<script type="text/javascript">
//var request = require('request');
var echojs = require('echojs');
var echo = echojs({key: XLEGAUFG0PDHWRAK7//process.env.ECHONEST_KEY
});
/*
request.post('http://developer.echonest.com/api/v4/track/profile',
{ form: { api_key: 'XLEGAUFG0PDHWRAK7'
format='json'} },
function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body)
}
}
);
*/
echo('song/search').get({
artist: 'radiohead',
title: 'karma police'
}, function (err, json) {
console.log(json.response);
});
</script>
<!--script>
var two = new Two({ width: 500, height: 400 }).appendTo(document.body);
var circle = two.makeCircle(-70, 0, 50);
var rect = two.makeRectangle(70, 0, 100, 100);
circle.fill = '#FF8000';
rect.fill = 'rgba(0, 200, 255, 0.75)';
var group = two.makeGroup(circle, rect);
group.translation.set(two.width / 2, two.height / 2);
group.scale = 0;
opacity = 0;
//group.noStroke();
// Bind a function to scale and rotate the group
// to the animation loop.
two.bind('update', function(frameCount) {
// This code is called everytime two.update() is called.
// Effectively 60 times per second.
if (group.scale > 0.9999) {
group.scale = group.rotation = 0;
}
if (group.opacity > 0.9999) {
group.opacity = 0;
}
var t = (1 - group.scale) * 0.125;
group.scale += t;
group.rotation += t * 4 * Math.PI;
group.opacity += t * 4 * Math.PI;
}).play(); // Finally, start the animation loop
//15
//1 minute
</script-->
</body>
</html>