Optimizes assets
This commit is contained in:

committed by
Samuel FORESTIER

parent
13d3b4c6d7
commit
92330272ae
2
404.html
2
404.html
@ -4,7 +4,7 @@ title: 404 — Not Found
|
||||
permalink: /404.html
|
||||
---
|
||||
|
||||
<img id="image_404" class="fadeIn" src="" alt="404 - This page does not exist">
|
||||
<img id="image_404" src="" alt="404 - This page does not exist">
|
||||
|
||||
<script>
|
||||
document.getElementById('image_404').src = "/img/404_" + (Math.floor(Math.random() * 6) + 1) + ".jpg";
|
||||
|
@ -7,9 +7,7 @@ layout: default
|
||||
<span id="postDate">Samuel Forestier — {{ page.date | date: "%e %B %Y" }}</span>
|
||||
|
||||
<div class="post-content">
|
||||
|
||||
{{ content }}
|
||||
|
||||
</div>
|
||||
|
||||
{% if site.comments and page.comments != false and jekyll.environment == 'production' %}
|
||||
|
@ -207,7 +207,8 @@ span.dates {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.post-content, .post-gallery, .post-video {
|
||||
#disqus_thread, .post-content, .post-gallery, .post-video {
|
||||
max-width: 100%;
|
||||
display: block;
|
||||
margin: 40px auto 40px auto;
|
||||
}
|
||||
@ -242,18 +243,11 @@ span.dates {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
#disqus_thread {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
#image_404 {
|
||||
max-width: 100%;
|
||||
margin: 20px auto 20px auto;
|
||||
transition: .3s ease-in-out;
|
||||
-webkit-transition: .3s ease-in-out;
|
||||
}
|
||||
|
||||
.fadeIn {
|
||||
visibility: visible;
|
||||
animation: fade-in 1s ease;
|
||||
-webkit-backface-visibility: hidden;
|
||||
@ -262,7 +256,7 @@ span.dates {
|
||||
-ms-animation: fade-in ease-in-out 1s both;
|
||||
-o-animation: fade-in ease-in-out 1s both;
|
||||
}
|
||||
@-webkit-keyframes fade-in{
|
||||
@-webkit-keyframes fade-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
@ -370,7 +364,6 @@ img.emoji {
|
||||
height: 80px;
|
||||
}
|
||||
}
|
||||
.cd-auto-hide-header .logo,
|
||||
.cd-auto-hide-header .nav-trigger {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
@ -379,12 +372,6 @@ img.emoji {
|
||||
-ms-transform: translateY(-50%);
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
.cd-auto-hide-header .logo {
|
||||
left: 5%;
|
||||
}
|
||||
.cd-auto-hide-header .logo a, .cd-auto-hide-header .logo img {
|
||||
display: block;
|
||||
}
|
||||
.cd-auto-hide-header .nav-trigger {
|
||||
padding: 0 1em;
|
||||
font-size: 1.2rem;
|
||||
|
BIN
css/styles.min.css
(Stored with Git LFS)
vendored
BIN
css/styles.min.css
(Stored with Git LFS)
vendored
Binary file not shown.
@ -240,7 +240,8 @@ html * {
|
||||
top: 6px;
|
||||
}
|
||||
.cd-date::before {
|
||||
content: none;
|
||||
/* Just hide the calendar icon on large screens */
|
||||
display: none;
|
||||
}
|
||||
.cd-timeline-block:nth-child(even) .cd-timeline-content {
|
||||
float: right;
|
||||
|
BIN
css/timeline.min.css
(Stored with Git LFS)
vendored
BIN
css/timeline.min.css
(Stored with Git LFS)
vendored
Binary file not shown.
109
js/main.js
109
js/main.js
@ -1,90 +1,93 @@
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
var mainHeader = $('.cd-auto-hide-header'),
|
||||
secondaryNavigation = $('.cd-secondary-nav'),
|
||||
//this applies only if secondary nav is below intro section
|
||||
// This applies only if secondary nav is below intro section
|
||||
belowNavHeroContent = $('.sub-nav-hero'),
|
||||
headerHeight = mainHeader.height();
|
||||
|
||||
//set scrolling variables
|
||||
// Set scrolling variables
|
||||
var scrolling = false,
|
||||
previousTop = 0,
|
||||
currentTop = 0,
|
||||
scrollDelta = 10,
|
||||
scrollOffset = 150;
|
||||
currentTop = 0;
|
||||
|
||||
const SCROLLDELTA = 10, SCROLLOFFSET = 150;
|
||||
|
||||
mainHeader.on('click', '.nav-trigger', function(event){
|
||||
// open primary navigation on mobile
|
||||
mainHeader.on('click', '.nav-trigger', function(event) {
|
||||
// Open primary navigation on mobile
|
||||
event.preventDefault();
|
||||
mainHeader.toggleClass('nav-open');
|
||||
});
|
||||
|
||||
$(window).on('scroll', function(){
|
||||
if( !scrolling ) {
|
||||
$(window).on('scroll', function() {
|
||||
if(!scrolling) {
|
||||
scrolling = true;
|
||||
(!window.requestAnimationFrame)
|
||||
!window.requestAnimationFrame
|
||||
? setTimeout(autoHideHeader, 250)
|
||||
: requestAnimationFrame(autoHideHeader);
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('resize', function(){
|
||||
$(window).on('resize', function() {
|
||||
headerHeight = mainHeader.height();
|
||||
});
|
||||
|
||||
function autoHideHeader() {
|
||||
var currentTop = $(window).scrollTop();
|
||||
|
||||
( belowNavHeroContent.length > 0 )
|
||||
? checkStickyNavigation(currentTop) // secondary navigation below intro
|
||||
(belowNavHeroContent.length > 0)
|
||||
? checkStickyNavigation(currentTop) // Secondary navigation below intro
|
||||
: checkSimpleNavigation(currentTop);
|
||||
|
||||
previousTop = currentTop;
|
||||
scrolling = false;
|
||||
previousTop = currentTop;
|
||||
}
|
||||
|
||||
function checkSimpleNavigation(currentTop) {
|
||||
//there's no secondary nav or secondary nav is below primary nav
|
||||
if (previousTop - currentTop > scrollDelta) {
|
||||
//if scrolling up...
|
||||
mainHeader.removeClass('is-hidden');
|
||||
} else if( currentTop - previousTop > scrollDelta && currentTop > scrollOffset) {
|
||||
//if scrolling down...
|
||||
mainHeader.addClass('is-hidden');
|
||||
}
|
||||
// There's no secondary nav OR secondary nav is below primary nav
|
||||
if(previousTop - currentTop > SCROLLDELTA) {
|
||||
// If scrolling up...
|
||||
mainHeader.removeClass('is-hidden');
|
||||
}
|
||||
else if(currentTop - previousTop > SCROLLDELTA && currentTop > SCROLLOFFSET) {
|
||||
// If scrolling down...
|
||||
mainHeader.addClass('is-hidden');
|
||||
}
|
||||
}
|
||||
|
||||
function checkStickyNavigation(currentTop) {
|
||||
//secondary nav below intro section - sticky secondary nav
|
||||
// Secondary nav below intro section - sticky secondary nav
|
||||
var secondaryNavOffsetTop = belowNavHeroContent.offset().top - secondaryNavigation.height() - mainHeader.height();
|
||||
|
||||
if (previousTop >= currentTop ) {
|
||||
//if scrolling up...
|
||||
if( currentTop < secondaryNavOffsetTop ) {
|
||||
//secondary nav is not fixed
|
||||
mainHeader.removeClass('is-hidden');
|
||||
secondaryNavigation.removeClass('fixed slide-up');
|
||||
belowNavHeroContent.removeClass('secondary-nav-fixed');
|
||||
} else if( previousTop - currentTop > scrollDelta ) {
|
||||
//secondary nav is fixed
|
||||
mainHeader.removeClass('is-hidden');
|
||||
secondaryNavigation.removeClass('slide-up').addClass('fixed');
|
||||
belowNavHeroContent.addClass('secondary-nav-fixed');
|
||||
}
|
||||
|
||||
} else {
|
||||
//if scrolling down...
|
||||
if( currentTop > secondaryNavOffsetTop + scrollOffset ) {
|
||||
//hide primary nav
|
||||
mainHeader.addClass('is-hidden');
|
||||
secondaryNavigation.addClass('fixed slide-up');
|
||||
belowNavHeroContent.addClass('secondary-nav-fixed');
|
||||
} else if( currentTop > secondaryNavOffsetTop ) {
|
||||
//once the secondary nav is fixed, do not hide primary nav if you haven't scrolled more than scrollOffset
|
||||
mainHeader.removeClass('is-hidden');
|
||||
secondaryNavigation.addClass('fixed').removeClass('slide-up');
|
||||
belowNavHeroContent.addClass('secondary-nav-fixed');
|
||||
}
|
||||
|
||||
}
|
||||
if(previousTop >= currentTop) {
|
||||
// If scrolling up...
|
||||
if(currentTop < secondaryNavOffsetTop) {
|
||||
// Secondary nav is not fixed
|
||||
mainHeader.removeClass('is-hidden');
|
||||
secondaryNavigation.removeClass('fixed slide-up');
|
||||
belowNavHeroContent.removeClass('secondary-nav-fixed');
|
||||
}
|
||||
else if(previousTop - currentTop > SCROLLDELTA) {
|
||||
// Secondary nav is fixed
|
||||
mainHeader.removeClass('is-hidden');
|
||||
secondaryNavigation.removeClass('slide-up').addClass('fixed');
|
||||
belowNavHeroContent.addClass('secondary-nav-fixed');
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If scrolling down...
|
||||
if(currentTop > secondaryNavOffsetTop + SCROLLOFFSET) {
|
||||
// Hide primary nav
|
||||
mainHeader.addClass('is-hidden');
|
||||
secondaryNavigation.addClass('fixed slide-up');
|
||||
belowNavHeroContent.addClass('secondary-nav-fixed');
|
||||
}
|
||||
else if(currentTop > secondaryNavOffsetTop) {
|
||||
// Once the secondary nav is fixed, do not hide primary nav if you haven't scrolled more than SCROLLOFFSET
|
||||
mainHeader.removeClass('is-hidden');
|
||||
secondaryNavigation.addClass('fixed').removeClass('slide-up');
|
||||
belowNavHeroContent.addClass('secondary-nav-fixed');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
BIN
js/main.min.js
(Stored with Git LFS)
vendored
BIN
js/main.min.js
(Stored with Git LFS)
vendored
Binary file not shown.
@ -1,26 +1,31 @@
|
||||
jQuery(document).ready(function($){
|
||||
var timelineBlocks = $('.cd-timeline-block'),
|
||||
offset = 0.8;
|
||||
|
||||
//hide timeline blocks which are outside the viewport
|
||||
hideBlocks(timelineBlocks, offset);
|
||||
jQuery(document).ready(function($) {
|
||||
var timelineBlocks = $('.cd-timeline-block');
|
||||
const OFFSET = 0.8;
|
||||
|
||||
//on scolling, show/animate timeline blocks when enter the viewport
|
||||
$(window).on('scroll', function(){
|
||||
(!window.requestAnimationFrame)
|
||||
? setTimeout(function(){ showBlocks(timelineBlocks, offset); }, 100)
|
||||
: window.requestAnimationFrame(function(){ showBlocks(timelineBlocks, offset); });
|
||||
// Hide timeline blocks which are outside the viewport
|
||||
hideBlocks(timelineBlocks, OFFSET);
|
||||
|
||||
// On scolling, show & animate timeline blocks when enter the viewport
|
||||
$(window).on('scroll', function() {
|
||||
!window.requestAnimationFrame
|
||||
? setTimeout(function() {
|
||||
showBlocks(timelineBlocks, OFFSET);
|
||||
}, 100)
|
||||
: window.requestAnimationFrame(function() {
|
||||
showBlocks(timelineBlocks, OFFSET);
|
||||
});
|
||||
});
|
||||
|
||||
function hideBlocks(blocks, offset) {
|
||||
blocks.each(function(){
|
||||
( $(this).offset().top > $(window).scrollTop()+$(window).height()*offset ) && $(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden');
|
||||
blocks.each(function() {
|
||||
($(this).offset().top > $(window).scrollTop() + $(window).height() * offset) && $(this).find('.cd-timeline-img, .cd-timeline-content').addClass('is-hidden');
|
||||
});
|
||||
}
|
||||
|
||||
function showBlocks(blocks, offset) {
|
||||
blocks.each(function(){
|
||||
( $(this).offset().top <= $(window).scrollTop()+$(window).height()*offset && $(this).find('.cd-timeline-img').hasClass('is-hidden') ) && $(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');
|
||||
blocks.each(function() {
|
||||
($(this).offset().top <= $(window).scrollTop() + $(window).height() * offset && $(this).find('.cd-timeline-img').hasClass('is-hidden')) && $(this).find('.cd-timeline-img, .cd-timeline-content').removeClass('is-hidden').addClass('bounce-in');
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
BIN
js/timeline.min.js
(Stored with Git LFS)
vendored
BIN
js/timeline.min.js
(Stored with Git LFS)
vendored
Binary file not shown.
Reference in New Issue
Block a user