Skip to content

Instantly share code, notes, and snippets.

View ahaywood's full-sized avatar

Amy Haywood Dutton ahaywood

View GitHub Profile
@ahaywood
ahaywood / JS: Toggle Animate and Slide
Last active December 14, 2015 21:28
JS: Toggle Animate and Slide
.animate({ height: 'toggle', opacity: 'toggle'}, 'medium');
@ahaywood
ahaywood / JS: Smooth Scrolling
Last active December 16, 2015 03:18
JS: Smooth Scrolling
$('nav a').click(function(e){
e.preventDefault();
var goto = $(this).parent().attr('class');
var contentPosTop = $('section#' + goto).position().top - 50;
$('html, body').stop().animate({
scrollTop: contentPosTop
}, 1500);
});
@ahaywood
ahaywood / PHP: WP - Custom Post Type
Last active December 16, 2015 04:19
PHP: WP - Custom Post Type
// REGISTER HOMEPAGE CUSTOM TYPE
add_action('init', 'work_register');
function work_register() {
$labels = array(
'name' => _x('Work', 'post type general name'),
'singular_name' => _x('Work', 'post type singular name'),
'add_new' => _x('Add New', 'feature'),
'add_new_item' => __('Add New Work'),
'edit_item' => __('Edit Work'),
@ahaywood
ahaywood / PHP: WP - Featured Image
Last active December 16, 2015 04:39
PHP: WP - Featured Image
@ahaywood
ahaywood / PHP: CI - Documenting Functions
Last active December 16, 2015 18:59
PHP: CI - Documenting Functions
/**
* Function Name / Description
*
* @access public
* @param
* @return
*/
@ahaywood
ahaywood / HTML: Zurb - Making site responsive on mobile devices
Last active December 17, 2015 11:59
HTML: Zurb - Making site responsive on mobile devices
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@ahaywood
ahaywood / SCSS: Default CSS Document
Last active December 17, 2015 16:18
SCSS: Default CSS Document
/* CSS DOCUMENT */
@import "base";
// @import "compass/css3/";
// SPRITES
// $my-icons-spacing: 5px;
// @import "../images/my-icons/*.png";
// $icons: sprite-map("my-icons/*.png");
/* ------------------ REDEFINE STYLES ----------------------- */
@ahaywood
ahaywood / SCSS: Base CSS document
Last active December 17, 2015 16:18
SCSS: Base CSS document
/* BASE CSS DOCUMENT */
// @import "utils/retina-sprites";
// @import "utils/retina";
// $sprites: sprite-map("sprites/*.png", $spacing: 5px); // import 1x sprites
// $sprites2x: sprite-map("sprites-retina/*.png", $spacing: 5px); // import 2x sprites
/* GLOBAL */
$baseurl : "/";
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff') format('woff'), /* Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
@ahaywood
ahaywood / CSS: Image max-width=100%
Last active December 18, 2015 21:19
CSS: Image max-width=100%
img { max-width: 100%; height: auto; }