|
1
|
1 |
<!DOCTYPE html> |
|
|
2 |
<html lang="fr"> |
|
|
3 |
<head> |
|
|
4 |
<meta charset="utf-8" /> |
|
|
5 |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> |
|
|
6 |
<title>Musitag - Futur en Seine 2012</title> |
|
|
7 |
<link rel="stylesheet" type="text/css" href="css/musitag.css" /> |
|
46
|
8 |
<script type="text/javascript" src="libs/jquery.min.js"></script> |
|
|
9 |
<script type="text/javascript" src="libs/mustache.js"></script> |
|
|
10 |
<script type="text/javascript" src="libs/underscore-min.js"></script> |
|
|
11 |
<script type="text/javascript" src="metadataplayer/LdtPlayer-core.js"></script> |
|
1
|
12 |
</head> |
|
|
13 |
<body> |
|
|
14 |
<div class="big-container"> |
|
|
15 |
<div class="home-header"> |
|
|
16 |
<h1>Musitag</h1> |
|
|
17 |
<h2>Mets tes couleurs, tes émotions<br />et ta voix sur la musique !</h2> |
|
|
18 |
</div> |
|
|
19 |
<div class="home-media"> |
|
|
20 |
<a href="#"> |
|
|
21 |
<img class="home-media-image" src="media/wari-120.jpg" /> |
|
|
22 |
</a> |
|
|
23 |
<h3> |
|
|
24 |
<a href="#">Au Clair de la Lune</a> |
|
|
25 |
</h3> |
|
|
26 |
<h4> |
|
|
27 |
<a href="#">Steve Waring</a> |
|
|
28 |
</h4> |
|
46
|
29 |
<div id="dataviz-1"></div> |
|
1
|
30 |
</div> |
|
|
31 |
<div class="home-media"> |
|
|
32 |
<a href="#"> |
|
|
33 |
<img class="home-media-image" src="media/wari-120.jpg" /> |
|
|
34 |
</a> |
|
|
35 |
<h3> |
|
|
36 |
<a href="#">Au Clair de la Lune</a> |
|
|
37 |
</h3> |
|
|
38 |
<h4> |
|
|
39 |
<a href="#">Steve Waring</a> |
|
|
40 |
</h4> |
|
|
41 |
</div> |
|
|
42 |
<div class="home-media"> |
|
|
43 |
<a href="#"> |
|
|
44 |
<img class="home-media-image" src="media/wari-120.jpg" /> |
|
|
45 |
</a> |
|
|
46 |
<h3> |
|
|
47 |
<a href="#">Au Clair de la Lune</a> |
|
|
48 |
</h3> |
|
|
49 |
<h4> |
|
|
50 |
<a href="#">Steve Waring</a> |
|
|
51 |
</h4> |
|
|
52 |
</div> |
|
|
53 |
<div class="home-media"> |
|
|
54 |
<a href="#"> |
|
|
55 |
<img class="home-media-image" src="media/wari-120.jpg" /> |
|
|
56 |
</a> |
|
|
57 |
<h3> |
|
|
58 |
<a href="#">Au Clair de la Lune</a> |
|
|
59 |
</h3> |
|
|
60 |
<h4> |
|
|
61 |
<a href="#">Steve Waring</a> |
|
|
62 |
</h4> |
|
|
63 |
</div> |
|
|
64 |
<div class="home-media"> |
|
|
65 |
<a href="#"> |
|
|
66 |
<img class="home-media-image" src="media/wari-120.jpg" /> |
|
|
67 |
</a> |
|
|
68 |
<h3> |
|
|
69 |
<a href="#">Au Clair de la Lune</a> |
|
|
70 |
</h3> |
|
|
71 |
<h4> |
|
|
72 |
<a href="#">Steve Waring</a> |
|
|
73 |
</h4> |
|
|
74 |
</div> |
|
|
75 |
<div class="home-media"> |
|
|
76 |
<a href="#"> |
|
|
77 |
<img class="home-media-image" src="media/wari-120.jpg" /> |
|
|
78 |
</a> |
|
|
79 |
<h3> |
|
|
80 |
<a href="#">Au Clair de la Lune</a> |
|
|
81 |
</h3> |
|
|
82 |
<h4> |
|
|
83 |
<a href="#">Steve Waring</a> |
|
|
84 |
</h4> |
|
|
85 |
</div> |
|
54
|
86 |
<div class="footer"> |
|
|
87 |
<div class="footer-idf"> |
|
|
88 |
<p class="footer-soutenu">Soutenu par le<br />Conseil Régional</p> |
|
|
89 |
<a href="http://www.iledefrance.fr/" title="Région Île-de-France"> |
|
|
90 |
<img src="img/logo-idf.png" alt="Région Île-de-France" /> |
|
|
91 |
</a> |
|
|
92 |
</div> |
|
|
93 |
<a href="http://www.futur-en-seine.fr/" title="Festival Futur En Seine 2012"> |
|
|
94 |
<img src="img/logo-fens.png" class="footer-logo" alt="Festival Futur En Seine 2012" /> |
|
|
95 |
</a> |
|
|
96 |
<a href="http://www.tralalere.com/" title="Tralalere"> |
|
|
97 |
<img src="img/logo-tralalere.png" class="footer-logo" alt="Tralalere" /> |
|
|
98 |
</a> |
|
|
99 |
<a href="http://www.iri.centrepompidou.fr/" title="Institut de Recherche et d'Innovation"> |
|
|
100 |
<img src="img/logo-iri.png" class="footer-logo" alt="Institut de Recherche et d'Innovation" /> |
|
|
101 |
</a> |
|
|
102 |
</div> |
|
1
|
103 |
</div> |
|
46
|
104 |
<script type="text/javascript"> |
|
|
105 |
|
|
|
106 |
function getVolumes(_source, _list) { |
|
|
107 |
var _volumes = _(_list).map(function(_e) { |
|
|
108 |
return { |
|
|
109 |
annotation: _e, |
|
|
110 |
volume: _source.getAnnotations().searchByTitle(_e).length |
|
|
111 |
}; |
|
|
112 |
}), |
|
|
113 |
_max = _(_volumes).max(function(_e) { return _e.volume }).volume, |
|
|
114 |
_volumes = _(_volumes).filter(function(_e) { return _e.volume }); |
|
|
115 |
if (_max) { |
|
|
116 |
var _total = 0; |
|
|
117 |
_(_volumes).each(function(_e) { |
|
|
118 |
_e.size = 50 * _e.volume / _max; |
|
|
119 |
_e.scale = 1 * _e.volume / _max; |
|
|
120 |
_total += _e.size; |
|
|
121 |
}); |
|
|
122 |
if (_total > 140) { |
|
|
123 |
var _f = 140 / _total; |
|
|
124 |
_(_volumes).each(function(_e) { |
|
|
125 |
_e.size = _f * _e.size; |
|
|
126 |
_e.scale = _f * _e.scale; |
|
|
127 |
}); |
|
|
128 |
} |
|
|
129 |
} |
|
|
130 |
//return _volumes; |
|
|
131 |
return _(_volumes).sortBy(function(_e) {return -_e.volume;}); |
|
|
132 |
} |
|
|
133 |
|
|
|
134 |
IriSP._ = _; |
|
|
135 |
IriSP.jQuery = jQuery; |
|
|
136 |
var _sourceManager = new IriSP.Model.Directory(), |
|
|
137 |
_emoticons = ['happy', 'unhappy', 'laughing', 'surprised'], |
|
|
138 |
_colors = ['red', 'yellow', 'green', 'blue'], |
|
|
139 |
_source = _sourceManager.remoteSource({ |
|
|
140 |
url: "http://192.168.56.101/musitag/tralalere/ldt/cljson/id/156c66cc-afe5-11e1-807a-58b035f6b93d", |
|
|
141 |
serializer: IriSP.serializers.ldt |
|
|
142 |
}), |
|
|
143 |
_template = |
|
|
144 |
'<ul class="home-dataviz home-dataviz-colors">' |
|
|
145 |
+ '{{#colors}}<li style="width: {{size}}px">' |
|
|
146 |
+ '<div class="tag-container-50" style="-webkit-transform-origin: bottom left; -webkit-transform: scale({{scale}}); -moz-transform-origin: bottom left; -moz-transform: scale({{scale}});">' |
|
|
147 |
+ '<div class="tag-color tag-{{annotation}}"></div></div></li>{{/colors}}' |
|
|
148 |
+ '</ul><ul class="home-dataviz home-dataviz-emoticon">' |
|
|
149 |
+ '{{#emoticons}}<li style="width: {{size}}px">' |
|
|
150 |
+ '<div class="tag-container-50" style="-webkit-transform-origin: bottom left; -webkit-transform: scale({{scale}}); -moz-transform-origin: bottom left; -moz-transform: scale({{scale}});">' |
|
|
151 |
+ '<div class="tag-color"></div><div class="tag-emoticon tag-{{annotation}}"></div></div></li>{{/emoticons}}' |
|
|
152 |
+ '</ul>'; |
|
|
153 |
_source.onLoad(function() { |
|
|
154 |
$("#dataviz-1").html(Mustache.to_html(_template,{emoticons:getVolumes(_source, _emoticons),colors:getVolumes(_source, _colors)})); |
|
|
155 |
}); |
|
|
156 |
</script> |
|
1
|
157 |
</body> |
|
|
158 |
</html> |