-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
89 lines (78 loc) · 2.16 KB
/
script.js
File metadata and controls
89 lines (78 loc) · 2.16 KB
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
$(document).ready(function() {
// Wait for window load
$(window).load(function() {
// Animate loader off screen
$(".se-pre-con").fadeOut("slow");;
});
//cindy jump effect
$('.cindy').on('click', function() {
$('.cindy').slideUp(1000, function() {
$(this).find('img').html();
$('.cursor').css('display', 'none');
$('.cursor_jump').css('display', 'inline');
$('.cindy_jump').slideDown(1000);
$('#caption').replaceWith("<h3 id='caption'>Or not if you prefer.</h3>");
});
});
//reverse jump
$('.cindy_jump').on('click', function() {
$('.cindy_jump').slideUp(1000, function() {
$(this).find('img').html();
$('.cursor_jump').css('display', 'none');
$('.cursor').css('display', 'inline');
$('.cindy').slideDown(1000);
$('#caption').replaceWith("<h3 id='caption'>See me jump.</h3>");
});
});
//Slide down to about section
$(".down").click(function() {
$('html, body').animate({
scrollTop: $(".about").offset().top
}, 1000);
});
$(".up").click(function() {
$('html, body').animate({
scrollTop: $(".opening").offset().top
}, 1000)
});
$(".nav-about").click(function() {
$('html, body').animate({
scrollTop: $(".about").offset().top
}, 1000);
});
$(".nav-projects").click(function() {
$('html, body').animate({
scrollTop: $(".projects").offset().top
}, 1000);
});
$(".nav-contact").click(function() {
$('html, body').animate({
scrollTop: $(".contact").offset().top
}, 1000);
})
$(".nav-home").click(function() {
$('html, body').animate({
scrollTop: $(".opening").offset().top
}, 1000);
});
//responsive nav bar
var previousScroll = 0,
headerOrgOffset = $('.nav').height();
$('.buttons').height($('.nav').height());
$(window).scroll(function () {
var currentScroll = $(this).scrollTop();
if (currentScroll > headerOrgOffset) {
if (currentScroll > previousScroll) {
$('.buttons').slideUp(500);
} else {
$('.buttons').slideDown(500);
}
} else {
$('.buttons').slideDown(500);
}
previousScroll = currentScroll;
});
$('#fullpage').fullpage({
slidesNavigation: true
});
});