-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
151 lines (131 loc) · 4.37 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="description" content="This website helps to find what's on the other side of the world.">
<meta name="keywords" content="Center, Earth, Planet, Through, Globe, d3.js, Map, Tunnel">
<meta name="author" content="Dejan Simic">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Journey Through the Center of the Earth...</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Alegreya+SC|Bungee+Shade">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
html {
min-height: 100%;
}
body {
margin: 0;
background: rgb(249,246,241);
}
h1 {
font-family: 'Bungee Shade', cursive;
margin-left: 40px;
}
div {
margin: 0px;
}
/* Responsive grid boxes */
.header {
width: calc(100% - 250px - 5%);
text-align: center;
height: 80px;
}
.main {
width: calc(100% - 250px - 5%);
min-width: 600px;
height: calc(100vh - 80px - 30px);
float: left;
}
.sidebar {
width: 250px;
margin-right: 5%;
float: right;
right: 10px;
height: calc(100vh - 80px - 30px);
padding: 10px;
box-sizing: border-box;
}
/* Spacing of globe */
svg#globe {
margin-top: 20px;
}
/* Description style */
.sidebar div {
position: relative;
width: 250px;
text-align: justify;
font-family: Alegreya SC, serif;
}
.golden {
color: rgb(204, 153, 0);
}
p.golden {
font-size: 0.8em;
}
a.golden {
text-decoration: none;
}
a.golden:hover {
color: rgb(85,45,132);
}
/* Footer definition */
.line-center{
margin:0;padding:0 10px;
background:rgb(249,246,241);
display:inline-block;
}
#footer{
text-align:center;
position:relative;
z-index:2;
}
#footer:after{
content:"";
position:absolute;
top:50%;
left:0;
right:0;
border-top:solid 1px rgb(204, 153, 0);
z-index:-1;
}
</style>
</head>
<body>
<div class="header">
<h1>A Journey Through the Center of the Earth</h1>
</div>
<div class="main" id="map"></div>
<div class="sidebar">
<div id="globe"></div>
<div id="description">
<p>This map helps to find what's on the other side of the world. Just drag one of the
<span class="golden">golden dots</span> to find out where you would end up if you
would build a tunnel through the center of our blue planet.
</p>
</div>
<div id="footer">
<span class="line-center">
<p class="golden">
<a class="golden" href="https://www.linkedin.com/in/dejsimic/" target="_blank">
Dejan Simic <i class="fa fa-linkedin-square" aria-hidden="true"></i></a> - 2017
</p>
</span>
</div>
</div>
</body>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="./wwwroot/scripts/lib.js"></script>
<script>
lib.globe();
d3.select("#description span.golden").on("mouseover", function (d) {
d3.select(this).style("background", "rgba(204, 153, 0, 0.1)");
d3.select("#projection0 .position").attr("fill", "rgb(166, 128, 21)").attr("stroke", "rgb(85, 45, 132)");
d3.select("#projection0 .antipode").attr("fill", "rgb(166, 128, 21)").attr("stroke", "rgb(85, 45, 132)");
});
d3.select("#description span.golden").on("mouseout", function (d) {
d3.select(this).style("background", "none");
d3.select("#projection0 .position").attr("fill", "rgb(204, 153, 0)").attr("stroke", "rgb(249,246,241)");
d3.select("#projection0 .antipode").attr("fill", "rgb(204, 153, 0)").attr("stroke", "rgb(249,246,241)");
});
</script>
</html>