-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
174 lines (159 loc) · 6.02 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>D3 Fantasy | Zhao Xiong</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Permanent+Marker' rel='stylesheet' type='text/css'>
<script src="js/d3.min.js" charset="utf-8"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<style type="text/css">
body {
font-family: 'Permanent Marker', cursive;
color: black;
}
#title {
border-style: solid;
border-color: black;
border-width: 10px;
position: relative;
}
#name {
position: absolute;
top: -60px;
font-size: 40px;
left:0px;
}
#d3 {
position: relative;
}
#fantasy {
position: relative;
}
#contact {
position: absolute;
bottom: -60px;
right:0px;
font-size: 40px;
}
#contact a {
color: black;
}
#lists {
cursor: pointer;
font-size: 20px;
text-align: left;
}
#lists ul{
list-style-type: none;
width:100%;
padding-left: 0px;
}
#lists li{
position: relative;
float:left;
width:45%;
margin-right: 5%;
padding: 5px;
}
#lists li:hover{
background-color: black;
color: white;
}
@media (max-width:768px) and (orientation: portrait) {
#lists li{
width:28%;
margin-right: 5%;
padding: 5px;
}
}
</style>
<body onresize="resize()">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-sm-offset-3 col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3" id="title">
<!--
<svg height="210" width="500" style="position:absolute;left:0px;" id="topLine">
<line x1="0" y1="0" x2="0" y2="0" style="stroke:rgb(0,0,0);stroke-width:10;" />
</svg>
-->
<span id="name">Zhao Xiong</span>
<h1 id="d3">D3</br></h1>
<h1 id="fantasy">Fantasy.</h1>
<span id="contact"><a href="mailto:[email protected]" target="_top">Contact Me</a></span>
</div>
<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3" id="lists">
<ul>
<li>NO.1</li>
<li>NO.2</li>
<li>NO.3</li>
<li>NO.4</li>
<li>NO.5</li>
<li>NO.6</li>
</ul>
</div>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="js/draw.js"></script>
<script>
function resize(){
draw();
}
draw();
function draw(){
var windowHeight = $(window).height(),
windowWidth = $(window).width();
var isPortrait = false;
if (windowWidth<768){
isPortrait = windowWidth < windowHeight ? true : false;
}
var title = document.getElementById("title");
title.style.height = title.clientWidth + "px";
title.style.top = ((windowHeight - title.clientWidth) / 2) + "px";
var d3 = document.getElementById("d3");
d3.style.fontSize = (title.clientWidth / 3)*1.5 + "px";
var fantasy = document.getElementById("fantasy");
fantasy.style.fontSize = (title.clientWidth / 7)*1.5 + "px";
var lists = document.getElementById("lists");
lists.style.top = ((windowHeight - title.clientWidth) / 2) + "px";
if (isPortrait){
title.style.top = ((windowHeight - title.clientWidth) / 2 - 40) + "px";
lists.style.top = ((windowHeight - title.clientWidth) / 2 + 10) + "px";
}
title.addEventListener("mouseover", function(){
title.style.backgroundColor = "black";
d3.style.color = "white";
fantasy.style.color = "white";
},false);
title.addEventListener("mouseleave", function(){
title.style.backgroundColor = "white";
d3.style.color = "black";
fantasy.style.color = "black";
},false);
// var top = document.getElementById("topLine");
// top.style.height = ((windowHeight - title.clientWidth) / 2) + "px";
// top.style.width = (title.clientWidth /2) + "px";
// top.style.top = (-(windowHeight - title.clientWidth) / 2 - 10) + "px";
//
// topLine = top.children[0];
// topLine.x1.baseVal.value = title.clientWidth/2;
// topLine.y2.baseVal.value = ((windowHeight - title.clientWidth) / 2 + 10);
}
</script>
</body>
</html>