-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
119 lines (110 loc) · 3.62 KB
/
main.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
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
$(window).scroll(function(){
if ($(this).scrollTop() > 250) {
$('#scroll').fadeIn();
}
else {
$('#scroll').fadeOut();
}
});
$(document).ready(function(){
$('#scroll').click(function(){
$("html, body").animate({ scrollTop: 0 }, 1000);
return false;
});
$(".main-button").click(function() {
$('html, body').animate({ scrollTop: $(".about-section").offset().top }, 1000);
return false;
});
$(".about-button").click(function() {
$('html, body').animate({ scrollTop: $(".about-section").offset().top }, 1000);
return false;
});
$(".portfolio-button").click(function() {
$('html, body').animate({ scrollTop: $(".portfolio-section").offset().top }, 1000);
return false;
});
$(".contact-button").click(function() {
$('html, body').animate({ scrollTop: $(".contact-section").offset().top }, 1000);
return false;
});
$('.navbar-nav>li>a').click(function(){
if($(window).width() < 768){
$('.navbar-collapse').css('height', 0);
}
$('.navbar-collapse').collapse('hide');
});
});
$(document).ready(function(){
var i = 0;
var txt = "I'm a full stack developer.";
function typeWriter() {
if (i < txt.length) {
document.getElementById("designation").innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, 100);
}
}
typeWriter();
});
$(document).ready(function() {
var selectedClass = "";
$(".fil-cat").click(function(){
$('.fil-cat.active').removeClass('active');
$(this).addClass('active');
selectedClass = $(this).attr("data-rel");
$("#workproject").fadeTo(100, 0.1);
$("#workproject .tile").not("."+selectedClass).fadeOut().removeClass('scale-anm');
setTimeout(function() {
$("."+selectedClass).fadeIn().addClass('scale-anm');
$("#workproject").fadeTo(300, 1);
}, 300);
});
});
$(document).ready(function() {
var delay = 500;
$(".progress-bar").each(function(i){
$(this).delay( delay ).animate( { width: $(this).attr('aria-valuenow') + '%' }, delay );
});
});
function openModal(tag, count, description, link){
$(".modal .modal-heading").html($("#"+tag+"_heading").text());
$(".modal .modal-tagline").html($("#"+tag+"_tagline").text());
$(".carousel-inner").append('<div class="carousel-item active"><img src="img/'+tag+'/1.png" alt="" class="w-100 border"></div>');
for(i=2; i<=count; i++){
$(".carousel-inner").append('<div class="carousel-item"><img src="img/'+tag+'/'+i+'.png" alt="" class="w-100 border"></div>');
}
$(".modal .modal-description").html(description);
if(link == null){
$(".modal .modal-link").hide();
}
else{
$(".modal .modal-link").attr('href', link);
}
if(count === 1) {
$(".carousel-control-prev").hide();
$(".carousel-control-next").hide();
}
$("#workModal").modal({
backdrop: 'static',
keyboard: false
});
}
function closeModal(){
$(".carousel-inner").empty();
$(".modal .modal-link").show();
$(".carousel-control-prev").show();
$(".carousel-control-next").show();
$("#workModal").modal('hide');
}
function animateBars(item) {
item.classList.toggle("change");
}
window.onscroll = function() {
scrollIndicator();
};
function scrollIndicator() {
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.getElementById("scrollIndicatorBar").style.width = scrolled + "%";
}