This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vis2.html
74 lines (60 loc) · 3.07 KB
/
vis2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The FIFA Story</title>
<!-- linking stylesheet -->
<link rel="stylesheet" href="./static/styles.css">
<!-- linking d3.js -->
<script src="https://d3js.org/d3.v6.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/holtzy/D3-graph-gallery@master/LIB/d3.layout.cloud.js"></script>
<!-- linking fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Anton&display=swap">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap" rel="stylesheet">
</head>
<body style="overflow-y: auto;">
<div id="main_div">
<div id="top_bar">The FIFA Story</div>
<div class="graph_titles">Most Winning Teams</div>
<div>
<!-- Button to regenerate the image -->
<button onclick="regenerateImage()"
style="font-size: 20px; padding: 10px 20px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; margin-top: 20px;">
REGENERATE
</button>
</div>
<div id="word_cloud">
<!-- Adding an image in the center, taking up most of the screen size and responsive -->
<img id="wordcloud_image" src="./static/wordclouds/WCWinners_wordcloud1.jpg"
style="width: 100%; height: auto;">
</div>
<div class="inference-card">
<h2 class="inference-title">Inference</h2>
<p class="inference-text">The Word Cloud shows us very well and with ease about all the countries that have
won the most matches. It is a type of visualisation to engage users visually by aethetics as well as
with some bit of interaction.</p>
<p class="inference-text"> Although, the main purpose is to give a rough estimate about which are the
top leading countries and which are the tailing end countries with least wins in FIFA hitherto.</p>
</div>
<!-- Button to go to another page -->
<button onclick="window.location.href = 'vis3.html';"
style="font-size: 20px; padding: 10px 20px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; margin-top: 10px;">
Go to Top Goal Scorers (Nations)
</button>
</div>
</div>
<script>
function regenerateImage() {
// Generate a random number between 1 and 10
const randomNumber = Math.floor(Math.random() * 10) + 1;
// Construct the new image filename
const newImageName = `WCWinners_wordcloud${randomNumber}.jpg`;
// Update the src attribute of the image with the new filename
document.getElementById("wordcloud_image").src = `./static/wordclouds/${newImageName}`;
}
</script>
</body>
</html>