diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2016-08-21 19:10:56 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2016-08-21 19:10:56 +0200 |
| commit | d23f26c2496bc1b0002ae6ba687bc065c270e1df (patch) | |
| tree | 64a46da45dd98f39d7e265dc07cb655abce2092e /themes/flog/layouts | |
| parent | d8bfa86934facf14226add1cc89224ce14e9a337 (diff) | |
| download | pragblog-d23f26c2496bc1b0002ae6ba687bc065c270e1df.tar.gz pragblog-d23f26c2496bc1b0002ae6ba687bc065c270e1df.zip | |
integrate smoothstate.js
Diffstat (limited to 'themes/flog/layouts')
| -rw-r--r-- | themes/flog/layouts/partials/footer.html | 12 | ||||
| -rw-r--r-- | themes/flog/layouts/partials/header.html | 33 | ||||
| -rw-r--r-- | themes/flog/layouts/partials/listing.html | 4 |
3 files changed, 29 insertions, 20 deletions
diff --git a/themes/flog/layouts/partials/footer.html b/themes/flog/layouts/partials/footer.html index c3c6fca..c499460 100644 --- a/themes/flog/layouts/partials/footer.html +++ b/themes/flog/layouts/partials/footer.html @@ -1,17 +1,21 @@ - </div> <!-- .container --> + </div> <!-- .container --> + </div> <!-- #main --> <script type="text/javascript" src="/js/jquery-2.2.4.min.js"></script> <script type="text/javascript" src="/js/materialize-0.97.7.min.js"></script> - <script type="text/javascript" src="/js/masonry-4.1.min.js"></script> + <script type="text/javascript" src="/js/smoothstate-0.5.2.min.js"></script> <script type="text/javascript"> function parallax() { var yPos = -($(window).scrollTop() / $('body').data('speed')); var coords = '50% ' + yPos + 'px'; $('body').css({ backgroundPosition: coords }); }; + function ready() { + parallax(); + }; $(document).ready(function() { - new Masonry('.grid', { itemSelector: '.grid-item', percentPosition: true, columnWidth: '.grid-sizer' }); $(window).scroll(parallax); - parallax(); + $('#main').smoothState({ prefetch: true, onAfter: ready }); + ready(); }); </script> </body> diff --git a/themes/flog/layouts/partials/header.html b/themes/flog/layouts/partials/header.html index 03331a0..5b85cdb 100644 --- a/themes/flog/layouts/partials/header.html +++ b/themes/flog/layouts/partials/header.html @@ -10,19 +10,20 @@ <title>{{ .Title }}{{ if not .IsHome }} - {{ .Site.Title }}{{ end }}</title> </head> <body style="background: url(/background.jpg);" data-speed="5"> - <header> - <nav class="teal lighten-2"> - <div class="nav-wrapper"> - <a href="/" class="brand-logo center">{{ .Title }}</a> - <ul class="left"> - {{ $active_section := (or .Section (or (and (not .IsPage) (lower .Title)) "")) }} - {{ range $section, $p := .Site.Sections }} - <li{{ if eq $active_section $section }} class="active"{{ end }}> - <a href="/{{ $section }}/">{{ $section }}</a> - </li> - {{ end }} - <ul> - </div> - </nav> - </header> - <div class="container"> + <div id="main"> + <header> + <nav class="teal lighten-2"> + <div class="nav-wrapper"> + <a href="/" class="brand-logo center">{{ .Title }}</a> + <ul class="left"> + {{ $active_section := (or .Section (or (and (not .IsPage) (lower .Title)) "")) }} + {{ range $section, $p := .Site.Sections }} + <li{{ if eq $active_section $section }} class="active"{{ end }}> + <a href="/{{ $section }}/">{{ $section }}</a> + </li> + {{ end }} + <ul> + </div> + </nav> + </header> + <div class="container"> diff --git a/themes/flog/layouts/partials/listing.html b/themes/flog/layouts/partials/listing.html index bc97b30..4c42879 100644 --- a/themes/flog/layouts/partials/listing.html +++ b/themes/flog/layouts/partials/listing.html @@ -26,3 +26,7 @@ {{ end }} </div> </main> +<script type="text/javascript" src="/js/masonry-4.1.min.js"></script> +<script type="text/javascript"> + new Masonry('.grid', { itemSelector: '.grid-item', percentPosition: true, columnWidth: '.grid-sizer' }); +</script> |
