⚡ Initial commit
This commit is contained in:
7
js/bootstrap.min.js
vendored
Normal file
7
js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
38
js/click-scroll.js
Normal file
38
js/click-scroll.js
Normal file
@@ -0,0 +1,38 @@
|
||||
//jquery-click-scroll
|
||||
//by syamsul'isul' Arifin
|
||||
|
||||
var sectionArray = [1, 2, 3, 4, 5];
|
||||
|
||||
$.each(sectionArray, function (index, value) {
|
||||
$(document).scroll(function () {
|
||||
var offsetSection = $("#" + "section_" + value).offset().top - 90;
|
||||
var docScroll = $(document).scrollTop();
|
||||
var docScroll1 = docScroll + 1;
|
||||
|
||||
if (docScroll1 >= offsetSection) {
|
||||
$(".navbar-nav .nav-item .nav-link").removeClass("active");
|
||||
$(".navbar-nav .nav-item .nav-link:link").addClass("inactive");
|
||||
$(".navbar-nav .nav-item .nav-link").eq(index).addClass("active");
|
||||
$(".navbar-nav .nav-item .nav-link").eq(index).removeClass("inactive");
|
||||
}
|
||||
});
|
||||
|
||||
$(".click-scroll")
|
||||
.eq(index)
|
||||
.click(function (e) {
|
||||
var offsetClick = $("#" + "section_" + value).offset().top - 90;
|
||||
e.preventDefault();
|
||||
$("html, body").animate(
|
||||
{
|
||||
scrollTop: offsetClick,
|
||||
},
|
||||
300
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$(".navbar-nav .nav-item .nav-link:link").addClass("inactive");
|
||||
$(".navbar-nav .nav-item .nav-link").eq(0).addClass("active");
|
||||
$(".navbar-nav .nav-item .nav-link:link").eq(0).removeClass("inactive");
|
||||
});
|
||||
31
js/custom.js
Normal file
31
js/custom.js
Normal file
@@ -0,0 +1,31 @@
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
// PRE LOADER
|
||||
$(window).load(function () {
|
||||
$(".preloader").fadeOut(1000); // set duration in brackets
|
||||
});
|
||||
|
||||
// CUSTOM LINK
|
||||
$(".custom-link").click(function () {
|
||||
var el = $(this).attr("href");
|
||||
var elWrapped = $(el);
|
||||
var header_height = $(".navbar").height() + 10;
|
||||
|
||||
scrollToDiv(elWrapped, header_height);
|
||||
return false;
|
||||
|
||||
function scrollToDiv(element, navheight) {
|
||||
var offset = element.offset();
|
||||
var offsetTop = offset.top;
|
||||
var totalScroll = offsetTop - navheight;
|
||||
|
||||
$("body,html").animate(
|
||||
{
|
||||
scrollTop: totalScroll,
|
||||
},
|
||||
300
|
||||
);
|
||||
}
|
||||
});
|
||||
})(window.jQuery);
|
||||
4
js/jquery.magnific-popup.min.js
vendored
Normal file
4
js/jquery.magnific-popup.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
js/jquery.min.js
vendored
Normal file
4
js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
236
js/jquery.sticky.js
Normal file
236
js/jquery.sticky.js
Normal file
@@ -0,0 +1,236 @@
|
||||
// Sticky Plugin v1.0.3 for jQuery
|
||||
// =============
|
||||
// Author: Anthony Garand
|
||||
// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
|
||||
// Improvements by Leonardo C. Daronco (daronco)
|
||||
// Created: 02/14/2011
|
||||
// Date: 07/20/2015
|
||||
// Website: http://stickyjs.com/
|
||||
// Description: Makes an element on the page stick on the screen as you scroll
|
||||
// It will only set the 'top' and 'position' of your element, you
|
||||
// might need to adjust the width in some cases.
|
||||
|
||||
(function ($) {
|
||||
var slice = Array.prototype.slice; // save ref to original slice()
|
||||
var splice = Array.prototype.splice; // save ref to original slice()
|
||||
|
||||
var defaults = {
|
||||
topSpacing: 0,
|
||||
bottomSpacing: 0,
|
||||
className: "is-sticky",
|
||||
wrapperClassName: "sticky-wrapper",
|
||||
center: false,
|
||||
getWidthFrom: "",
|
||||
widthFromWrapper: true, // works only when .getWidthFrom is empty
|
||||
responsiveWidth: false,
|
||||
},
|
||||
$window = $(window),
|
||||
$document = $(document),
|
||||
sticked = [],
|
||||
windowHeight = $window.height(),
|
||||
scroller = function () {
|
||||
var scrollTop = $window.scrollTop(),
|
||||
documentHeight = $document.height(),
|
||||
dwh = documentHeight - windowHeight,
|
||||
extra = scrollTop > dwh ? dwh - scrollTop : 0;
|
||||
|
||||
for (var i = 0; i < sticked.length; i++) {
|
||||
var s = sticked[i],
|
||||
elementTop = s.stickyWrapper.offset().top,
|
||||
etse = elementTop - s.topSpacing - extra;
|
||||
|
||||
//update height in case of dynamic content
|
||||
s.stickyWrapper.css("height", s.stickyElement.outerHeight());
|
||||
|
||||
if (scrollTop <= etse) {
|
||||
if (s.currentTop !== null) {
|
||||
s.stickyElement.css({
|
||||
width: "",
|
||||
position: "",
|
||||
top: "",
|
||||
});
|
||||
s.stickyElement.parent().removeClass(s.className);
|
||||
s.stickyElement.trigger("sticky-end", [s]);
|
||||
s.currentTop = null;
|
||||
}
|
||||
} else {
|
||||
var newTop =
|
||||
documentHeight -
|
||||
s.stickyElement.outerHeight() -
|
||||
s.topSpacing -
|
||||
s.bottomSpacing -
|
||||
scrollTop -
|
||||
extra;
|
||||
if (newTop < 0) {
|
||||
newTop = newTop + s.topSpacing;
|
||||
} else {
|
||||
newTop = s.topSpacing;
|
||||
}
|
||||
if (s.currentTop != newTop) {
|
||||
var newWidth;
|
||||
if (s.getWidthFrom) {
|
||||
newWidth = $(s.getWidthFrom).width() || null;
|
||||
} else if (s.widthFromWrapper) {
|
||||
newWidth = s.stickyWrapper.width();
|
||||
}
|
||||
if (newWidth == null) {
|
||||
newWidth = s.stickyElement.width();
|
||||
}
|
||||
s.stickyElement
|
||||
.css("width", newWidth)
|
||||
.css("position", "fixed")
|
||||
.css("top", newTop);
|
||||
|
||||
s.stickyElement.parent().addClass(s.className);
|
||||
|
||||
if (s.currentTop === null) {
|
||||
s.stickyElement.trigger("sticky-start", [s]);
|
||||
} else {
|
||||
// sticky is started but it have to be repositioned
|
||||
s.stickyElement.trigger("sticky-update", [s]);
|
||||
}
|
||||
|
||||
if (
|
||||
(s.currentTop === s.topSpacing && s.currentTop > newTop) ||
|
||||
(s.currentTop === null && newTop < s.topSpacing)
|
||||
) {
|
||||
// just reached bottom || just started to stick but bottom is already reached
|
||||
s.stickyElement.trigger("sticky-bottom-reached", [s]);
|
||||
} else if (
|
||||
s.currentTop !== null &&
|
||||
newTop === s.topSpacing &&
|
||||
s.currentTop < newTop
|
||||
) {
|
||||
// sticky is started && sticked at topSpacing && overflowing from top just finished
|
||||
s.stickyElement.trigger("sticky-bottom-unreached", [s]);
|
||||
}
|
||||
|
||||
s.currentTop = newTop;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
resizer = function () {
|
||||
windowHeight = $window.height();
|
||||
|
||||
for (var i = 0; i < sticked.length; i++) {
|
||||
var s = sticked[i];
|
||||
var newWidth = null;
|
||||
if (s.getWidthFrom) {
|
||||
if (s.responsiveWidth === true) {
|
||||
newWidth = $(s.getWidthFrom).width();
|
||||
}
|
||||
} else if (s.widthFromWrapper) {
|
||||
newWidth = s.stickyWrapper.width();
|
||||
}
|
||||
if (newWidth != null) {
|
||||
s.stickyElement.css("width", newWidth);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods = {
|
||||
init: function (options) {
|
||||
var o = $.extend({}, defaults, options);
|
||||
return this.each(function () {
|
||||
var stickyElement = $(this);
|
||||
|
||||
var stickyId = stickyElement.attr("id");
|
||||
var stickyHeight = stickyElement.outerHeight();
|
||||
var wrapperId = stickyId
|
||||
? stickyId + "-" + defaults.wrapperClassName
|
||||
: defaults.wrapperClassName;
|
||||
var wrapper = $("<div></div>")
|
||||
.attr("id", wrapperId)
|
||||
.addClass(o.wrapperClassName);
|
||||
|
||||
stickyElement.wrapAll(wrapper);
|
||||
|
||||
var stickyWrapper = stickyElement.parent();
|
||||
|
||||
if (o.center) {
|
||||
stickyWrapper.css({
|
||||
width: stickyElement.outerWidth(),
|
||||
marginLeft: "auto",
|
||||
marginRight: "auto",
|
||||
});
|
||||
}
|
||||
|
||||
if (stickyElement.css("float") == "right") {
|
||||
stickyElement
|
||||
.css({ float: "none" })
|
||||
.parent()
|
||||
.css({ float: "right" });
|
||||
}
|
||||
|
||||
stickyWrapper.css("height", stickyHeight);
|
||||
|
||||
o.stickyElement = stickyElement;
|
||||
o.stickyWrapper = stickyWrapper;
|
||||
o.currentTop = null;
|
||||
|
||||
sticked.push(o);
|
||||
});
|
||||
},
|
||||
update: scroller,
|
||||
unstick: function (options) {
|
||||
return this.each(function () {
|
||||
var that = this;
|
||||
var unstickyElement = $(that);
|
||||
|
||||
var removeIdx = -1;
|
||||
var i = sticked.length;
|
||||
while (i-- > 0) {
|
||||
if (sticked[i].stickyElement.get(0) === that) {
|
||||
splice.call(sticked, i, 1);
|
||||
removeIdx = i;
|
||||
}
|
||||
}
|
||||
if (removeIdx != -1) {
|
||||
unstickyElement.unwrap();
|
||||
unstickyElement.css({
|
||||
width: "",
|
||||
position: "",
|
||||
top: "",
|
||||
float: "",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
// should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("scroll", scroller, false);
|
||||
window.addEventListener("resize", resizer, false);
|
||||
} else if (window.attachEvent) {
|
||||
window.attachEvent("onscroll", scroller);
|
||||
window.attachEvent("onresize", resizer);
|
||||
}
|
||||
|
||||
$.fn.sticky = function (method) {
|
||||
if (methods[method]) {
|
||||
return methods[method].apply(this, slice.call(arguments, 1));
|
||||
} else if (typeof method === "object" || !method) {
|
||||
return methods.init.apply(this, arguments);
|
||||
} else {
|
||||
$.error("Method " + method + " does not exist on jQuery.sticky");
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.unstick = function (method) {
|
||||
if (methods[method]) {
|
||||
return methods[method].apply(this, slice.call(arguments, 1));
|
||||
} else if (typeof method === "object" || !method) {
|
||||
return methods.unstick.apply(this, arguments);
|
||||
} else {
|
||||
$.error("Method " + method + " does not exist on jQuery.sticky");
|
||||
}
|
||||
};
|
||||
$(function () {
|
||||
setTimeout(scroller, 0);
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
$(document).ready(function () {
|
||||
$(".navbar").sticky({ topSpacing: 0 });
|
||||
});
|
||||
33
js/magnific-popup-options.js
Normal file
33
js/magnific-popup-options.js
Normal file
@@ -0,0 +1,33 @@
|
||||
$(document).ready(function () {
|
||||
// MagnificPopup
|
||||
var magnifyPopup = function () {
|
||||
$(".popup-image").magnificPopup({
|
||||
type: "image",
|
||||
removalDelay: 300,
|
||||
mainClass: "mfp-with-zoom",
|
||||
gallery: {
|
||||
enabled: true,
|
||||
},
|
||||
zoom: {
|
||||
enabled: true, // By default it's false, so don't forget to enable it
|
||||
|
||||
duration: 300, // duration of the effect, in milliseconds
|
||||
easing: "ease-in-out", // CSS transition easing function
|
||||
|
||||
// The "opener" function should return the element from which popup will be zoomed in
|
||||
// and to which popup will be scaled down
|
||||
// By default it looks for an image tag:
|
||||
opener: function (openerElement) {
|
||||
// openerElement is the element on which popup was initialized, in this case its <a> tag
|
||||
// you don't need to add "opener" option if this code matches your needs, it's default one.
|
||||
return openerElement.is("img")
|
||||
? openerElement
|
||||
: openerElement.find("img");
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// Call the functions
|
||||
magnifyPopup();
|
||||
});
|
||||
Reference in New Issue
Block a user