-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.html
155 lines (147 loc) · 7.09 KB
/
main.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
<!DOCTYPE html>
<html class="bg-black h-100">
<head>
<title>My Bubblify</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="title" content="My Bubblify">
<meta name="description" content="Bubble charts of top artists, albums and genres on Spotify">
<meta name="keywords" content="spotify, data visualization, bubble chart, music, circle chart, top tracks, top artists, top albums">
<meta name="robots" content="index, follow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="English">
<meta name="author" content="Özgür Akın">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Inter+Tight" rel="stylesheet" type="text/css">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8220604161222100" crossorigin="anonymous"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-8220604161222100",
enable_page_level_ads: true,
overlays: {bottom: true}
});
</script>
<style>
* {
font-family: 'Inter Tight', sans-serif;
}
circle{
transition: all 0.1s ease;
}
.node:hover circle{
transform: scale(1.1);
}
.node:hover > g > foreignObject > div > a{
transform: scale(1.1);
}
.row{
transition: opacity 0.4s ease-in-out;
overflow:hidden;
}
.chart{
height:0px;
opacity:0;
}
.chart-active{
height:100%;
opacity: 1;
}
</style>
</head>
<body class="bg-transparent" onload="checkAuthorized()">
<button style="position: absolute;" class="btn btn-outline-light float-end m-3 z-1" onclick="logout()" data-aos="fade-down" data-aos-delay="0"><i class="bi bi-box-arrow-left"></i></button>
<div class="container-fluid p-0">
<section>
<div class="row justify-content-center w-100 m-0 p-0">
<h1 class="display-3 text-white text-center mt-3 mb-0" data-aos="fade-down" data-aos-delay="0">Bubblify</h1>
<select class="form-select my-3" id="timeRangeSelect" style="max-width:300px" data-bs-theme="dark" data-aos="fade-down" data-aos-delay="100">
<option value="0">This Month</option>
<option value="1">6 Months</option>
<option value="2">All Time</option>
</select>
<ul class="nav nav-pills my-3 justify-content-center" id="pills-tab" role="tablist" data-aos="fade-down" data-aos-delay="200">
<li class="nav-item" role="presentation">
<button class="nav-link pill active" id="pills-artists" data-bs-toggle="pill">Artists</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link pill" id="pills-albums" data-bs-toggle="pill">Albums</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link pill" id="pills-genres" data-bs-toggle="pill">Genres</button>
</li>
</ul>
</section>
<section>
<div class="row justify-content-center w-100 m-0 p-0 chart" id="artists_container">
<h2 class="display-6 fs-3 text-white text-center mb-0 p-0">Top Artists</h2>
<div class="w-100 text-center mt-3 p-0" id="artists_chart"></div>
</div>
<div class="row justify-content-center w-100 m-0 p-0 chart" id="albums_container">
<h2 class="display-6 fs-3 text-white text-center mb-0">Top Albums</h2>
<div class="w-100 text-center mt-3 p-0" id="albums_chart"></div>
</div>
<div class="row justify-content-center w-100 m-0 p-0 chart" id="genres_container">
<h2 class="display-6 fs-3 text-white text-center mb-0">Top Genres</h2>
<div class="w-100 text-center mt-3 p-0" id="genres_chart"></div>
</div>
</section>
<section class="text-center">
<h2 class="display-6 fs-5 mt-5 text-white-50 text-center">Powered by</h2>
<img class="text-center mt-0 mb-2" style="height:70px;width: auto;" src="Spotify_Logo_RGB_White.png"/>
<h2 class="display-6 fs-5 text-white-50 text-center">bubblify.github.io</h2>
</section>
</div>
</div>
<script src="js/auth.js"></script>
<script src="js/app.js"></script>
<script src="https://d3js.org/d3.v6.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
<script>
const url = window.location.href;
const params = new URLSearchParams(url.split('?')[1]);
let time_range = params.get('time_range');
if (!time_range) {
time_range = 1
}
document.getElementById("timeRangeSelect").value = time_range;
timeRangeSelect.addEventListener("change", function() {
const selectedOption = this.value;
sessionStorage.removeItem("artists");
sessionStorage.removeItem("albums");
sessionStorage.removeItem("genres");
window.location.href = `main.html?time_range=${selectedOption}`;
});
document.getElementById('pills-artists').addEventListener('click', () => {
const container = document.getElementById('artists_container');
container.classList.add('chart-active');
document.getElementById('albums_container').classList.remove('chart-active');
document.getElementById('genres_container').classList.remove('chart-active');
renderArtistsAlbums(time_range);
});
document.getElementById('pills-albums').addEventListener('click', () => {
const container = document.getElementById('albums_container');
container.classList.add('chart-active');
document.getElementById('artists_container').classList.remove('chart-active');
document.getElementById('genres_container').classList.remove('chart-active');
renderArtistsAlbums(time_range);
});
document.getElementById('pills-genres').addEventListener('click', () => {
const container = document.getElementById('genres_container');
container.classList.add('chart-active');
document.getElementById('artists_container').classList.remove('chart-active');
document.getElementById('albums_container').classList.remove('chart-active');
renderGenres(time_range);
});
document.getElementById('pills-artists').click()
</script>
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<script>
AOS.init();
</script>
</body>
</html>