mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-22 09:56:51 +01:00
js
This commit is contained in:
parent
d1b5bb8828
commit
37726d9dcd
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
node_modules
|
||||
_site
|
||||
_src/_media/gen
|
15
Gruntfile.js
15
Gruntfile.js
@ -17,7 +17,7 @@ module.exports = function(grunt){
|
||||
grunt.log.writeln("");
|
||||
grunt.log.writeln(" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
grunt.log.writeln("");
|
||||
grunt.log.writeln(" | (o) | Just what do you think you're doing, Matthias? ");
|
||||
grunt.log.writeln(" (o) Just what do you think you're doing, Matthias? ");
|
||||
grunt.log.writeln("");
|
||||
grunt.log.writeln(" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
grunt.log.writeln("");
|
||||
@ -80,12 +80,16 @@ module.exports = function(grunt){
|
||||
uglify: {
|
||||
production: {
|
||||
options: {
|
||||
report: 'min',
|
||||
mangle: true
|
||||
report: 'min'
|
||||
},
|
||||
files: {
|
||||
'<%= config.site %>/<%= config.assets.js %>/lib/picturefill.min.js': [
|
||||
'<%= config.site %>/<%= config.assets.js %>/lib/picturefill.js'
|
||||
],
|
||||
'<%= config.site %>/<%= config.assets.js %>/kremalicious3.min.js': [
|
||||
'<%= config.src %>/<%= config.assets.js %>/picturefill.js',
|
||||
'<%= config.src %>/<%= config.assets.js %>/lib/infinitescroll/jquery.infinitescroll.js',
|
||||
'<%= config.src %>/<%= config.assets.js %>/lib/socialite/socialite.js',
|
||||
'<%= config.src %>/<%= config.assets.js %>/plugins.js',
|
||||
'<%= config.src %>/<%= config.assets.js %>/app.js'
|
||||
]
|
||||
}
|
||||
@ -165,7 +169,6 @@ module.exports = function(grunt){
|
||||
// rsync stuff around
|
||||
rsync: {
|
||||
options: {
|
||||
|
||||
recursive: true
|
||||
},
|
||||
// copy media folder
|
||||
@ -173,7 +176,7 @@ module.exports = function(grunt){
|
||||
options: {
|
||||
src: '<%= config.src %>/_media/',
|
||||
dest: '<%= config.site %>/media/',
|
||||
args: ["--exclude='gen'"],
|
||||
args: ["--exclude='gen'"]
|
||||
}
|
||||
},
|
||||
// deployment
|
||||
|
@ -14,7 +14,7 @@ pygments: true
|
||||
source: ./_src
|
||||
destination: ./_site
|
||||
exclude: ['design', 'node_modules', 'less']
|
||||
keep_files: ['media']
|
||||
keep_files: ['media', 'gen']
|
||||
|
||||
picture:
|
||||
source: "_media"
|
||||
|
@ -22,3 +22,8 @@
|
||||
<p class="license">Code snippets: <a rel="item-license" href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>. Goodies: <a rel="item-license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">CC BY NC SA</a>. Hosted by <a href="http://www.mediatemple.net#a_aid=4f37f8fe3e47e" title="Media Temple">(mt)</a></p>
|
||||
</section>
|
||||
</footer>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
|
||||
<script>window.jQuery || document.write('<script src="/assets/js/lib/jquery.min.js"><\/script>')</script>
|
||||
|
||||
<script src="/assets/js/kremalicious3.min.js"></script>
|
@ -1,3 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
___ ___
|
||||
/__/\ /__/|
|
||||
| |::\ | |:|
|
||||
| |:|:\ | |:|
|
||||
__|__|:|\:\ __| |:|
|
||||
/__/::::| \:\ /__/\_|:|____
|
||||
\ \:\~~\__\/ \ \:\/:::::/
|
||||
\ \:\ \ \::/~~~~
|
||||
\ \:\ \ \:\
|
||||
\ \:\ \ \:\
|
||||
\__\/ \__\/
|
||||
|
||||
YOU EARNED THE GEEK ACHIEVEMENT
|
||||
FOR LOOKING AT MY SOURCE
|
||||
|
||||
But because of all the minimizing and caching
|
||||
going on you better check out the code on
|
||||
github
|
||||
_____________________________________________
|
||||
|
||||
https://github.com/kremalicious/kremalicious3
|
||||
|
||||
_____________________________________________
|
||||
-->
|
||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
@ -30,10 +57,16 @@
|
||||
<link rel="stylesheet" href="/assets/css/{{ page.style }}">
|
||||
{% endif %}
|
||||
|
||||
<script src="/assets/js/lib/picturefill.min.js" async></script>
|
||||
|
||||
<script data-cfasync="false" src="//use.typekit.com/msu4qap.js"></script>
|
||||
<script data-cfasync="false">try{Typekit.load();}catch(e){}</script>
|
||||
|
||||
<script src="/assets/js/kremalicious3.min.js" defer async></script>
|
||||
{% if paginator %}
|
||||
<script>
|
||||
var total = {{ paginator.total_pages }};
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<!-- Twitter Cards -->
|
||||
<meta name="twitter:card" content="summary">
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
<header role="banner" class="banner container">
|
||||
<div class="row">
|
||||
<h1 class="banner-title">
|
||||
|
@ -1,30 +1,3 @@
|
||||
<!DOCTYPE html>
|
||||
<!--
|
||||
___ ___
|
||||
/__/\ /__/|
|
||||
| |::\ | |:|
|
||||
| |:|:\ | |:|
|
||||
__|__|:|\:\ __| |:|
|
||||
/__/::::| \:\ /__/\_|:|____
|
||||
\ \:\~~\__\/ \ \:\/:::::/
|
||||
\ \:\ \ \::/~~~~
|
||||
\ \:\ \ \:\
|
||||
\ \:\ \ \:\
|
||||
\__\/ \__\/
|
||||
|
||||
YOU EARNED THE GEEK ACHIEVEMENT
|
||||
FOR LOOKING AT MY SOURCE
|
||||
|
||||
But because of all the minimizing and caching
|
||||
going on you better check out the code on
|
||||
github
|
||||
_____________________________________________
|
||||
|
||||
https://github.com/kremalicious/kremalicious3
|
||||
|
||||
_____________________________________________
|
||||
-->
|
||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
|
||||
|
||||
{% include head.html %}
|
||||
|
||||
@ -33,14 +6,11 @@
|
||||
{% include header.html %}
|
||||
|
||||
<section role="document" class="container">
|
||||
<section role="main" id="main" class="row">
|
||||
|
||||
{{ content }}
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
{% include footer.html %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
{% include footer.html %}
|
@ -2,6 +2,8 @@
|
||||
layout: base
|
||||
---
|
||||
|
||||
<section role="main" id="main" class="row">
|
||||
|
||||
<article class="hentry format-image">
|
||||
|
||||
<div class="photoPost">
|
||||
@ -29,3 +31,5 @@ layout: base
|
||||
</footer>
|
||||
|
||||
</article>
|
||||
|
||||
</section>
|
@ -2,6 +2,8 @@
|
||||
layout: base
|
||||
---
|
||||
|
||||
<section role="main" id="main" class="row">
|
||||
|
||||
<article class="hentry format-link">
|
||||
<header>
|
||||
<h1 class="entry-title">
|
||||
@ -27,3 +29,5 @@ layout: base
|
||||
<p class="time">{{ page.date | date_to_string }} <span class="modtime"></span></p>
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
</section>
|
@ -2,6 +2,8 @@
|
||||
layout: base
|
||||
---
|
||||
|
||||
<section role="main" id="main" class="row">
|
||||
|
||||
<article class="hentry format-post">
|
||||
<header>
|
||||
<h1 class="entry-title">{{ page.title }}</h1>
|
||||
@ -30,3 +32,5 @@ layout: base
|
||||
</div>
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
</section>
|
@ -0,0 +1,138 @@
|
||||
/*
|
||||
|
||||
MAIN JS FOR KREMALICIOUS.COM
|
||||
-----------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2013 Matthias Kretschmann | http://mkretschmann.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
$(ASAP = function(){
|
||||
|
||||
photoGrid.init();
|
||||
|
||||
});
|
||||
|
||||
$(window).load( AfterLoad = function() {
|
||||
|
||||
siteEffects.init();
|
||||
infiniteScroll.init();
|
||||
|
||||
});
|
||||
|
||||
var photoGrid = {
|
||||
|
||||
masonryLayout: function() {
|
||||
var $container = $('#main .masonry');
|
||||
|
||||
$container.imagesLoaded( function(){
|
||||
$container.masonry({
|
||||
itemSelector : 'article',
|
||||
columnWidth : '.grid-sizer'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
init: function(){
|
||||
// only fire when photo post present and screen bigger than 480px
|
||||
if ( $('#main .masonry').length > 0 && Modernizr.mq('only screen and (min-width: 480px)') ) {
|
||||
this.masonryLayout();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var siteEffects = {
|
||||
|
||||
socialiteButtons: function() {
|
||||
$('#tweetsWrap').one('mouseenter', function() {
|
||||
Socialite.load($(this)[0]);
|
||||
});
|
||||
},
|
||||
|
||||
init: function(){
|
||||
this.socialiteButtons();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var infiniteScroll = {
|
||||
|
||||
infiniteScrollSetup: function() {
|
||||
|
||||
if ( $('body.archive.category-photos').length > 0 ) {
|
||||
var items = '#main .masonry';
|
||||
} else {
|
||||
var items = '#main article.hentry';
|
||||
}
|
||||
var $scrollContent = $('#main');
|
||||
|
||||
$scrollContent.infinitescroll({
|
||||
itemSelector : items,
|
||||
nextSelector : '.next a',
|
||||
navSelector : '.pagination',
|
||||
binder : $scrollContent,
|
||||
behavior : 'krlc3',
|
||||
}, function($scrollContent) {
|
||||
// run picturefill over retrieved items
|
||||
picturefill();
|
||||
// run the photogrid over retrieved items
|
||||
photoGrid.init();
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
init: function(){
|
||||
this.infiniteScrollSetup();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
--------------------------------
|
||||
Infinite Scroll Behavior
|
||||
Manual mode with minimal loader
|
||||
|
||||
Usage: behavior: 'krlc3'
|
||||
--------------------------------
|
||||
*/
|
||||
$.extend($.infinitescroll.prototype,{
|
||||
|
||||
_setup_krlc3: function infscr_setup_krlc3 () {
|
||||
var opts = this.options,
|
||||
instance = this,
|
||||
loader = $('<span class="loading"> ...</span>');
|
||||
|
||||
$(opts.nextSelector).parent().parent().addClass('infiniteLoader');
|
||||
|
||||
// Bind nextSelector link to retrieve
|
||||
$(opts.nextSelector).click(function(e) {
|
||||
if (e.which == 1 && !e.metaKey && !e.shiftKey) {
|
||||
e.preventDefault();
|
||||
instance.retrieve();
|
||||
}
|
||||
});
|
||||
|
||||
// custom start
|
||||
instance.options.loading.start = function (opts) {
|
||||
loader
|
||||
.appendTo(opts.nextSelector)
|
||||
.show(opts.loading.speed, function () {
|
||||
instance.beginAjax(opts);
|
||||
});
|
||||
}
|
||||
|
||||
// custom finish
|
||||
instance.options.loading.finished = function(opts) {
|
||||
loader.detach();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
});
|
1
_src/assets/js/lib/infinitescroll
Submodule
1
_src/assets/js/lib/infinitescroll
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 0c1e76f0b51bd420907875968465bdc6035be71d
|
6
_src/assets/js/lib/jquery.min.js
vendored
Normal file
6
_src/assets/js/lib/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
_src/assets/js/lib/modernizr.min.js
vendored
Normal file
4
_src/assets/js/lib/modernizr.min.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
|
||||
* Build: http://modernizr.com/download/#-cssanimations-touch-mq-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes
|
||||
*/
|
||||
;window.Modernizr=function(a,b,c){function A(a){j.cssText=a}function B(a,b){return A(m.join(a+";")+(b||""))}function C(a,b){return typeof a===b}function D(a,b){return!!~(""+a).indexOf(b)}function E(a,b){for(var d in a){var e=a[d];if(!D(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function F(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:C(f,"function")?f.bind(d||b):f}return!1}function G(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return C(b,"string")||C(b,"undefined")?E(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),F(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return w("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},y={}.hasOwnProperty,z;!C(y,"undefined")&&!C(y.call,"undefined")?z=function(a,b){return y.call(a,b)}:z=function(a,b){return b in a&&C(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:w(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},q.cssanimations=function(){return G("animationName")};for(var H in q)z(q,H)&&(v=H.toLowerCase(),e[v]=q[H](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)z(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},A(""),i=k=null,e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.mq=x,e.testProp=function(a){return E([a])},e.testAllProps=G,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document);
|
1
_src/assets/js/lib/socialite
Submodule
1
_src/assets/js/lib/socialite
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit fb04be59c2f5bf010439b4c21f631be0028faa2d
|
16
_src/assets/js/plugins.js
Normal file
16
_src/assets/js/plugins.js
Normal file
File diff suppressed because one or more lines are too long
@ -71,16 +71,18 @@ a.nav-main-link {
|
||||
// Infinite Loader
|
||||
/////////////////////////////////////
|
||||
|
||||
.infiniteLoader p {
|
||||
width: 100%
|
||||
.infiniteLoader .next {
|
||||
width: 100%;
|
||||
float: none;
|
||||
}
|
||||
|
||||
.infiniteLoader .alignright,
|
||||
.infiniteLoader .previous,
|
||||
.infiniteLoader .pagenumber,
|
||||
.infiniteLoader i {
|
||||
.hide;
|
||||
}
|
||||
|
||||
.infiniteLoader a {
|
||||
.infiniteLoader .next a {
|
||||
.btn;
|
||||
.aligncenter;
|
||||
|
||||
|
@ -4,6 +4,8 @@ title: kremalicious
|
||||
description: 'Blog of designer & developer Matthias Kretschmann'
|
||||
---
|
||||
|
||||
<section role="main" id="main" class="row">
|
||||
|
||||
{% for post in paginator.posts %}
|
||||
|
||||
{% if post.layout == "link" %}
|
||||
@ -72,6 +74,8 @@ description: 'Blog of designer & developer Matthias Kretschmann'
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</section>
|
||||
|
||||
<nav class="row pager pagination">
|
||||
{% if paginator.previous_page %}
|
||||
|
||||
@ -84,7 +88,7 @@ description: 'Blog of designer & developer Matthias Kretschmann'
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
<p class="col2 textcenter">
|
||||
<p class="col2 pagenumber textcenter">
|
||||
<span class="page_number ">Page {{ paginator.page }} of {{ paginator.total_pages }}</span>
|
||||
</p>
|
||||
{% if paginator.next_page %}
|
||||
@ -94,5 +98,3 @@ description: 'Blog of designer & developer Matthias Kretschmann'
|
||||
</p>
|
||||
{% endif %}
|
||||
</nav>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user