-
Notifications
You must be signed in to change notification settings - Fork 98
/
index.html
241 lines (223 loc) · 11.2 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
<!DOCTYPE html>
<html>
<head>
<title>Artist Explorer</title>
<meta charset="utf-8">
<meta property="og:image" content="https://artistexplorer.spotify.com/img/artistexplorer.png">
<meta property="og:site_name" content="Artist Explorer">
<meta property="og:title" content="Artist Explorer is a music discovery tool to to explore artists and music by browsing artists through a relationship tree">
<link rel="stylesheet" href="css/jquery-ui.min.css">
<link rel="stylesheet" href="css/sp-bootstrap.min.css">
<link rel="stylesheet" href="css/spoticons.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body id="mainn">
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=1631513343747536&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</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-56769808-1', 'auto');
ga('send', 'pageview');
</script>
<div class="main-container">
<div id="rightpane">
<div id="config">
<h4>Configuration </h4>
<div id="volume-container">
<div class="range-desc">Volume:</div>
<div class="range-bar">
<input type="range" class="slider" min="0" max="1" step="0.05" oninput="Player.setVolume(this.value)"/>
</div>
</div>
<div id="range-container">
<div class="range-desc">Max #artists to expand:</div>
<div class="range-bar">
<input type="range" class="slider" min="1" max="20" step="1" oninput="AE.changeNumberOfArtists(this.value)"/>
<div id="range-indicator">10</div>
</div>
</div>
</div>
<div id="repeat-artists-container">
Expand already explored artists:
<div id="checkbox-div">
<input type="checkbox" id="repeatArtists" onclick="AE.setRepeatArtists()">
</div>
</div>
<hr>
<div data-bind="visible: !isArtistInfoVisible()" id="hoverwarning">
<h4>Help</h4>
<ul>
<li>Click on an artist to see related artists. </li>
<li>Hover over an artist to hear a sample of their music.</li>
<li>Enter an artist name or a genre and explore relationships between over 2,000,000 artists on Spotify.</li>
<li>Log In and press "Create Playlist" button to create a random playlist of top tracks of all the artists that are visible in the relationship tree</li>
<li>Press the save button next to a track on the right side bar to save the track to your Artist Explorer Playlist</li>
</ul>
<h4>Info</h4>
Artist Explorer displays data from <a target="_blank" href="https://developer.spotify.com/web-api/">the Spotify Web API </a>
<a target="_blank" href="https://github.com/fsahin/artist-explorer">
<div id= "see-the-code">
<img src="./img/github.png" style="float:left;"/>
<h3 style="margin-top:10px;">See the Code</h3>
</div>
</a>
</div>
<!-- Artist Info -->
<div data-bind="visible: isArtistInfoVisible" id="infobox">
<h4>Artist Info </h4>
<a target="_blank" data-bind="text: artistName, attr: { href:spotifyLink }" id="artistName"> </a>
<p </p>
<div id="chart_div" style="width: 350px; height: 120px;"></div>
<h4>Popular Tracks</h4>
<table class="table" data-bind="visible: topTracks().length > 0, foreach: topTracks">
<tbody>
<tr>
<td class="tl-play">
<button data-bind="css: {'spoticon-play-16': !isPlaying(), 'spoticon-spotify-connect-16': isPlaying()}, click: $parent.playTrackWithoutGap" class="astext"></button>
</td>
<td class="tl-save">
<button type="button" data-bind="css: {'spoticon-plus-16': !isSaved(), 'spoticon-check-16': isSaved()}, click: $parent.saveTrack", class="astext"></button>
</td>
<td class="wrapp" data-bind="event: { mouseover: $parent.playTrack, mouseout: $parent.playTrackCancel }">
<a target="_blank" data-bind="text: name, attr: { href:spotifyLink }"> </a>
</td>
</tr>
</tbody>
</table>
<hr>
<div data-bind="visible: genres().length > 0">
<h4 id ="main-genres-label">Main Genres</h4>
<ul data-bind="foreach: genres" id="mainGenres">
<li>
<a data-bind="text: titleCaseName, click: $parent.switchToGenre"></a>
</li>
</ul>
</div>
</div>
</div>
<div class ="left">
<nav id="navbarup" class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="">
<span class="navbar-logo"></span>
<span class="navbar-title">Artist Explorer</span>
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling on mobile -->
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<ul class="nav navbar-nav navbar-left">
<li><a target="_blank" href="https://github.com/fsahin/artist-explorer">See the code</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#" data-bind="visible: !isLoggedIn()" onClick="AE.login()">Log In</a></li>
<li class="dropdown" data-bind="visible: isLoggedIn()">
<img class="profile-image" data-bind="attr:{src: userImage}"/>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span id="display-name" data-bind="text: displayName"></span>
<span class="icon-chevron-down"></span></a>
<ul class="dropdown-menu dropdown-menu-left" role="menu">
<li><a href="#" onClick="AE.logout()">Log Out</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav>
<div id="search" class="row">
<form id="search-artist" class="form-horizontal col-sm-6 col-md-6" role="form">
<input id="artist-search" class="form-control" placeholder="Search for an Artist">
</form>
<form id="search-genre" class="form-horizontal col-sm-6 col-md-6" role="form">
<input id="genre-search" class="form-control" placeholder="Search for a Genre">
</form>
</div>
<div id="tree-container"></div>
<div id="share-div">
<button type="button" class="btn btn-primary btn-sm" onClick="AE.createPlaylistModal()">
Create Playlist
</button>
</div>
</div>
<!-- Create Playlist Modal -->
<div class="modal fade" id="createPlaylistModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="exampleModalLabel">Playlist Details</h4>
</div>
<div class="modal-body">
<form>
<div id="playlist-name-form-group" class="form-group">
<label for="playlist-name" class="control-label">Playlist Name:</label>
<input type="text" id="text-playlist-name" class="form-control" id="playlist-name" placeholder="Enter Playlist Name">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary btn-sm" onClick="AE.createPlaylist()">Create</button>
</div>
</div>
</div>
</div>
<!-- Error Modal -->
<div class="modal fade" id="error-modal" tabindex="-1" role="dialog" aria-labelledby="smallModal" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title warning" id="exampleModalLabel">Error</h4>
</div>
<div class="modal-body" data-bind="text: errorMessage"></div>
<div class="modal-footer">
<button type="button" class="btn btn-primary btn-sm" data-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
<!-- Playlist Created Modal -->
<div class="modal fade" id="playlistCreatedModal" tabindex="-1" role="dialog" aria-labelledby="smallModal" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-body">
<h3>Playlist Created!</h3>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary btn-sm" data-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['gauge']}]}"></script>
<script src="./bower_components/spotify-web-api-js/src/spotify-web-api.js"></script>
<script src="./bower_components/knockout/dist/knockout.js"></script>
<script src="./js/lib/jquery-1.10.2.min.js"></script>
<script src="./js/lib/jquery-ui-1.11.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.4.12/d3.min.js"></script>
<script src="js/util.js"></script>
<script src="js/dndTree.js"></script>
<script src="js/oauth-manager.js"></script>
<script src="js/oauth-config.js"></script>
<script src="js/local-api.js"></script>
<script src="js/main.js"></script>
<script src="js/audioPlayer.js"></script>
</html>