-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
132 lines (110 loc) · 3.56 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Stanley Champs</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.9.0/d3.js"></script>
<script src="vis.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.10/semantic.min.css">
<style>
#chart {
overflow: hidden;
position: fixed;
transform: translate( -150px, 10px );
}
.link {
fill: none;
stroke: #888888;
stroke-weight: 1px;
stroke-opacity: 0.5;
}
.node {
fill: #fff;
stroke: steelblue;
stroke-width: 2.5px;
font: 10px sans-serif;
}
.node text {
color: #333;
}
#infoPanel {
float: right;
height: 100%;
width: 350px;
border: black;
background: white;
position: fixed;
top: 0;
right: 0;
box-shadow: -9px 0px 20px 2px grey;
overflow-x: hidden;
overflow-y: hidden;
}
#teamLogo {
box-shadow: -3px 2px 14px 0px grey;
}
.roundedImage {
height: 150px;
width: 150px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
border-radius: 50%;
}
.sticky {
position: fixed;
background: white;
}
</style>
</head>
<body>
<div id="chart"></div>
<div id="infoPanel">
<div class="ui two column centered relaxed grid">
<div style="height: 30px;"></div>
<div class="two column centered row">
<div class="column">
<img id="teamLogo" src="https://upload.wikimedia.org/wikipedia/en/4/4b/2008StanleyCupFinals.png" alt="" class="ui roundedImage image">
</div>
</div>
<div class="two column centered row">
<div class="column">
<h1 id="teamName" class="ui center aligned header">
The Stanley Diagram
</h1>
</div>
</div>
<div id="winYear" class="ui row">
</div>
</div>
<div class="ui row divider" style="margin: 0px"></div>
<div id="rosterContainer" class="ui container">
<div id="teamRoster" class="ui middle aligned selection animated list" >
</div>
</div>
</div>
<button class="ui active button" style="position: fixed; margin: 10px; bottom: 0; left: 0;" onclick="toggleLengend()">
<i class="info icon"></i>
Legend
</button>
<script>
document.getElementById("teamRoster").setAttribute("style", "height: " +
String( window.innerHeight - 310 ) + "px; overflow-y: scroll;" );
var xhr = new XMLHttpRequest();
xhr.open('GET', 'legend.html', true);
xhr.onreadystatechange = function () {
document.getElementById("teamLogo").setAttribute("src", "https://upload.wikimedia.org/wikipedia/en/4/4b/2008StanleyCupFinals.png");
document.getElementById("teamName").innerText = "The Stanley Diagram";
document.getElementById("winYear").innerHTML = "";
if( this.readyState !== 4 ) return;
if( this.status !== 200 ) return;
document.getElementById("teamRoster").innerHTML = this.responseText;
};
xhr.send();
var width = window.innerWidth;
var height = window.innerHeight;
d3.json("dataset.json", init);
</script>
</body>
</html>