forked from next-door-nate/Lunch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
90 lines (70 loc) · 1.95 KB
/
scripts.js
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
$(document).ready(function(){
// Ready.... FIGHT!
/*====================================================
Particlez <3
====================================================*/
$('.featured-area').particleground({
curvedLines: false,
dotColor: 'rgba(255,255,255,.05)',
lineColor: 'rgba(255,255,255,.05)'
});
/*====================================================
Copyright foreverrrr
====================================================*/
var year = new Date().getFullYear();
$('.year').text(year);
/*====================================================
Natorize --> :n8::gold::eyes:
====================================================*/
$.fn.natorize = function(options) {
var defaults = {
enterOn: 'click', //timer, click
delayTime: 1000 //time till nate shows ups
};
var options = $.extend(defaults, options);
return this.each(function() {
var _this = $(this);
var nateImg = '<img id="nate" style="display: none; z-index: 100;" src="nate3.png" />'
var locked = false;
$('body').append(nateImg);
var nate = $('#nate').css({
"position":"fixed",
"bottom": "-700px",
"right" : "0",
"display" : "block",
"z-index": "100000"
})
function init() {
locked = true;
nate.animate({
"bottom" : "0"
}, function() {
$(this).animate({
"bottom" : "-130px"
}, 100, function() {
var offset = (($(this).position().left)+400);
$(this).delay(300).animate({
"right" : offset
}, 2200, function() {
nate = $('#nate').css({
"bottom": "-700px",
"right" : "0"
})
locked = false;
})
});
});
}
if(options.enterOn == 'timer') {
setTimeout(init, options.delayTime);
} else if(options.enterOn == 'click') {
_this.bind('click', function(e) {
e.preventDefault();
if(!locked) {
init();
}
})
}
});
}
});