Skip to content

Instantly share code, notes, and snippets.

View maxxcrawford's full-sized avatar

Maxx Crawford maxxcrawford

View GitHub Profile
@maxxcrawford
maxxcrawford / scrollTo.js
Created October 6, 2016 16:13
Smooth scroll js
function scrollTo(selector, offset){
target = $(selector);
if (target.length) {
var targetOffset = target.offset().top;
if (offset.length){
targetOffset = targetOffset - offset;
}
$('html, body').animate({
scrollTop: targetOffset
}, 'slow');
@maxxcrawford
maxxcrawford / ParsleySubmitGTMFire.js
Created October 5, 2016 16:23
Fire a GTM dataLayer event on form submission using Parsley.js validation
// GTM Parsley Fire
if ( $('.rsvp-content form').length ){
$('.rsvp-content form').parsley().on('form:submit', function() {
// This global callback will be called for any field that fails validation.
// console.log( 'parsleySubmit' );
if (typeof dataLayer !== 'undefined') {
dataLayer.push({
"event": "form",
"section": "rsvp_submission"
});
@maxxcrawford
maxxcrawford / phpinfo.php
Created June 24, 2016 03:21
check site php info
<?php phpinfo();
@maxxcrawford
maxxcrawford / Lorem Ipsum
Created March 23, 2016 16:45
lorem ipsum snippet
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@maxxcrawford
maxxcrawford / CSS3 - Inline text with padded rows.html
Created January 26, 2016 20:45
CSS3 - Inline text with padded rows
<!DOCTYPE html><html class=''>
<head><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="canonical" href="http://codepen.io/df/pen/bfnso" />
<style class="cp-pen-styles">/**
* Flexible inline text with background color
*/
body {
width: 50%;
background: #363532;
@maxxcrawford
maxxcrawford / css-stripes.html
Created January 26, 2016 20:44
Stripes CSS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
/*
// Mixin to generate a striped background
// -------------------------
@maxxcrawford
maxxcrawford / CSS3 - Highlighter.html
Created January 26, 2016 20:44
Highlighter Effect
<!DOCTYPE html><html class=''>
<head><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="canonical" href="http://codepen.io/jeffballweg/pen/XJKwvp" />
<style class="cp-pen-styles">html {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizelegibility;
font-family: 'Palatino', 'Didot', 'Garamond', serif;
}
@maxxcrawford
maxxcrawford / X-div.html
Created January 26, 2016 20:27
X Layout Div
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>X</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style>
/* Put Styles Here */
@maxxcrawford
maxxcrawford / stripes-mixin.scss
Created January 18, 2016 16:49
SASS Mixin for CSS Stripes Border
@mixin stripes($color: $black, $size: 5px) {
background-color: transparent;
background-size: $size $size;
background-image: repeating-linear-gradient(-45deg, $color 0, $color 25%, transparent 0, transparent 51%);
}
@maxxcrawford
maxxcrawford / parsley-form.scss
Last active December 28, 2015 22:33
Parsley Validation – Adds overlay once the form is successfully submitted to stop user from selecting submit multiple times.
.parsley, .webform-client-form .form-item .parsley {
&-success {
outline: 1px solid $green;
}
&-error {
outline: 1px solid red;
}
&-errors-list {
display: none;
}