post header bg scroll if safari
This commit is contained in:
parent
90eb10ea7a
commit
25a2c2dfa2
|
@ -13,7 +13,7 @@
|
||||||
"@babel/preset-env": "^7.9.6"
|
"@babel/preset-env": "^7.9.6"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"build": "/usr/local/bin/hugo"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
|
// from swift theme: sandwich
|
||||||
|
// ******
|
||||||
function modifyClass(el, targetClass) {
|
function modifyClass(el, targetClass) {
|
||||||
if (isObj(el) && targetClass) {
|
if (isObj(el) && targetClass) {
|
||||||
const elClass = el.classList;
|
const elClass = el.classList;
|
||||||
|
@ -33,8 +35,7 @@
|
||||||
elClass.contains(targetClass) ? false : elClass.add(targetClass);
|
elClass.contains(targetClass) ? false : elClass.add(targetClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// from swift theme: sandwich
|
|
||||||
// ******
|
|
||||||
(function() {
|
(function() {
|
||||||
let bar = 'nav_bar-wrap';
|
let bar = 'nav_bar-wrap';
|
||||||
let navBar = elem(`.${bar}`);
|
let navBar = elem(`.${bar}`);
|
||||||
|
@ -71,7 +72,6 @@
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
(function postsPager(){
|
(function postsPager(){
|
||||||
const pager = elem('.pagination');
|
const pager = elem('.pagination');
|
||||||
if (pager) {
|
if (pager) {
|
||||||
|
@ -90,7 +90,9 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
// ******
|
||||||
|
|
||||||
|
(function() {
|
||||||
var fbposts = document.querySelector('#fbposts');
|
var fbposts = document.querySelector('#fbposts');
|
||||||
function whoops(error) {
|
function whoops(error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
@ -119,6 +121,18 @@
|
||||||
whoops(e);
|
whoops(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(fbposts && window.fbtoken) {
|
||||||
|
window.fbAsyncInit = getRedZuurdesemFacebookFeed;
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
|
||||||
|
function fromFixedToScrollForSafari() {
|
||||||
|
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
||||||
|
const header = document.querySelector('.post_header');
|
||||||
|
if(isSafari) {
|
||||||
|
header.style.backgroundAttachment = 'scroll';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function fbCommunityHeaderify() {
|
function fbCommunityHeaderify() {
|
||||||
var elem = document.querySelector('#fb-community-header');
|
var elem = document.querySelector('#fb-community-header');
|
||||||
|
@ -155,9 +169,7 @@
|
||||||
elem.innerHTML = '<div class="fb-page" data-width="' + vw + '" data-href="https://www.facebook.com/redzuurdesem" data-hide-cover="false" data-tabs="timeline,messages" data-show-facepile="false"></div>';
|
elem.innerHTML = '<div class="fb-page" data-width="' + vw + '" data-href="https://www.facebook.com/redzuurdesem" data-hide-cover="false" data-tabs="timeline,messages" data-show-facepile="false"></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fbposts && window.fbtoken) {
|
|
||||||
window.fbAsyncInit = getRedZuurdesemFacebookFeed;
|
|
||||||
}
|
|
||||||
fbCommunityHeaderify();
|
fbCommunityHeaderify();
|
||||||
fbCommunityContainer();
|
fbCommunityContainer();
|
||||||
|
fromFixedToScrollForSafari();
|
||||||
})()
|
})()
|
||||||
|
|
|
@ -65,8 +65,7 @@
|
||||||
background-size: cover
|
background-size: cover
|
||||||
background-repeat: no-repeat
|
background-repeat: no-repeat
|
||||||
background-position: center
|
background-position: center
|
||||||
|
background-attachment: fixed
|
||||||
background-attachment: fixed;
|
|
||||||
|
|
||||||
position: relative
|
position: relative
|
||||||
height: 48vh
|
height: 48vh
|
||||||
|
|
Loading…
Reference in New Issue