Forked from larsschenk/ baylys-kiteboarding-child
Last active
September 14, 2016 09:43
-
-
Save JanCK/00924fe1938cafa54408e82c95b0a9a4 to your computer and use it in GitHub Desktop.
Bayblys Childtheme for Kiteboarding.eu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Baylys Kiteboarding Child | |
Just a simple start for a WordPress child theme for keyboarding based on baylys. | |
This file should give the gist a meaningfull title, only ;-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Let the style.css empty by design and use this css instead. | |
This way we can work around the cache by increaging version numbers. | |
*/ | |
#footer { | |
background:#000045 !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "compass/css3/animation"; | |
@import "compass/css3"; | |
@import "partials/_fonts"; | |
/* Let the style.css empty by design and use this css instead. | |
This way we can work around the cache by increaging version numbers. | |
*/ | |
$bg: #000; | |
$light: #FFF; | |
$dark: #000; | |
$link: #99CCFF; | |
$hover: #2299AA; | |
*{ | |
box-sizing: border-box; | |
} | |
body { | |
background-color: $bg; | |
} | |
@include keyframes(fadeIn){ | |
0%{ | |
opacity: 0; | |
} | |
50%{ | |
opacity: 0; | |
} | |
100%{ | |
opacity: 1; | |
} | |
} | |
html{ | |
animation: fadeIn 0.6s ease-out; | |
} | |
#site-nav-container, | |
#main-wrap{ | |
background:$light; | |
padding-top: 40px; | |
padding-left: 40px; | |
border-bottom: none; | |
overflow-x: hidden; | |
overflow-y: auto; | |
#site-nav{ | |
padding: 40px; | |
} | |
} | |
#main-wrap{ | |
margin: auto; | |
padding-right: 40px; | |
margin-top: 100px; | |
min-height: 100vh; | |
box-shadow: 0 -200px 0 0 $light; | |
} | |
#site-nav-container{ | |
padding: 0; | |
position: fixed; | |
left: 0; | |
right: 0; | |
margin: auto; | |
width: 100%; | |
z-index: 10000; | |
top: 0; | |
transition: all 0.2s cubic-bezier(0.25,0.1,0.25,1); | |
&.nav-down { | |
opacity: 1; | |
pointer-events: normal; | |
} | |
&.nav-up { | |
opacity: 0; | |
top: -140px; | |
pointer-events: none; | |
} | |
} | |
/* /////////////////////////// HEADER /////////////////////////// */ | |
.header-image{ | |
height: auto !important; | |
width: 100% !important; | |
img{ | |
position: static !important; | |
} | |
} | |
#subtitle span{ | |
position: relative; | |
margin-left: 25px !important; | |
top: 5px !important; | |
font-size: 8pt !important; | |
font-style: italic; | |
white-space: nowrap; | |
} | |
#header{ | |
#mobile-menu-btn{ | |
margin-top: 0px !important; | |
margin-right: 0px !important; | |
width: 100px !important; | |
padding: 0; | |
top: 0; | |
right: 0; | |
height: 120px !important; | |
} | |
#nav-icon{ | |
width: 30px; | |
height: 30px; | |
position: absolute; | |
right: 20px; | |
margin: 15px; | |
margin-right: 0; | |
transform: rotate(0deg); | |
transition: .2s ease-in-out; | |
cursor: pointer; | |
span { | |
display: block; | |
position: absolute; | |
height: 2px; | |
width: 100%; | |
background: $dark; | |
opacity: 1; | |
left: 0; | |
transform: rotate(0deg); | |
transition: .4s ease-in-out; | |
} | |
span:nth-child(1) { | |
top: 0px; | |
} | |
span:nth-child(2), | |
span:nth-child(3) { | |
top: 10px; | |
} | |
span:nth-child(4) { | |
top: 20px; | |
} | |
&.open span:nth-child(1) { | |
top: 10px; | |
width: 0%; | |
left: 50%; | |
} | |
&.open span:nth-child(2) { | |
transform: rotate(45deg); | |
} | |
&.open span:nth-child(3) { | |
transform: rotate(-45deg); | |
} | |
&.open span:nth-child(4) { | |
top: 10px; | |
width: 0%; | |
left: 50%; | |
} | |
} | |
padding: 0; | |
margin-top: 0; | |
margin-bottom: 0; | |
#site-nav-container{ | |
overflow: hidden; | |
padding-top: 0; | |
margin-bottom: 1px; | |
border-top: 4px solid $dark; | |
border-bottom: 1px solid $dark; | |
// background:rgba($dark,0.5); | |
} | |
#site-title { | |
position: relative; | |
width: 25vw !important; | |
min-width: 250px; | |
max-width: 350px; | |
padding-top: 0; | |
padding-left: 0; | |
padding-right: 40px; | |
border-top: 4px solid $light; | |
& .logo img{ | |
position: relative; | |
left: 20px; | |
top: 10px; | |
padding-right: 10px !important; | |
padding: 0 !important; | |
margin: 0 !important; | |
width: 100% !important; | |
min-width: 100% !important; | |
} | |
} | |
} | |
#site-nav{ | |
margin: 0px !important; | |
margin-left: -40px !important; | |
margin-right: -40px !important; | |
padding: 0 !important; | |
li{ | |
background:$light !important; | |
transition: all 0.25s; | |
&:hover{ | |
box-shadow: inset 0 -4px 0 0 $dark; | |
} | |
position: relative; | |
margin: 0 !important; | |
padding:0 !important; | |
border-bottom: 1px solid $dark !important; | |
a{ | |
padding: 0; | |
margin: 0; | |
padding: 20px !important; | |
padding-bottom: 15px !important; | |
color: $dark !important; | |
background-color:transparent !important; | |
} | |
&:last-child{ | |
border-bottom: none !important; | |
} | |
&:first-child{ | |
border-top: 1px solid $dark !important; | |
} | |
a:hover{ | |
color: $hover !important; | |
cursor: pointer !important; | |
} | |
} | |
.current_page_item{ | |
background:$dark !important; | |
a, a:hover{ | |
color: $light !important; | |
} | |
} | |
} | |
.home{ | |
#site-nav li:first-child{ | |
background:$dark; | |
} | |
} | |
a:hover{ | |
color: $hover !important; | |
} | |
/* /////////////////////////// SIDEBAR /////////////////////////// */ | |
#site-nav li a{ | |
padding: 10px; | |
margin-top: 10px; | |
} | |
#site-nav li a:first-child{margin-top: 0;} | |
#sidebar{ | |
border-left: none; | |
padding-top: 40px; | |
margin-top: -40px; | |
height: auto; | |
} | |
/* /////////////////////////// LIST /////////////////////////// */ | |
#morelist li{ | |
background-image:none !important; | |
padding-left: 0px !important; | |
margin-left: 0; | |
line-height: 1.5em; | |
margin-bottom: 10px; | |
list-style-type: none; | |
} | |
#content .entry-content li{ | |
&:before{ | |
font-family: "kb-icon-font"; | |
content: "\f152"; | |
font-size: 0.6em; | |
padding-right: 5px; | |
margin-left: -15px; | |
vertical-align: top; | |
color: $dark; | |
} | |
list-style: none !important; | |
margin-left: 15px; | |
} | |
/* /////////////////////////// UI /////////////////////////// */ | |
.standard-btn.blue-btn.large-btn, | |
#content form:not(#searchform) .submit, | |
#content form:not(#searchform) input[type="submit"], | |
#content form:not(#searchform) button | |
{ | |
border: 4px solid $dark !important; | |
border-radius: 0; | |
background:transparent; | |
color: $dark; | |
margin-top: 40px !important; | |
&:hover{ | |
color: $light; | |
} | |
} | |
.standard-btn, | |
#content form:not(#searchform) .submit, | |
#content form:not(#searchform) input[type="submit"], | |
#content form:not(#searchform) button{ | |
padding: 5px !important; | |
padding-top: 7px !important; | |
padding-left: 10px !important; | |
padding-right: 10px !important; | |
&:hover{ | |
background:$dark !important; | |
* {color: $light !important;} | |
} | |
} | |
#content #searchform{ | |
input[type="text"]{ | |
line-height: 1em !important; | |
height: 50px !important; | |
line-height: 50px !important; | |
margin-bottom: 1em !important; | |
padding-bottom: 0em; | |
} | |
input[type="text"]:focus{ | |
margin-top: 10px !important; | |
} | |
#searchsubmit{ | |
border: none !important; | |
} | |
} | |
#content.nosidebar{ | |
margin-right: 0px !important; | |
} | |
#nav-below{padding-right: 0;} | |
/* /////////////////////////// CONTENT /////////////////////////// */ | |
#content { | |
.post{ | |
border-bottom: none; | |
border-top: 1px solid $dark !important; | |
padding: 0 !important; | |
padding-top: 30px !important; | |
padding-right: 0px; | |
padding-left: 0; | |
margin-top: 60px !important; | |
&:first-child{ | |
margin-top: 0px !important; | |
border-top: none !important; | |
} | |
} | |
&.nosidebar{ | |
box-sizing: border-box; | |
width: auto; | |
margin-right: 40px; | |
} | |
} | |
.praesent{ | |
margin-bottom: 60px !important; | |
min-width: 100%; | |
} | |
/* /////////////////////////// FOOTER /////////////////////////// */ | |
#footer { | |
background:$bg !important; | |
*{ | |
color: $light; | |
} | |
#site-info a.top{ | |
background-size: 34px 18px; | |
} | |
} | |
/* /////////////////////////// TYPE /////////////////////////// */ | |
body{ | |
span, p, li, h1, h2, h3, h4, h5, h6, a, #site-nav *, .entry-content *,.nav-previous, .nav-next{ | |
color: $dark; | |
font-family: georgia; | |
line-height: 1.5em; | |
} | |
.entry-title a { | |
color: $dark !important; | |
} | |
} | |
p,a,span,li{ | |
font-size:12pt !important; | |
line-height: 1; | |
} | |
#sidebar{ | |
p, li, span{ | |
a:hover{ | |
background:rgba($dark,0.05); | |
padding: 5px; | |
border-bottom: 4px solid $dark !important; | |
} | |
} | |
} | |
#main-wrap:before{ | |
pointer-events:none; | |
color: $light; | |
content: "\f154"; | |
text-align: center; | |
font-size: 30px; | |
position: fixed; | |
top: 10px; | |
font-family: "kb-icon-font"; | |
line-height: 30px; | |
width: 30px; | |
height: 30px; | |
background:$dark; | |
margin-left: -40px; | |
margin-right: 60px !important; | |
z-index: 100; | |
} | |
#site-nav *{ | |
color: $dark !important; | |
} | |
h1, h2, h3, h4, h5, h6 , .standard-btn, .standard-btn *, #site-nav a,.praesent strong, | |
#content form:not(#searchform) .submit, | |
#content form:not(#searchform) input[type="submit"], | |
#content form:not(#searchform) button{ | |
line-height: 1.25em; | |
margin: 0; | |
margin-bottom: 0.25em; | |
padding-bottom: 0px !important; | |
text-transform: uppercase !important; | |
} | |
.issue h1{ | |
font-size:12px !important; | |
max-width: 50%; | |
line-height: 2.5em !important; | |
} | |
h1, h1 *{ | |
font-family: "BrandonGrotesque-Light" !important; | |
font-size: 3em; | |
font-size: 6vmin !important; | |
} | |
h2,h3, h2 *, h3 * , .standard-btn, .standard-btn *, | |
#content form:not(#searchform) .submit, | |
#content form:not(#searchform) input[type="submit"], | |
#content form:not(#searchform) button{ | |
font-family: "BrandonGrotesque-Black" !important; | |
} | |
h4, h4 *,.nav-previous a, .nav-next a{ | |
font-family: "BrandonGrotesque-Medium" !important; | |
padding: 20px; | |
padding-bottom: 10px; | |
} | |
h5,h6, h5 *, h6, #site-nav *, .praesent strong, .entry-header h1{ | |
font-family: "BrandonGrotesque-Bold" !important; | |
} | |
#content{ | |
border-bottom: 4px solid $dark; | |
&, *{ | |
position: relative; | |
max-width: 100%; | |
} | |
h1,h2,h3,h4,h5,h6,button,input[type="submit"], a{ | |
max-width: 700px; | |
font-weight: normal !important; | |
} | |
.entry-header { | |
h1{ | |
text-align: left !important; | |
} | |
border-top: 4px solid $dark; | |
border-bottom: 1px solid $dark; | |
margin: 0; | |
padding-top: 15px; | |
margin-bottom: 3em !important; | |
margin-top: 2em !important; | |
text-align: left !important; | |
} | |
.entry-content div{ | |
img{ | |
margin-top: -10%; | |
} | |
a img{ | |
margin-top: 0; | |
} | |
padding-top: 40px; | |
h2, h3, h4, h5, h6{ | |
padding-bottom: 10px !important; | |
margin-bottom: 5px; | |
padding-top: 10px; | |
border-top: 4px solid $dark; | |
border-bottom: 1px solid $dark; | |
display: inline-block; | |
float:left; | |
margin-top: -35px; | |
padding-right: 10px; | |
margin-right: 20px; | |
padding-bottom: 0px; | |
width: 50%; | |
min-width: 200px; | |
} | |
div, p{ | |
&:first-child{ | |
margin-top: 40px; | |
} | |
padding-left: 20px; | |
} | |
li{ | |
line-height: 1.5em; | |
list-style-type: none; | |
margin-bottom: 10px; | |
} | |
} | |
} | |
small{ | |
color: rgba($dark, 0.5); | |
} | |
.entry-date{ | |
line-height: 0; | |
background:$dark; | |
color: $light !important; | |
padding: 5px; | |
margin-left: 40px; | |
float: left; | |
height: 20px; | |
font-size: 0.75em !important; | |
line-height: 10px; | |
position: absolute; | |
left: -40px; | |
top: -1px; | |
pointer-events: none; | |
} | |
.entry-header{ | |
margin-bottom: 1em; | |
} | |
.entry-title, | |
.entry-details{ | |
padding: 0 !important; | |
margin: 0 !important; | |
} | |
/* /////////////////////////// INPUT /////////////////////////// */ | |
form *{ | |
box-sizing: border-box; | |
} | |
input.field{ | |
padding: 0; | |
margin: 0; | |
height: 50px !important; | |
line-height: 50px !important; | |
border-right: none !important; | |
border-bottom: 1px solid $dark !important; | |
box-shadow: none !important; | |
} | |
#searchsubmit{ | |
background-size: 30% auto !important; | |
background-position: center center; | |
margin-top: 10px; | |
right: -20px !important; | |
} | |
#searchform, #searchform input[type="text"]{ | |
width: 100%; | |
max-width: 300px; | |
border:none; | |
margin-top: 10px; | |
} | |
#content textarea{ | |
background: repeating-linear-gradient( | |
0deg, | |
$light, | |
$light 40px, | |
rgba($dark, 0.2) 40px, | |
rgba($dark, 0.2) 41px | |
) !important; | |
} | |
.comment-form-comment{ | |
label{ | |
top: 0; | |
} | |
} | |
label{ | |
z-index:1; | |
} | |
#content form:not(#searchform) input[type="text"]{ | |
color: $light !important; | |
z-index: 0; | |
} | |
#content textarea, #content input[type="text"]{ | |
border-top: none !important; | |
border-left: none !important; | |
border-right: none !important; | |
box-shadow: none !important; | |
border-bottom: 1px solid $dark !important; | |
&:focus{ | |
transition: all 0.2s cubic-bezier(0.25,0.1,0.25,1); | |
background:$dark !important; | |
color: $light !important; | |
} | |
} | |
#content input[type="text"]{ | |
line-height: 2em; | |
height: 0; | |
background-color: transparent !important; | |
padding-bottom: 40px; | |
&:focus{ | |
margin-top: 40px !important; | |
transition: all 0.2s cubic-bezier(0.25,0.1,0.25,1); | |
height: 40px; | |
} | |
} | |
#content input[type="text"]:focus{ | |
line-height: 2em; | |
transition: all 0.2s cubic-bezier(0.25,0.1,0.25,1); | |
} | |
#content .submit, | |
#content input[type="submit"], | |
#content button{ | |
border-radius: 0 !important; | |
} | |
label{ | |
// background:$dark; | |
// color: $light | |
margin-top: 1em; | |
top: 30px; | |
} | |
/* /////////////////////////// MEDIA CONTETNT /////////////////////////// */ | |
.shadow{ | |
border-radius: 0; | |
border: 1px solid $dark; | |
box-shadow: 1px 1px $light, 4px 4px $dark !important; | |
} | |
#content{ | |
img{ | |
height: auto !important; | |
} | |
} | |
/* /////////////////////////// PRAESENT /////////////////////////// */ | |
.praesent{ | |
padding-top: 20px !important; | |
padding-left: 20px !important; | |
border: 4px solid $dark !important; | |
border-radius: 0 !important; | |
margin: 0; | |
margin-left: 0 !important; | |
margin-right: 10px; | |
position: relative; | |
img{ | |
position: absolute; | |
width: 95% !important; | |
height: auto !important; | |
bottom: -40px; | |
margin: auto !important; | |
left: 0 !important; | |
right: 0 !important; | |
} | |
} | |
/* /////////////////////////// COOKIE ALERT /////////////////////////// */ | |
.cc_banner-wrapper{ | |
.cc_message{ | |
color: $light; | |
} | |
.cc_btn.cc_btn_accept_all{ | |
background:$light; | |
border-radius: 0; | |
} | |
} | |
/* /////////////////////////// RESPONSIVE /////////////////////////// */ | |
@media screen and (min-width : 1180px) { | |
#site-nav{ | |
position: absolute; | |
bottom: 0; | |
right: 40px; | |
li{ | |
float: left; | |
border-bottom: none !important; | |
&:first-child{ | |
border-top: none !important; | |
} | |
} | |
} | |
#sidebar{ | |
border-left: 1px solid $dark; | |
padding-top: 40px; | |
margin-top: -40px; | |
} | |
#main-wrap{ | |
box-shadow: 0 -140px $light; | |
padding-right: 0px; | |
margin-bottom: 100px; | |
#content .post{ | |
padding-right: 40px; | |
} | |
#content.nosidebar{ | |
margin-right: 40px !important; | |
} | |
.entry-content{ | |
margin-right: 40px; | |
} | |
} | |
#site-nav-container, | |
#main-wrap, | |
footer{ | |
max-width: 1350px; | |
} | |
footer{ | |
position: fixed; | |
bottom: 0; | |
left: 0; | |
right: 0; | |
margin:auto; | |
z-index: -1; | |
box-shadow: 0 -100px 0 0 $bg; | |
} | |
} | |
@media screen and (min-width : 640px) { | |
.praesent{ | |
margin-bottom: 60px !important; | |
min-width: 0px; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net | |
*/ | |
(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k)); | |
if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("<div />"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q, | |
u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),e<F&&(m=!1,c=q,null==p&&("left"!==r&&"right"!==r||a.insertAfter(h), | |
h.detach()),b={position:"",width:"",top:""},a.css(b).removeClass(t).trigger("sticky_kit:unstick")),B&&(b=f.height(),u+q>b&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}), | |
a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize", | |
y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n<K;n++)d=this[n],J(b(d));return this}}).call(this); | |
/*----------------------------------------------------------------------------------- | |
Polyfill RequestAnimationFrame | |
-----------------------------------------------------------------------------------*/ | |
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller | |
// fixes from Paul Irish and Tino Zijdel | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { | |
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; | |
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] | |
|| window[vendors[x]+'CancelRequestAnimationFrame']; | |
} | |
if (!window.requestAnimationFrame) | |
window.requestAnimationFrame = function(callback, element) { | |
var currTime = new Date().getTime(); | |
var timeToCall = Math.max(0, 16 - (currTime - lastTime)); | |
var id = window.setTimeout(function() { callback(currTime + timeToCall); }, | |
timeToCall); | |
lastTime = currTime + timeToCall; | |
return id; | |
}; | |
if (!window.cancelAnimationFrame) | |
window.cancelAnimationFrame = function(id) { | |
clearTimeout(id); | |
}; | |
}()); | |
/*----------------------------------------------------------------------------------- | |
Smooth Scrolling | |
-----------------------------------------------------------------------------------*/ | |
/*! | |
* Smooth Scroll - v1.4.5 - 2012-07-21 | |
* | |
* Copyright (c) 2012 Karl Swedberg; Licensed MIT, GPL | |
* https://github.com/kswedberg/jquery-smooth-scroll | |
* | |
* | |
*/ | |
(function(a){function f(a){return a.replace(/(:|\.)/g,"\\$1")}var b="1.4.5",c={exclude:[],excludeWithin:[],offset:0,direction:"top",scrollElement:null,scrollTarget:null,beforeScroll:function(){},afterScroll:function(){},easing:"swing",speed:400,autoCoefficent:2},d=function(b){var c=[],d=!1,e=b.dir&&b.dir=="left"?"scrollLeft":"scrollTop";return this.each(function(){if(this==document||this==window)return;var b=a(this);b[e]()>0?c.push(this):(b[e](1),d=b[e]()>0,b[e](0),d&&c.push(this))}),b.el==="first"&&c.length&&(c=[c[0]]),c},e="ontouchend"in document;a.fn.extend({scrollable:function(a){var b=d.call(this,{dir:a});return this.pushStack(b)},firstScrollable:function(a){var b=d.call(this,{el:"first",dir:a});return this.pushStack(b)},smoothScroll:function(b){b=b||{};var c=a.extend({},a.fn.smoothScroll.defaults,b),d=a.smoothScroll.filterPath(location.pathname);return this.unbind("click.smoothscroll").bind("click.smoothscroll",function(b){var e=this,g=a(this),h=c.exclude,i=c.excludeWithin,j=0,k=0,l=!0,m={},n=location.hostname===e.hostname||!e.hostname,o=c.scrollTarget||(a.smoothScroll.filterPath(e.pathname)||d)===d,p=f(e.hash);if(!c.scrollTarget&&(!n||!o||!p))l=!1;else{while(l&&j<h.length)g.is(f(h[j++]))&&(l=!1);while(l&&k<i.length)g.closest(i[k++]).length&&(l=!1)}l&&(b.preventDefault(),a.extend(m,c,{scrollTarget:c.scrollTarget||p,link:e}),a.smoothScroll(m))}),this}}),a.smoothScroll=function(b,c){var d,f,g,h,i=0,j="offset",k="scrollTop",l={},m=!1,n=[];typeof b=="number"?(d=a.fn.smoothScroll.defaults,g=b):(d=a.extend({},a.fn.smoothScroll.defaults,b||{}),d.scrollElement&&(j="position",d.scrollElement.css("position")=="static"&&d.scrollElement.css("position","relative")),g=c||a(d.scrollTarget)[j]()&&a(d.scrollTarget)[j]()[d.direction]||0),d=a.extend({link:null},d),k=d.direction=="left"?"scrollLeft":k,d.scrollElement?(f=d.scrollElement,i=f[k]()):(f=a("html, body").firstScrollable(),m=e&&"scrollTo"in window),l[k]=g+i+d.offset,d.beforeScroll.call(f,d),m?(n=d.direction=="left"?[l[k],0]:[0,l[k]],window.scrollTo.apply(window,n),d.afterScroll.call(d.link,d)):(h=d.speed,h==="auto"&&(h=l[k]||f.scrollTop(),h=h/d.autoCoefficent),f.stop().animate(l,{duration:h,easing:d.easing,complete:function(){d.afterScroll.call(d.link,d)}}))},a.smoothScroll.version=b,a.smoothScroll.filterPath=function(a){return a.replace(/^\//,"").replace(/(index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},a.fn.smoothScroll.defaults=c})(jQuery); | |
jQuery(document).ready(function() { | |
jQuery('a.top').smoothScroll(); | |
jQuery('a.share-btn').click(function() { | |
jQuery.smoothScroll({ | |
scrollElement: jQuery('.share'), | |
scrollTarget: '#' | |
}); | |
return false; | |
}); | |
}); | |
if (document.documentElement.clientWidth > 1025) { | |
jQuery(document).ready(function() { | |
jQuery('a.site-nav-btn').smoothScroll(); | |
}); | |
} | |
/*--------------------------------------------------------------------------------------------- | |
Flexible width for embedded videos (see https://github.com/davatron5000/FitVids.js/) | |
----------------------------------------------------------------------------------------------*/ | |
jQuery(document).ready(function(){ | |
jQuery('#content').fitVids(); | |
jQuery('.widget').fitVids(); | |
}); | |
/*--------------------------------------------------------------------------------------------- | |
Support Placeholder input text in IE (see https://github.com/danielstocks/jQuery-Placeholder) | |
----------------------------------------------------------------------------------------------*/ | |
jQuery(document).ready(function(){ | |
jQuery('input[placeholder], textarea[placeholder]').placeholder(); | |
}); | |
/*-------------------------------------------------------------------------------------------- | |
Show/Hide effect site navigation and share-btn on mobile | |
----------------------------------------------------------------------------------------------*/ | |
jQuery(document).ready(function(){ | |
jQuery('#site-nav').hide(); | |
jQuery('a#mobile-menu-btn').click(function () { | |
jQuery( this ).find('#nav-icon').toggleClass('open');; | |
jQuery( this ).next('#site-nav').slideToggle('200'); | |
}); | |
}); | |
jQuery( document ).ready( | |
function() | |
{ | |
jQuery("#sidebar").stick_in_parent(); | |
// Hide Header on on scroll down | |
var didScroll; | |
var navOffset = 140; | |
var hoversNav = false; | |
var lastScrollTop = 0; | |
var delta = 5; | |
var navbarHeight = jQuery( '#site-nav-container' ).outerHeight(); | |
jQuery(document).scroll( | |
function( event ) | |
{ | |
didScroll = true; | |
} | |
); | |
jQuery(document).mousemove( | |
function( event ) | |
{ | |
if(event.pageY - window.scrollY <= navOffset && hoversNav == false){ | |
didScroll = true; | |
hoversNav = true; | |
jQuery( '#site-nav-container' ).removeClass( 'nav-up' ).addClass( 'nav-down' ); | |
} | |
} | |
); | |
jQuery( '#site-nav-container' ).mouseleave(function(event){ | |
if(window.scrollY > navOffset) | |
jQuery( this ).removeClass( 'nav-down' ).addClass( 'nav-up' ); | |
hoversNav = false; | |
}); | |
function step() | |
{ | |
if ( didScroll ) | |
{ | |
hasScrolled(); | |
didScroll = false; | |
} | |
window.requestAnimationFrame( step ); | |
} | |
window.requestAnimationFrame( step ); | |
function hasScrolled() | |
{ | |
var st = jQuery( this ).scrollTop(); | |
// Make sure they scroll more than delta | |
if( Math.abs( lastScrollTop - st ) <= delta ) | |
return; | |
// If they scrolled down and are past the navbar, add class .nav-up. | |
// This is necessary so you never see what is "behind" the navbar. | |
if ( st > lastScrollTop && st > navbarHeight ) | |
{ | |
// Scroll Down | |
if(window.scrollY > navOffset) | |
jQuery( '#site-nav-container' ).removeClass( 'nav-down' ).addClass( 'nav-up' ); | |
} | |
else | |
{ | |
// Scroll Up | |
if( st + jQuery( window ).height() < jQuery( document ).height() ) | |
{ | |
if(window.scrollY > navOffset) | |
jQuery( '#site-nav-container' ).removeClass( 'nav-up' ).addClass( 'nav-down' ); | |
} | |
} | |
lastScrollTop = st; | |
} | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// slow down heartbeat | |
add_filter('heartbeat_send', 'my_heartbeat_settings'); | |
function my_heartbeat_settings($response) | |
{ | |
if ($_POST['interval'] != 60) { | |
$response['heartbeat_interval'] = 60; | |
} | |
return $response; | |
} | |
// remove unwanted dashboard widgets for relevant users | |
function remove_dashboard_widgets() | |
{ | |
remove_meta_box('dashboard_primary', 'dashboard', 'normal'); // wp news | |
remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); | |
$user = wp_get_current_user(); | |
if (!$user->has_cap('manage_options')) { | |
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); | |
remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); | |
remove_meta_box('dashboard_secondary', 'dashboard', 'normal'); | |
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); | |
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); | |
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); | |
remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); | |
} | |
} | |
add_action('admin_init', 'remove_dashboard_widgets'); | |
// load style | |
add_action('wp_enqueue_scripts', 'my_theme_enqueue_styles'); | |
function my_theme_enqueue_styles() | |
{ | |
wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css', array(), '1.1.1'); | |
wp_enqueue_style('child-style', get_stylesheet_directory_uri().'/baylys-kiteboarding-child.css', array(), '0.0.3'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Theme Name: Baylys Kiteboarding Child | |
Theme URI: http://www.ocx.de/baylys-kiteboarding-child/ | |
Description: Baylys Leible Child Theme, https://gist.github.com/larsschenk/74d71094fe6c94c8fdfaccc5dff1b0bb | |
Author: Lars Schenk but mostly Jan K. ;-) | |
Author URI: https://ocx.de | |
Template: baylys | |
Version: 0.0.4 | |
Tags: light, responsive-layout | |
Text Domain: baylys-kiteboarding-child | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment