mirror of
https://github.com/kremalicious/blog.git
synced 2024-06-28 16:48:00 +02:00
remove socialite, use static tweet button
This commit is contained in:
parent
7b6f9bf812
commit
29132bc1e5
|
@ -111,7 +111,6 @@ module.exports = function(grunt){
|
||||||
'bower_components/masonry/index.js',
|
'bower_components/masonry/index.js',
|
||||||
'bower_components/imagesloaded/imagesloaded.js',
|
'bower_components/imagesloaded/imagesloaded.js',
|
||||||
'bower_components/simpleJekyllSearch/index.js',
|
'bower_components/simpleJekyllSearch/index.js',
|
||||||
'bower_components/socialite/index.js',
|
|
||||||
'bower_components/jquery.adaptive-background/index.js',
|
'bower_components/jquery.adaptive-background/index.js',
|
||||||
'<%= config.src %>/<%= config.assets.js %>/app.js'
|
'<%= config.src %>/<%= config.assets.js %>/app.js'
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
<aside class="comments">
|
<aside class="comments">
|
||||||
|
|
||||||
<p>You should tweet this post</p>
|
<p>You should tweet this post</p>
|
||||||
<p class="btn-wrap"><a class="btn socialite twitter-share icon-twitter" data-via="kremalicious" data-related="kremaliciouscom,ezeep" href="https://twitter.com/share">Tweet</a></p>
|
<p class="btn-wrap"><a class="btn twitter-share icon-twitter" target="_blank" href="https://twitter.com/intent/tweet?url={{ site.url | cgi_escape }}{{ page.url | cgi_escape }}&text={{ page.title | cgi_escape }}&via=kremalicious&related=kremaliciouscom,ezeep">Tweet</a></p>
|
||||||
|
|
||||||
</aside>
|
</aside>
|
|
@ -3,29 +3,29 @@ $(ASAP = function(){
|
||||||
|
|
||||||
siteNavigation.init();
|
siteNavigation.init();
|
||||||
siteEffects.init();
|
siteEffects.init();
|
||||||
|
infiniteScroll.init();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).load( AfterLoad = function() {
|
$(window).load( AfterLoad = function() {
|
||||||
|
|
||||||
photoGrid.init();
|
photoGrid.init();
|
||||||
infiniteScroll.init();
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var siteNavigation = {
|
var siteNavigation = {
|
||||||
|
|
||||||
siteSearch: function() {
|
siteSearch: function() {
|
||||||
|
|
||||||
var $searchlink = $('.search-btn'),
|
var $searchlink = $('.search-btn'),
|
||||||
$searcharea = $('.topbar .search-area'),
|
$searcharea = $('.topbar .search-area'),
|
||||||
$searchfield = $('.search-field'),
|
$searchfield = $('.search-field'),
|
||||||
$searchresults = $('.search-results'),
|
$searchresults = $('.search-results'),
|
||||||
$searchpop = $('.popover');
|
$searchpop = $('.popover');
|
||||||
|
|
||||||
$searchlink.click(function(e){
|
$searchlink.click(function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// init jekyll search
|
// init jekyll search
|
||||||
$searchfield.jekyllSearch({
|
$searchfield.jekyllSearch({
|
||||||
searchResults : $searchresults,
|
searchResults : $searchresults,
|
||||||
|
@ -33,28 +33,28 @@ var siteNavigation = {
|
||||||
template : '<a class="nav-link" href="{url}" title="{title}">{title}</a>',
|
template : '<a class="nav-link" href="{url}" title="{title}">{title}</a>',
|
||||||
fuzzy : true
|
fuzzy : true
|
||||||
});
|
});
|
||||||
|
|
||||||
// show search
|
// show search
|
||||||
$searcharea.addClass('ready');
|
$searcharea.addClass('ready');
|
||||||
$searchfield.focus();
|
$searchfield.focus();
|
||||||
if ( $searchfield.val().length ) {
|
if ( $searchfield.val().length ) {
|
||||||
$searchpop.removeClass('hide');
|
$searchpop.removeClass('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
// hide menu too just in case
|
// hide menu too just in case
|
||||||
if ( $('body').hasClass('menu-open') ) {
|
if ( $('body').hasClass('menu-open') ) {
|
||||||
$('body').removeClass('menu-open');
|
$('body').removeClass('menu-open');
|
||||||
}
|
}
|
||||||
|
|
||||||
// bind the hide controls
|
// bind the hide controls
|
||||||
$(document).bind('click.hidethepop', function() {
|
$(document).bind('click.hidethepop', function() {
|
||||||
$searcharea.removeClass('ready');
|
$searcharea.removeClass('ready');
|
||||||
$searchpop.addClass('hide');
|
$searchpop.addClass('hide');
|
||||||
|
|
||||||
// unbind the hide controls
|
// unbind the hide controls
|
||||||
$(document).unbind('click.hidethepop');
|
$(document).unbind('click.hidethepop');
|
||||||
});
|
});
|
||||||
|
|
||||||
// dont close thepop when click on thepop
|
// dont close thepop when click on thepop
|
||||||
$searchpop.click(function(e) {
|
$searchpop.click(function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
@ -63,39 +63,39 @@ var siteNavigation = {
|
||||||
$searchfield.click(function(e) {
|
$searchfield.click(function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
// and dont close thepop now
|
// and dont close thepop now
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
// finally show popup upon first keypress
|
// finally show popup upon first keypress
|
||||||
$searchfield.on('keyup', function() {
|
$searchfield.on('keyup', function() {
|
||||||
$searchpop.removeClass('hide');
|
$searchpop.removeClass('hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
// close button
|
// close button
|
||||||
$('.search-close').click(function(e){
|
$('.search-close').click(function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// hide search area
|
// hide search area
|
||||||
$searcharea.removeClass('ready');
|
$searcharea.removeClass('ready');
|
||||||
$searchpop.addClass('hide');
|
$searchpop.addClass('hide');
|
||||||
|
|
||||||
// empty search field
|
// empty search field
|
||||||
$searchfield.val('').blur();
|
$searchfield.val('').blur();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
siteMenu: function() {
|
siteMenu: function() {
|
||||||
var $thelink = $('.menu-btn'),
|
var $thelink = $('.menu-btn'),
|
||||||
$thepop = $('.nav-main .nav-popover');
|
$thepop = $('.nav-main .nav-popover');
|
||||||
|
|
||||||
$thelink.click(function(e){
|
$thelink.click(function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// toggle menu
|
// toggle menu
|
||||||
$('body').toggleClass('menu-open');
|
$('body').toggleClass('menu-open');
|
||||||
|
|
||||||
if ( $('body').hasClass('menu-open') ) {
|
if ( $('body').hasClass('menu-open') ) {
|
||||||
$thepop.removeClass('hide');
|
$thepop.removeClass('hide');
|
||||||
} else {
|
} else {
|
||||||
|
@ -104,22 +104,22 @@ var siteNavigation = {
|
||||||
|
|
||||||
// bind the hide controls
|
// bind the hide controls
|
||||||
$(document).bind('click.hidethepop', function() {
|
$(document).bind('click.hidethepop', function() {
|
||||||
$('body').removeClass('menu-open');
|
$('body').removeClass('menu-open');
|
||||||
$thepop.toggleClass('hide');
|
$thepop.toggleClass('hide');
|
||||||
// unbind the hide controls
|
// unbind the hide controls
|
||||||
$(document).unbind('click.hidethepop');
|
$(document).unbind('click.hidethepop');
|
||||||
});
|
});
|
||||||
|
|
||||||
// dont close thepop when you click on thepop
|
// dont close thepop when you click on thepop
|
||||||
$thepop.click(function(e) {
|
$thepop.click(function(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
// and dont close thepop now
|
// and dont close thepop now
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
init: function(){
|
init: function(){
|
||||||
this.siteSearch();
|
this.siteSearch();
|
||||||
this.siteMenu();
|
this.siteMenu();
|
||||||
|
@ -131,7 +131,7 @@ var photoGrid = {
|
||||||
|
|
||||||
masonryLayout: function() {
|
masonryLayout: function() {
|
||||||
var $container = $('#main .masonry');
|
var $container = $('#main .masonry');
|
||||||
|
|
||||||
$container.imagesLoaded( function(){
|
$container.imagesLoaded( function(){
|
||||||
$container.masonry({
|
$container.masonry({
|
||||||
itemSelector : 'article',
|
itemSelector : 'article',
|
||||||
|
@ -142,7 +142,7 @@ var photoGrid = {
|
||||||
|
|
||||||
init: function(){
|
init: function(){
|
||||||
// only fire when photo page present and screen bigger than 480px
|
// only fire when photo page present and screen bigger than 480px
|
||||||
if ( $('.page-photos').length > 0 ) {
|
if ( $('.page-photos').length > 0 ) {
|
||||||
this.masonryLayout();
|
this.masonryLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,33 +150,25 @@ var photoGrid = {
|
||||||
}
|
}
|
||||||
|
|
||||||
var siteEffects = {
|
var siteEffects = {
|
||||||
|
|
||||||
adaptiveBackground: function() {
|
adaptiveBackground: function() {
|
||||||
var opts = {
|
var opts = {
|
||||||
selector: '.hmedia img',
|
selector: '.hmedia img',
|
||||||
parent: '.document'
|
parent: '.document'
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.hmedia img').imagesLoaded( function(){
|
$('.hmedia img').imagesLoaded( function(){
|
||||||
$.adaptiveBackground.run(opts)
|
$.adaptiveBackground.run(opts)
|
||||||
});
|
});
|
||||||
|
|
||||||
// jump to photo background start
|
// jump to photo background start
|
||||||
$(document).scrollTop($('#main').offset().top);
|
$(document).scrollTop($('#main').offset().top);
|
||||||
},
|
},
|
||||||
|
|
||||||
socialiteButtons: function() {
|
|
||||||
|
|
||||||
$('.comments').one('mouseenter', function() {
|
|
||||||
Socialite.load($(this)[0]);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
init: function(){
|
init: function(){
|
||||||
if ( $('.page-single .format-photo').length > 0 ) {
|
if ( $('.page-single .format-photo').length > 0 ) {
|
||||||
this.adaptiveBackground();
|
this.adaptiveBackground();
|
||||||
}
|
}
|
||||||
this.socialiteButtons();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
.border-radius;
|
.border-radius;
|
||||||
.box-shadow(~"0 1px 3px rgba(151,156,159,.1), inset 0 1px 0 rgba(255,255,255,.7)");
|
.box-shadow(~"0 1px 3px rgba(151,156,159,.1), inset 0 1px 0 rgba(255,255,255,.7)");
|
||||||
.transition;
|
.transition;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: rgba(255,255,255,.5);
|
background-color: rgba(255,255,255,.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border-top-color: rgba(94,131,162,.5);
|
border-top-color: rgba(94,131,162,.5);
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
.box-shadow(0 1px 0 #fff);
|
.box-shadow(0 1px 0 #fff);
|
||||||
.transition(none);
|
.transition(none);
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
font-size: .9em;
|
font-size: .9em;
|
||||||
color: rgba(19, 56, 50, .6);
|
color: rgba(19, 56, 50, .6);
|
||||||
|
@ -48,13 +48,13 @@ a.btn-primary:visited {
|
||||||
border-color: rgba(40,101,93,.4);
|
border-color: rgba(40,101,93,.4);
|
||||||
border-bottom-color: rgba(40,101,93,.5);
|
border-bottom-color: rgba(40,101,93,.5);
|
||||||
.box-shadow(~"0 1px 3px rgba(151,156,159,.1), inset 0 1px 0 rgba(255,255,255,.4)");
|
.box-shadow(~"0 1px 3px rgba(151,156,159,.1), inset 0 1px 0 rgba(255,255,255,.4)");
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: darken(@link-color, 30%);
|
color: darken(@link-color, 30%);
|
||||||
background-color: lighten(@link-color, 25%);
|
background-color: lighten(@link-color, 25%);
|
||||||
text-shadow: 0 1px 0 rgba(255,255,255,.3);
|
text-shadow: 0 1px 0 rgba(255,255,255,.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
color: darken(@link-color, 30%);
|
color: darken(@link-color, 30%);
|
||||||
background-color: lighten(@link-color, 15%);
|
background-color: lighten(@link-color, 15%);
|
||||||
|
@ -72,16 +72,16 @@ a.btn-primary:visited {
|
||||||
.box-shadow(none);
|
.box-shadow(none);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
i:before {
|
i:before {
|
||||||
top: .15em;
|
top: .15em;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
&:active {
|
&:active {
|
||||||
background: @link-color;
|
background: @link-color;
|
||||||
.box-shadow(none);
|
.box-shadow(none);
|
||||||
}
|
}
|
||||||
|
@ -92,32 +92,46 @@ a.btn-primary:visited {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Socialite.js
|
//
|
||||||
// replicate social buttons, but dim everything
|
// Tweet button
|
||||||
.btn.socialite {
|
//
|
||||||
font: normal normal normal 11px/18px 'Helvetica Neue',Arial,sans-serif;
|
.btn.twitter-share {
|
||||||
text-align: left;
|
display: inline-block;
|
||||||
color: #676767;
|
padding: 1px 3px 0 3px;
|
||||||
text-transform: none;
|
height: 21px;
|
||||||
font-weight: bold;
|
border: 1px solid #ccc;
|
||||||
text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
|
|
||||||
height: 21px;
|
|
||||||
max-width: 100%;
|
|
||||||
position: relative;
|
|
||||||
background-color: rgba(255,255,255,.4);
|
|
||||||
#gradient > .vertical(rgba(255,255,255,0.7); 0%; rgba(255,255,255,0); 100%);
|
|
||||||
border: 1px solid #dcdcdc;
|
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
display: inline-block;
|
font: bold 11px/17px Helvetica, Arial, sans-serif;
|
||||||
|
text-align: left;
|
||||||
|
color: #333;
|
||||||
|
text-transform: none;
|
||||||
|
text-decoration: none;
|
||||||
|
text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
#gradient > .vertical(#fff; 0%; #dedede; 100%);
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
padding: 1px 5px;
|
|
||||||
.box-shadow(none);
|
.box-shadow(none);
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:active {
|
||||||
|
border-color: #bbb;
|
||||||
|
background-color: #d9d9d9;
|
||||||
|
#gradient > .vertical(#f8f8f8; 0%; #d9d9d9; 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
top: 0;
|
||||||
|
background-color: #efefef;
|
||||||
|
box-shadow: inset 0 3px 5px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
// icon
|
// icon
|
||||||
&:before {
|
&:before {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
top: 1px
|
top: 1px;
|
||||||
|
color: #0089cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,19 +1,17 @@
|
||||||
|
|
||||||
.comments {
|
.comments {
|
||||||
.clearfix;
|
&:extend(.clearfix all, .textcenter);
|
||||||
font-size: @font-size-small;
|
font-size: @font-size-small;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
color: @text-color-dimmed;
|
color: @text-color-dimmed;
|
||||||
margin-top: @line-height-computed*2;
|
margin-top: @line-height-computed*2;
|
||||||
text-align: center;
|
|
||||||
.border-radius;
|
.border-radius;
|
||||||
|
|
||||||
p,
|
p,
|
||||||
.btn { margin-bottom: 0; }
|
.btn { margin-bottom: 0; }
|
||||||
|
|
||||||
.btn-wrap {
|
.btn-wrap {
|
||||||
margin-top: @line-height-computed/2;
|
margin-top: @line-height-computed/2;
|
||||||
height: 27px
|
height: 27px
|
||||||
}
|
}
|
||||||
.btn { left: -20px }
|
|
||||||
}
|
}
|
|
@ -76,7 +76,7 @@ a:active {
|
||||||
.transition(none);
|
.transition(none);
|
||||||
top: 1px;
|
top: 1px;
|
||||||
background: @link-color;
|
background: @link-color;
|
||||||
color: #fff !important;
|
color: #fff;
|
||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
"imagesloaded": ">=3.1.0",
|
"imagesloaded": ">=3.1.0",
|
||||||
"infinitescroll": "https://raw.github.com/paulirish/infinite-scroll/master/jquery.infinitescroll.js",
|
"infinitescroll": "https://raw.github.com/paulirish/infinite-scroll/master/jquery.infinitescroll.js",
|
||||||
"simpleJekyllSearch": "https://raw.github.com/christian-fei/Simple-Jekyll-Search/master/jekyll-search.jquery.js",
|
"simpleJekyllSearch": "https://raw.github.com/christian-fei/Simple-Jekyll-Search/master/jekyll-search.jquery.js",
|
||||||
"socialite": "https://raw.github.com/tmort/Socialite/master/socialite.js",
|
|
||||||
"jquery.adaptive-background": "https://raw.github.com/briangonzalez/jquery.adaptive-backgrounds.js/master/src/jquery.adaptive-backgrounds.js"
|
"jquery.adaptive-background": "https://raw.github.com/briangonzalez/jquery.adaptive-backgrounds.js/master/src/jquery.adaptive-backgrounds.js"
|
||||||
},
|
},
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user