Skip to content

Instantly share code, notes, and snippets.

View searleb's full-sized avatar

Bill Searle searleb

View GitHub Profile
@searleb
searleb / Multi-Layered-changing-&-fading-background.markdown
Created March 21, 2015 05:27
Multi-Layered changing & fading background

Multi-Layered changing & fading background

Using d3.js, trianglify.js and velocity.js I was able to create a randomly generated, multilayered, transitioning and responsive background effect.

A Pen by Bill Searle on CodePen.

License.

@searleb
searleb / column-bug.html
Last active November 19, 2015 07:01
Webkit CSS Column Bug - border/padding gets removed from element
<ul>
<li>Lorem ipsum dolor sit amet.</li>
<li>Lorem ipsum dolor sit amet.</li>
<li>Lorem ipsum dolor sit amet.</li>
<li>Lorem ipsum dolor sit amet.</li>
<li>Lorem ipsum dolor sit amet.</li>
<li>Lorem ipsum dolor sit amet.</li>
</ul>
@searleb
searleb / jQuery Animated Page Scrolling.js
Created December 7, 2015 04:21
jQuery page scrolling - on click to an #
$(".scroll").click(function(event) {
event.preventDefault();
var scrollToId = $(this).attr('href');
$("html, body").animate({ scrollTop: $(scrollToId).offset().top }, 400);
});
@searleb
searleb / format-time.js
Last active January 4, 2016 05:31
Meteor Template Helper - Format Time with Moment.js
// requires Moment.js
// format time
UI.registerHelper('formatTime', function(time, formatting) {
if(time) {
return moment(time).format(formatting);
}
});
@searleb
searleb / meteor-starting-packages
Last active January 30, 2016 02:35
Default Meteor Packages
meteor remove insecure autopublish
meteor add fourseven:scss iron:router msavin:mongol accounts-ui
npm install -g meteor-jsdoc
@searleb
searleb / _mixins.scss
Last active March 3, 2016 03:15
A collection of SCSS mixins
/**
* background-image mixin
* @param {string} $url only image name required
* @param {string} $pos: center background-position: [default]center
* @param {string} $size: cover background-size: [default]cover
* @param {string} $rep: no-repeat background-repeat: [default]no-repeat
*/
@mixin background-image($url, $pos: center, $size: cover, $rep: no-repeat ) {
background-image: url('../images/#{$url}');
background-position: $pos;
@searleb
searleb / _helpers.scss
Created February 24, 2016 23:05
A collection of SCSS helpers
/**
* Add this to a bootstrap .row to add flex.
* This will cause child .col-* elements to expand to equal hights
*/
.row-flex {
@media #{$media-sm}{
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-flex-wrap: wrap;
@searleb
searleb / blade-template.php
Created February 29, 2016 23:01
Slick Slider with custom controls and slide indicator
// blade template - just html really
@section('journal-carousel')
<div class="container article-carousel">
<div class="row">
<div class="col-sm-12">
<div class="article-carousel__slider">
@for ($i = 0; $i < 3; $i++)
<figure><img src="{{Theme::url('images/blonde'.$i.'.jpg')}}" alt="" class="img-responsive" /></figure>
@endfor
@for ($i = 0; $i < 3; $i++)
@searleb
searleb / Outside the nav click.js
Created March 10, 2016 00:16
Click any where that isn't the nav to close but clicking anywhere on the nav won't close it. The one is also staggered closing multiple nav levels.
/**
* Closes all navigation layers, staggered from bottom
* if the user clicks anywhere outside of the nav
*/
$('html').on('click', function(event) {
// if the closest parent is not the nav
if (!$(event.target).closest('nav').length) {
// get all elements with the nav--open class and reverse the array
$($('.nav--open').get().reverse()).each(function(i, el) {
// remove the element nav--open class with 300ms * i delay to get the stagger effect