-
Notifications
You must be signed in to change notification settings - Fork 1
/
index1.html
executable file
·197 lines (171 loc) · 4.66 KB
/
index1.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title>About</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<style type="text/css">
body {
background: #f0f0f0;
}
body, html {
height: 100%;
margin:0;
padding:0;
overflow-x: hidden;
}
#main {
padding:0;
height: 100%;
}
#home {
background-image: url("chess_game_wallpaper.jpg");
background-repeat: no-repeat;
background-size: cover;
}
#topbar{
height:5%;
min-width:70%;
background-color:black;
}
section {
padding :13%;
height: 100%;
}
#dot-nav{
right: 10px;
top: 50%;
margin-top: -50px;
height: 100px;
z-index: 999;
}
#dot-nav ul {
list-style: none;
margin:0;
padding: 0;
}
#dot-nav li {
position: relative;
background-color: #bdc3c7;
border:3px solid #bdc3c7;
border-radius: 15px 15px 15px 15px;
cursor: pointer;
padding: 5px;
height: 10px;
margin: 10px 10px 0px 0px;
width: 10px;
vertical-align:bottom;
}
#dot-nav li.active, #dot-nav li:hover {
background-color: #8e44ad;
}
#dot-nav a {
outline: 0;
vertical-align:top;
margin: 0px 0px 0px 25px;
position: relative;
top:-5px;
}
.awesome-tooltip + .tooltip > .tooltip-inner {
background-color: #8e44ad;
color: #f5f5f5;
border: 1px solid #8e44ad;
}
.awesome-tooltip + .tooltip.left > .tooltip-arrow{
top:50%;
right:0;
margin-top:-5px;
border-top:5px solid transparent;
border-bottom:5px solid transparent;
border-left:5px solid #8e44ad;
}
</style>
<script src="jquery-1.10.2.min.js"></script>
<script src="bootstrap.min.js"></script>
</head>
<body>
<div id="topbar" class="row">
</div>
<div data-spy="affix" id="dot-nav">
<ul>
<li class="awesome-tooltip active" title="Home"><a href="#home"></a></li>
<li class="awesome-tooltip" title="About"><a href="#about"></a></li>
</ul>
</div>
<div id="main" class="container-fluid">
<section id="home">
<article>
<div class="row">
<div class="col-md-12">
<h1>Home Section <small>Secondary text</small></h1>
<p>
This is a content.
</p>
</div>
</div>
</article>
</section>
<section id="about">
<article>
<div class="row">
<div class="col-md-12">
<h1>About Section <small>Secondary text</small></h1>
<p>Print icon: <span class="glyphicon glyphicon-print"></span></p>
<p>
This is a content.
</p>
</div>
</div>
</article>
</section>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('.awesome-tooltip').tooltip({
placement: 'left'
});
$(window).bind('scroll',function(e){
dotnavigation();
});
function dotnavigation(){
var numSections = $('section').length;
$('#dot-nav li a').removeClass('active').parent('li').removeClass('active');
$('section').each(function(i,item){
var ele = $(item), nextTop;
console.log(ele.next().html());
if (typeof ele.next().offset() != "undefined") {
nextTop = ele.next().offset().top;
}
else {
nextTop = $(document).height();
}
if (ele.offset() !== null) {
thisTop = ele.offset().top - ((nextTop - ele.offset().top) / numSections);
}
else {
thisTop = 0;
}
var docTop = $(document).scrollTop();
if(docTop >= thisTop && (docTop < nextTop)){
$('#dot-nav li').eq(i).addClass('active');
}
});
}
/* get clicks working */
$('#dot-nav li').click(function(){
var id = $(this).find('a').attr("href"),
posi,
ele,
padding = 0;
ele = $(id);
posi = ($(ele).offset()||0).top - padding;
$('html, body').animate({scrollTop:posi}, 'slow');
return false;
});
/* end dot nav */
});
</script>
</body>
</html>