Skip to content

Instantly share code, notes, and snippets.

View bluespore's full-sized avatar
👾
[object Object]

Sean Bullock bluespore

👾
[object Object]
View GitHub Profile
@bluespore
bluespore / cloudSettings
Last active July 27, 2020 00:42
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-07-27T00:42:52.321Z","extensionVersion":"v3.4.3"}
@bluespore
bluespore / slack-dark.css
Last active October 4, 2017 13:33
Slack Theme
body { background: #222; color: #e6e6e6; }
a { color: #949494; }
a:link, a:visited { color: #949494; }
a:hover, a:active, a:focus { color: #c7c7c7; }
hr { border-bottom: 1px solid #424242; border-top: 1px solid #222; }
@bluespore
bluespore / JS: Scroll to Window Hash
Last active December 14, 2015 16:19
JS: Scroll to Window Hash
$('html, body').animate({ scrollTop : 0 }, 0);
if(window.location.hash) {
setTimeout(function(){
$('html, body').animate({
scrollTop : $(window.location.hash).offset().top
}, 1500);
}, 1000);
}
@bluespore
bluespore / JS: EE Ajax Load
Last active December 14, 2015 10:39
Interacts with AJAX Templates set up in ExpressionEngine. Functionality can obviously be changed to allow Lazy Loading, but this is the basic set up for future referencing.
$('body').delegate('.load-more', 'click', function(e){
//Vars
var
me = $(this),
target = me.attr('href'),
split = target.split('/'),
offset = split[split.length-1],
new_target = '',
container = me.attr('data-container'),
@bluespore
bluespore / JS: New Window Wysiwyg Links
Last active December 14, 2015 10:09
Open any user data links to new window if it is an external page to ensure visit times aren't broken (SEO)
@bluespore
bluespore / JS: Expanding Search Field
Last active December 14, 2015 10:09
Search form that grows / reveals on click of an element.
$('#toggle_search').on('click', function()
{
var form = $(this).closest('form');
//If search not already open, open it
if(!form.hasClass('open')){
form.addClass('open');
//Allow animation of form, then trigger focus on field
@bluespore
bluespore / SASS: Create Sprite Element
Last active December 14, 2015 10:08
Sass - Create Sprite Element
@mixin spr($width, $height, $x, $y){
width:$width;
height:$height;
background-position:$x $y;
}
@bluespore
bluespore / JS: Close When Clicking Elsewhere
Last active December 14, 2015 10:08
Closing interactive pop out/up areas such as modals and menus with jQuery.
/*
UX: Dealing with dynamic pop ups.
Clicking/touching the html will close anything
with a class of 'open'
Sean Bullock
*/
$('html').on('click touchstart', function(){
$('.open').removeClass('open');
});
@bluespore
bluespore / CSS: Typographic Ampersand
Last active October 11, 2015 05:27
CSS Ampersand Typography
.amp {
font-family: Baskerville, 'Goudy Old Style', Palatino, 'Book Antiqua', serif;
font-style: italic;
font-weight: normal;
}
@bluespore
bluespore / HTML: Phone Number Markup
Last active October 11, 2015 05:27
iOS Phone Number Markup
<a href="tel:1-408-555-5555">1-408-555-5555</a>
<a href="sms:1-408-555-1212">New SMS Message</a>