-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocs.html
286 lines (266 loc) · 9.12 KB
/
docs.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="hexmin.js"></script>
<style type="text/css">
@import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,300,200);
body{
margin: 0;
padding: 0;
background: #eee;
overflow-x: hidden;
}
.header{
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 60px;
background: #eee;
box-shadow: 0 4px 10px #333;
z-index: 1;
}
div.title{
position: absolute;
top: 60px;
left: 0px;
height: 200px;
width: 100%;
background: #6f7985;
z-index: 0;
}
div.title .text{
position: absolute;
top: 60px;
left: 30px;
font-family: 'Yanone Kaffeesatz', sans-serif;
font-weight: 200;
color: #fff;
font-size: 50px;
}
div.hex_ani{
position: absolute;
top: 0px;
left: 0px;
bottom: 0px;
right: 0px;
}
div.body{
position: absolute;
top: 250px;
left: 0px;
background: #eee;
width: 100%;
height: auto;
box-shadow: 0 -4px 10px #333;
padding: 25px 0 0 20%;
z-index: 4;
}
div.footer{
position: absolute;
bottom: -60px;
left: -5px;
height: 60px;
width: 100%;
background: #6f7985;
z-index: 0;
box-shadow: inset 0 4px 10px #333;
}
.wrapper{
width: 80%;
}
span.title{
font-family: 'Yanone Kaffeesatz', sans-serif;
font-weight: 300;
color: #0769ad;
font-size: 40px;
}
p{
font-family: sans-serif;
font-weight: 300;
color: #333;
font-size: 14px;
}
p a{
text-decoration: none;
color: #0769ad;
font-weight: bold;
}
p code{
background: #dee7f7;
border-radius: 3px;
padding: 2px 6px 2px 6px;
border: 1px solid #cdd6e6;
font-size: 13px;
margin-top: 15px;
}
p.sub{
margin-left: 35px;
}
ul li{
font-family: sans-serif;
font-weight: 300;
color: #333;
font-size: 14px;
margin-top: 5px;
}
.hex:before {content: ''; width: 0; height: 0; border-bottom: 12px solid #0769ad; border-left: 22px solid transparent; border-right: 22px solid transparent; position: absolute; top: -12px;} .hex {z-index: inherit; margin-top: 12px; width: 44px; height: 25px; background-color: #0769ad; position: relative; margin-left: 45px;} .hex:after { content: ''; width: 0; position: absolute; bottom: -12px; border-top: 12px solid #0769ad; border-left: 22px solid transparent; border-right: 22px solid transparent;}
</style>
<script type="text/javascript">
$(document).ready(function(){
show_hex();
});
function show_hex(){
$(".hex_ani").hex({show: true, direction: "left", background: "#0769ad", duration: 5, delay: 0, callback: function(){setTimeout("hide_hex()",5000);}});
}
function hide_hex(){
$(".hex_ani").hex({show: false, direction: "left", background: "#0769ad", duration: 5, delay: 0, callback: function(){setTimeout("show_hex()",5000);}});
}
</script>
</head>
<body>
<div class="header"></div>
<div class="title">
<div class="hex_ani">
</div>
<div class="text">jQuery Plugin: Hex</div>
</div>
<div class="body">
<div class="wrapper">
<span class="title">Getting Started</span>
<p>
jQuery is required for the plugin to work:<br><br>
<code>http://code.jquery.com/jquery-latest.min.js</code>
<br><br>
The element in which the hex effect is ment to be run needs to have the <code>position: relative</code> or <code>position: absolute</code> set in the css.
<br><br>
The plugin can be added to your file like usual:<br><br>
<code><script type="text/javascript" src="lib/hex.js"></script></code>
<br><br>
and can be downloaded here:
<br><br>
<a href="https://github.com/motorlatitude/Hex">Download via GitHub</a>
<br><br>
or
<br><br>
<a href="https://github.com/motorlatitude/Hex/archive/1.0.2.zip">Download Direct</a>
</p>
<span class="title">Basic Usage</span>
<p>
To use the effect with its default settings:
<br><br>
<code>$(".element").hex();</code>
<br><br>
This will reveal the element with the animation running from right to left and using hexagons with the default background <code>#eee</code>
</p>
<span class="title">Options</span>
<p>
All of the available options are listed below:
<br>
</p><ul>
<li>show</li>
<li>direction</li>
<li>background</li>
<li>duration</li>
<li>delay</li>
<li>callback</li>
</ul>
<p></p>
<span class="title"> Option: Show</span>
<p class="sub">
Values:
<br><br>
<code>default: true </code><br><br><code>accepted: BOOL</code>
<br><br>
The show option allows you to specifiy if you want to show or hide the element. The following code shows how to hide an element:
<br><br>
<code>$(".element").hex({show:false});</code>
<br><br>
and to show it:
<br><br>
<code>$(".element").hex({show:true});</code>
</p>
<span class="title"> Option: Direction</span>
<p class="sub">
Values:
<br><br>
<code>default: "right" </code><br><br><code>accepted: "right", "left", "up", "down", "random", "center"</code>
<br><br>
The direction option allows you to specify in which direction the hexagons will come in or go out. For example:
<br><br>
<code>$(".element").hex({direction: "random"});</code>
<br><br>
This will remove/add the hexagons randomly until the whole object is covered or revealed completely.
</p>
<span class="title"> Option: Background</span>
<p class="sub">
Values:
<br><br>
<code>default: "#eee" </code><br><br><code>accepted: "css color"</code>
<br><br>
The background option allows you to change the color of the hexagons, the default color is <code>#eee</code>. For example:
<br><br>
<code>$(".element").hex({background: "#005da6"});</code>
<br><br>
This will result in the hexagons being this color:<br><br>
<div class="hex"></div>
<br>
</p>
<span class="title"> Option: Duration</span>
<p class="sub">
Values:
<br><br>
<code>default: 10 </code><br><br><code>accepted: int > 0</code>
<br><br>
The duration option allows you to set how long it takes for hexagons to start vanishing. This value is randomly generated with respect to the location of the hexagon. By changing the duraiton value will be multiply the delay. So decreasing the duration value will cause the delay to be less than the hexagons will vanish earlier. For example
<br><br>
<code>$(".element").hex({duration: 5});</code>
<br><br>
This will result in the hexagons vanishing in half the time.
</p>
<span class="title"> Option: Delay</span>
<p class="sub">
Values:
<br><br>
<code>default: 0 </code><br><br><code>accepted: int > -1</code>
<br><br>
The amount of time in ms until the animation will run. For example
<br><br>
<code>$(".element").hex({delay: 1000});</code>
<br><br>
This will result that the animation will start 1s after the code above is executed.
</p>
<span class="title"> Option: Callback</span>
<p class="sub">
Values:
<br><br>
<code>default: function(){} </code><br><br><code>accepted: function(){ //your function here }</code>
<br><br>
The callback option lets you run a function once the animation has finished. For Example:
<br><br>
<code>$(".element").hex({callback: function(){console.log('done');}});</code>
<br><br>
This will result that once the animation is complete, <code>done</code> will be printed in the console.
</p>
<span class="title">Example</span>
<p>
This is the animation used on loading this doc.
<br><br>
<code>$(document).ready(function(){<br>
show_hex();<br>
});<br>
<br><br>
function show_hex(){<br>
$(".hex_ani").hex({show: true, direction: "left", background: "#0769ad", duration: 5, delay: 0, callback: function(){setTimeout("hide_hex()",5000);}});
}
<br><br>
function hide_hex(){<br>
$(".hex_ani").hex({show: false, direction: "left", background: "#0769ad", duration: 5, delay: 0, callback: function(){setTimeout("show_hex()",5000);}});
}</code>
</p>
</div>
<div class="footer"></div>
</div>
</body>
</html>