Initial commit; page is a clone of bonifacelabs.ca but with changed content (of course).
This commit is contained in:
101
themes/scroll/static/js/index.js
Normal file
101
themes/scroll/static/js/index.js
Normal file
@ -0,0 +1,101 @@
|
||||
/**
|
||||
* Main JS file for HugoScroll behaviours
|
||||
*/
|
||||
var $post = $('.post'),
|
||||
$first = $('.post.first'),
|
||||
$last = $('.post.last'),
|
||||
$fnav = $('.fixed-nav'),
|
||||
$postholder = $('.post-holder'),
|
||||
$postafter = $('.post-after'),
|
||||
$sitehead = $('#site-head');
|
||||
|
||||
/*globals jQuery, document */
|
||||
(function ($) {
|
||||
"use strict";
|
||||
function srcTo (e) {
|
||||
$('html, body').animate({
|
||||
scrollTop: e.offset().top
|
||||
}, 1000);
|
||||
}
|
||||
$(document).ready(function(){
|
||||
|
||||
$postholder.each(function (e) {
|
||||
if(e % 2 != 0)
|
||||
$(this).addClass("oneOff")
|
||||
})
|
||||
|
||||
$postafter.each(function (e) {
|
||||
var bg = $(this).parent().css('background-color')
|
||||
$(this).css('border-top-color', bg)
|
||||
|
||||
if(e % 2 == 0)
|
||||
$(this).css('left', '6%')
|
||||
|
||||
})
|
||||
|
||||
|
||||
$('.btn.first').click( function () {
|
||||
srcTo ($first)
|
||||
})
|
||||
$('.btn.last').click( function () {
|
||||
srcTo ($last)
|
||||
})
|
||||
$('#header-arrow').click(function () {
|
||||
srcTo ($first)
|
||||
})
|
||||
|
||||
$('.post-title').each(function () {
|
||||
var t = $(this).text(),
|
||||
index = $(this).parents('.post-holder').index();
|
||||
$fnav.append("<a class='fn-item' item_index='"+index+"'>"+t+"</a>")
|
||||
$(this).parents('article').attr('id',t.toLowerCase().split(' ').join('-'));
|
||||
$('.fn-item').click(function () {
|
||||
var i = $(this).attr('item_index'),
|
||||
s = $(".post[item_index='"+i+"']")
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: s.offset().top
|
||||
}, 400);
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
$('.post.last').next('.post-after').hide();
|
||||
if($sitehead.length) {
|
||||
$(window).scroll( function () {
|
||||
var w = $(window).scrollTop(),
|
||||
g = $sitehead.offset().top,
|
||||
h = $sitehead.offset().top + $(this).height()-100;
|
||||
|
||||
if(w >= g && w<=h) {
|
||||
$('.fixed-nav').fadeOut('fast')
|
||||
} else {
|
||||
if($(window).width()>500)
|
||||
$('.fixed-nav').fadeIn('fast')
|
||||
}
|
||||
|
||||
$post.each(function () {
|
||||
var f = $(this).offset().top,
|
||||
b = $(this).offset().top + $(this).height(),
|
||||
t = $(this).parent('.post-holder').index(),
|
||||
i = $(".fn-item[item_index='"+t+"']"),
|
||||
a = $(this).parent('.post-holder').prev('.post-holder').find('.post-after');
|
||||
|
||||
$(this).attr('item_index', t);
|
||||
|
||||
if(w >= f && w<=b) {
|
||||
|
||||
i.addClass('active');
|
||||
a.fadeOut('slow')
|
||||
} else {
|
||||
i.removeClass('active');
|
||||
a.fadeIn('slow')
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
$('ul li').before('<span class="bult fa fa-asterisk icon-asterisk"></span>')
|
||||
$('blockquote p').prepend('<span class="quo icon-quote-left"></span>')
|
||||
.append('<span class="quo icon-quote-right"></span>')
|
||||
});
|
||||
}(jQuery));
|
1
themes/scroll/static/js/index.min.js
vendored
Normal file
1
themes/scroll/static/js/index.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
var $post=$(".post"),$first=$(".post.first"),$last=$(".post.last"),$fnav=$(".fixed-nav"),$postholder=$(".post-holder"),$postafter=$(".post-after"),$sitehead=$("#site-head");(function(e){"use strict";function t(t){e("html, body").animate({scrollTop:t.offset().top},1e3)}e(document).ready(function(){$postholder.each(function(t){if(t%2!=0)e(this).addClass("oneOff")});$postafter.each(function(t){var n=e(this).parent().css("background-color");e(this).css("border-top-color",n);if(t%2==0)e(this).css("left","6%")});e(".btn.first").click(function(){t($first)});e(".btn.last").click(function(){t($last)});e("#header-arrow").click(function(){t($first)});e(".post-title").each(function(){var t=e(this).text(),n=e(this).parents(".post-holder").index();$fnav.append("<a class='fn-item' item_index='"+n+"'>"+t+"</a>");e(this).parents("article").attr("id",t.toLowerCase().split(" ").join("-"));e(".fn-item").click(function(){var t=e(this).attr("item_index"),n=e(".post[item_index='"+t+"']");e("html, body").animate({scrollTop:n.offset().top},400)})});e(".post.last").next(".post-after").hide();if($sitehead.length){e(window).scroll(function(){var t=e(window).scrollTop(),n=$sitehead.offset().top,r=$sitehead.offset().top+e(this).height()-100;if(t>=n&&t<=r){e(".fixed-nav").fadeOut("fast")}else{if(e(window).width()>500)e(".fixed-nav").fadeIn("fast")}$post.each(function(){var n=e(this).offset().top,r=e(this).offset().top+e(this).height(),i=e(this).parent(".post-holder").index(),s=e(".fn-item[item_index='"+i+"']"),o=e(this).parent(".post-holder").prev(".post-holder").find(".post-after");e(this).attr("item_index",i);if(t>=n&&t<=r){s.addClass("active");o.fadeOut("slow")}else{s.removeClass("active");o.fadeIn("slow")}})})}e("ul li").before('<span class="bult fa fa-asterisk icon-asterisk"></span>');e("blockquote p").prepend('<span class="quo icon-quote-left"></span>').append('<span class="quo icon-quote-right"></span>')})})(jQuery)
|
4
themes/scroll/static/js/jquery.min.js
vendored
Normal file
4
themes/scroll/static/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user