-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
486 lines (440 loc) · 20.6 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Lebron Jenkins</title>
<link rel="stylesheet" href="fontawesome-5.5/css/all.min.css" />
<link rel="stylesheet" href="slick/slick.css">
<link rel="stylesheet" href="slick/slick-theme.css">
<link rel="stylesheet" href="magnific-popup/magnific-popup.css">
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/templatemo-style.css" />
<link rel="stylesheet" href="css/viz4_style.css"/>
<link rel="stylesheet" href="css/container_style.css"/>
<link rel="stylesheet" href="css/viz1_style.css"/>
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script> d3v3=d3;window.d3=null</script>
<script src="https://d3js.org/d3.v4.js"></script>
<script src="https://cdn.jsdelivr.net/npm/d3-array@3.0.2/dist/d3-array.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.10/lodash.min.js"></script>
<script src="https://d3-geomap.github.io/d3-geomap/d3-geomap.min.js"></script>
<script src="https://d3js.org/topojson.v1.min.js"></script>
</head>
<body>
<!-- Hero section -->
<section id="hero" class="text-white tm-font-big tm-parallax">
<!-- Navigation -->
<nav class="navbar navbar-expand-md tm-navbar" id="tmNav">
<div class="container">
<div class="tm-next">
<a href="https://github.com/com-480-data-visualization/datavis-project-2022-lebron-jenkins" class="navbar-brand">Lebron Jenkins</a>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<i class="fas fa-bars navbar-toggler-icon"></i>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link tm-nav-link" href="#introduction">Introduction</a>
</li>
<li class="nav-item">
<a class="nav-link tm-nav-link" href="#viz1">Travel Map</a>
</li>
<li class="nav-item">
<a class="nav-link tm-nav-link" href="#viz2">Rankings</a>
</li>
<li class="nav-item">
<a class="nav-link tm-nav-link" href="#viz4">Fantasy Basket</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="text-center tm-hero-text-container">
<div class="tm-hero-text-container-inner">
<h2 class="tm-hero-title">NBA visualized</h2>
<p class="tm-hero-subtitle">
the NBA from 2003 to 2020
<br />by Lebron Jenkins
</p>
</div>
</div>
<div class="tm-next tm-intro-next">
<a href="#introduction" class="text-center tm-down-arrow-link">
<i class="fas fa-3x fa-caret-down tm-down-arrow"></i>
</a>
</div>
</section>
<div class="content-full-container" style="background-color: #ececec; display:flex; width:100%; flex-direction: column; align-content: center;">
<!------------------------------------------ INTRODUCTION ---------------------------------------->
<section id="introduction" class="tm-section-pad-top" style="padding-bottom: 5%; padding-top: 5%;">
<div class="container">
<div class="row">
<div class="col-lg-6">
<img src="https://wallpaperaccess.com/full/2872553.jpg" alt="Image" class="img-fluid tm-intro-img";/>
</div>
<div class="col-lg-6">
<div class="tm-intro-text-container">
<h2 class="tm-text-primary mb-4 tm-section-title">Introduction</h2>
<p class="mb-4 tm-intro-text">
This is our website where we are going to analyse <strong>the NBA from 2003 to 2020</strong>.
Built on a dataset containing all the statistics of every player involved in every game during these seasons.
We used these precious data to try to provide insights and fun interactive visualizations for basketball lovers
or beginner that want to have fun discovering the teams, and the players.
</p>
<div class="tm-next">
<a href="https://www.kaggle.com/datasets/nathanlauga/nba-games" class="tm-intro-text tm-btn-primary">Read More</a>
</div>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------------------- Viz ----------------------------------------->
<section id="viz1" class="tm-section-pad-top" style="padding-top: 3%; padding-bottom: 3%;">
<div class="row", style="width:70%;">
<div class="text-center col-12">
<h2 class="tm-text-primary tm-section-title mb-4">Surfin' USA</h2>
<div style="width: 100%; text-align: center;">
<p> Playing regulary throughout all the United States creates a huge amount of transport.
With this visualization see the movement of your favorite team during all the season.
You can also compare the movement of multiple team and use the two graphs to see the
evolution of the points between the teams. You can also compare the number of kilometers made
by the teams.
</p>
</div>
</div>
</div>
<div class="container tm-container-gallery">
<div id = "viz1-container">
<div id = "viz1-left-part">
<div id = "viz1-header">
</div>
<div id = "viz1-map"></div>
<div id = "viz1-bottom">
<div id = "viz1-play-button-zone">
<button id="viz1-play-button" buttontype="paused">
<img src="css/static/icons8-play-button-circled-50.png"/>
</button>
</div>
<div id = "viz1-timeline">
</div>
</div>
</div>
<div id = "viz1-right-part">
<div id="viz1-statistics-wp">
</div>
<div id="viz1-statistics-km">
</div>
</div>
</div>
</section>
<!------------------------------------------- END OF VIZ ------------------------------------------------->
<!---------------------------------------------- Viz ----------------------------------------->
<section id="viz2" class="tm-section-pad-top" style="padding-bottom: 5%; padding-top: 5%;">
<div class="container tm-container-gallery">
<div class="row">
<div class="text-center col-12">
<h2 class="tm-text-primary tm-section-title mb-4">Evolution of the rankings</h2>
<p>
You struggle to capture the whole evolution of the ranking during a season?
You want to relieve the fight for the title during your favourite season? Then this visualization is
made for you! You can select the season and see the evolution of the ranking of every team
throughout the season.
</p>
</div>
</div>
<div style="display:flex; flex-direction:row; justify-content: center; height:50px; padding: 10px; width: 100%;">
<div style="padding-right:50px">
<p>Select a season :</p>
</div>
<select id="selectButton"></select>
</div>
<div class="viz2plot">
</div>
</div>
</section>
<!------------------------------------------- END OF VIZ ------------------------------------------------->
<!---------------------------------------------- Viz ----------------------------------------->
<!-- <section id="viz3" class="tm-section-pad-top">
<div class="container tm-container-gallery">
<div class="row">
<div class="text-center col-12">
<h2 class="tm-text-primary tm-section-title mb-4">Fantasy Basketball</h2>
<div id="basketball-field">
<h1>Make your team with players below</h1>
<div class="drop-targets" id="team-left">
<div class="field-player" id="field-player_0"></div>
<div class="field-player" id="field-player_1"></div>
<div class="field-player" id="field-player_2"></div>
<div class="field-player" id="field-player_3"></div>
<div class="field-player" id="field-player_4"></div>
</div>
<div class="drop-targets" id="team-right">
<div class="field-player" id="field-player_0"></div>
<div class="field-player" id="field-player_1"></div>
<div class="field-player" id="field-player_2"></div>
<div class="field-player" id="field-player_3"></div>
<div class="field-player" id="field-player_4"></div>
</div>
<h2>Awesome statistics</h2>
<div class="row" id="team-stats">
<div id="teamA-stats"></div>
<div id="team-stats-labels"></div>
<div id="teamB-stats"></div>
</div>
</div>
</div>
</div> -->
<!--
</div>
</section>
-->
<!------------------------------------------- END OF VIZ ------------------------------------------------->
<!---------------------------------------------- Viz ----------------------------------------->
<section id="viz4" class="tm-section-pad-top" style="padding-bottom: 5%; padding-top: 5%;">
<div class="container tm-container-gallery">
<div class="row">
<div class="text-center col-12">
<h2 class="tm-text-primary tm-section-title mb-4">Become the coach!</h2>
<p>
Ever wondered who would win between a team featuring Lebron James and Kobe, and one featuring Steve Nash and Yao Ming?
You have, below, the choice between 100 of the best player of the twenty past years. Create you dream
team and make it face another team of your choice to see who would win! The plot displays two statistics :
the predicted number of points of each team, and the efficiency score of the players used y the NBA itself.
</p>
<h5>Create the game of your wildest dreams!</h4>
</div>
<!-- PLAYER SELECTOR -->
<div class="court-title">
<h1>Make your team with players below</h1>
</div>
<div id="player-selector" style="width:100%; margin:10%; height: 400px;">
<div style="display:flex; flex-direction: row; justify-content: space-between;">
<p> </p>
<!-- BUTTONS :-->
<div style="display:flex; flex-direction:row; justify-content:center; padding:10px">
<button class="page_selection_button" onclick="pageSelection(1);">1</button>
<button class="page_selection_button" onclick="pageSelection(2);">2</button>
<button class="page_selection_button" onclick="pageSelection(3);">3</button>
<button class="page_selection_button" onclick="pageSelection(4);">4</button>
<button class="page_selection_button" onclick="pageSelection(5);">5</button>
<button class="page_selection_button" onclick="pageSelection(6);">6</button>
<button class="page_selection_button" onclick="pageSelection(7);">7</button>
<button class="page_selection_button" onclick="pageSelection(8);">8</button>
<button class="page_selection_button" onclick="pageSelection(9);">9</button>
<button class="page_selection_button" onclick="pageSelection(10);">10</button>
</div>
</div>
<div style="width: 100%; height : 100%; background-color: #d8d8d8 ; border-radius: 10px; margin:10px; display:flex; justify-content:space-evenly; flex-direction: column;" id="player-faces-container">
<div style="width : 100%; display:flex; justify-content: space-between; align-items: space-between;" id="player-faces-row1"></div>
<div style="width: 100%; display:flex; justify-content: space-between; align-items: space-between;" id="player-faces-row2"></div>
</div>
</div>
<!-- END PLAYER SELECTOR -->
<!-- COURT -->
<div id="basketball-field">
<div class="drop-targets">
<div class="drop-targets-subteam" id="team-left">
<div class="defense-player-line">
<div class="field-player" id="field-player_0"></div>
<div class="field-player" id="field-player_1"></div>
</div>
<div class="mid-player-line">
<div class="field-player" id="field-player_2"></div>
<div class="field-player" id="field-player_3"></div>
</div>
<div class="field-player" id="field-player_4"></div>
</div>
<div class="drop-targets-subteam" id="team-right">
<div class="field-player" id="field-player_4"></div>
<div class="mid-player-line">
<div class="field-player" id="field-player_0"></div>
<div class="field-player" id="field-player_1"></div>
</div>
<div class="defense-player-line">
<div class="field-player" id="field-player_2"></div>
<div class="field-player" id="field-player_3"></div>
</div>
</div>
</div>
<!-- END COURT -->
<div style="display:flex; flex-direction:column; justify-content:center; align-items:center; align-content: center;">
<h3>Teams' stats: </h3>
<!-- TEAM STAT -->
<div class="row" id="team-stats">
<!-- <div style="width: 150px;">
<h1>Teams' Stats</h1>
</div> -->
<div id="teamA-stats"></div>
<div id="team-stats-labels"></div>
<div id="teamB-stats"></div>
</div>
</div>
<!-- END TEAM STAT -->
</section>
<div class="footer">
<!-- AUTHORS -->
<div style="width:30%">
<div class="creator">
<h5 style="color: white">Antoine Magron</h5>
<p><a href="https://github.com/magantoine">@magantoine</a></p>
</div>
<div class="creator">
<h5 style="color: white">Mathieu Desponds</h5>
<p><a href="https://github.com/Mathiponds">@Mathiponds</a></p>
</div>
<div class="creator">
<h5 style="color: white">Paul Juillard</h5>
<p><a href="https://github.com/PaulJuillard">@PaulJuillard</a></p>
</div>
</div>
<!-- END AUTHORS -->
<div style="width:17%; text-align:center; vertical-align: center; height:50%">
<p>Made for data visualization course at EPFL (COM-480), Spring Semester 2022, link to our github <a href="https://github.com/com-480-data-visualization/datavis-project-2022-lebron-jenkins">here</a></p>
</div>
</div>
</div>
<!------------------------------------------- END OF VIZ ------------------------------------------------->
<script src="js/jquery-1.9.1.min.js"></script>
<script src="slick/slick.min.js"></script>
<script src="magnific-popup/jquery.magnific-popup.min.js"></script>
<script src="js/jquery.singlePageNav.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/viz4.js"></script>
<script type="module" src="js/viz2.js"></script>
<script type="module" src="js/viz1.js"></script>
<script type="module" src="js/viz1_slider.js"></script>
<script>
function getOffSet(){
var _offset = 450;
var windowHeight = window.innerHeight;
if(windowHeight > 500) {
_offset = 400;
}
if(windowHeight > 680) {
_offset = 300
}
if(windowHeight > 830) {
_offset = 210;
}
return _offset;
}
function setParallaxPosition($doc, multiplier, $object){
var offset = getOffSet();
var from_top = $doc.scrollTop(),
bg_css = 'center ' +(multiplier * from_top - offset) + 'px';
$object.css({"background-position" : bg_css });
}
// Parallax function
// Adapted based on https://codepen.io/roborich/pen/wpAsm
var background_image_parallax = function($object, multiplier, forceSet){
multiplier = typeof multiplier !== 'undefined' ? multiplier : 0.5;
multiplier = 1 - multiplier;
var $doc = $(document);
// $object.css({"background-attatchment" : "fixed"});
if(forceSet) {
setParallaxPosition($doc, multiplier, $object);
} else {
$(window).scroll(function(){
setParallaxPosition($doc, multiplier, $object);
});
}
};
var background_image_parallax_2 = function($object, multiplier){
multiplier = typeof multiplier !== 'undefined' ? multiplier : 0.5;
multiplier = 1 - multiplier;
var $doc = $(document);
$object.css({"background-attachment" : "fixed"});
$(window).scroll(function(){
var firstTop = $object.offset().top,
pos = $(window).scrollTop(),
yPos = Math.round((multiplier * (firstTop - pos)) - 186);
var bg_css = 'center ' + yPos + 'px';
$object.css({"background-position" : bg_css });
});
};
$(function(){
// Hero Section - Background Parallax
background_image_parallax($(".tm-parallax"), 0.30, false);
background_image_parallax_2($("#contact"), 0.80);
// Handle window resize
window.addEventListener('resize', function(){
background_image_parallax($(".tm-parallax"), 0.30, true);
}, true);
// Detect window scroll and update navbar
$(window).scroll(function(e){
if($(document).scrollTop() > 120) {
$('.tm-navbar').addClass("scroll");
} else {
$('.tm-navbar').removeClass("scroll");
}
});
// Close mobile menu after click
$('#tmNav a').on('click', function(){
$('.navbar-collapse').removeClass('show');
})
// Scroll to corresponding section with animation
$('#tmNav').singlePageNav();
// Add smooth scrolling to all links
// https://www.w3schools.com/howto/howto_css_smooth_scroll.asp
$("a").on('click', function(event) {
if (this.hash !== "") {
event.preventDefault();
var hash = this.hash;
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 400, function(){
window.location.hash = hash;
});
} // End if
});
// Pop up
$('.tm-gallery').magnificPopup({
delegate: 'a',
type: 'image',
gallery: { enabled: true }
});
// Gallery
$('.tm-gallery').slick({
dots: true,
infinite: false,
slidesToShow: 5,
slidesToScroll: 2,
responsive: [
{
breakpoint: 1199,
settings: {
slidesToShow: 4,
slidesToScroll: 2
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 3,
slidesToScroll: 2
}
},
{
breakpoint: 767,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
});
</script>
</body>
</html>