Skip to content

Instantly share code, notes, and snippets.

View james2doyle's full-sized avatar

James Doyle james2doyle

View GitHub Profile
@james2doyle
james2doyle / dabblet.css
Created September 18, 2012 04:13 — forked from bennyschudel/dabblet.css
Stepnavigation
/**
* Stepnavigation
*/
body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12px;
}
ul {
@james2doyle
james2doyle / dabblet.css
Created September 18, 2012 13:13
event widget
/**
* event widget
* url: http://dribbble.com/shots/713807-Extended
*/
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300);
* {
box-sizing: border-box;
}
@james2doyle
james2doyle / dabblet.css
Created September 18, 2012 14:57
odr button
/**
* odr button
*/
body {
margin: 5em;
background: white;
}
button {
@james2doyle
james2doyle / dabblet.css
Created September 20, 2012 15:57
diagonal flip
/**
* diagonal flip
*/
body {
background: #fff;
}
* {
box-sizing: border-box;
@james2doyle
james2doyle / simple templating
Created September 20, 2012 16:36
Simple Javascript Templating
// Simple JavaScript Templating
// John Resig - http://ejohn.org/ - MIT Licensed
(function(){
var cache = {};
this.tmpl = function tmpl(str, data){
// Figure out if we're getting a template, or if we need to
// load the template - and be sure to cache the result.
var fn = !/\W/.test(str) ?
cache[str] = cache[str] ||
@james2doyle
james2doyle / random-hex-color
Created September 21, 2012 04:05
random-hex-color-code-snippets
//http://paulirish.com/2009/random-hex-color-code-snippets
var color = '#'+Math.floor( Math.random()*16777215 ).toString( 16 ) ;
@james2doyle
james2doyle / em media queries
Created September 21, 2012 21:08
EM media queries for desktop and mobile
@media screen and (min-width: 25em) { /* phone */
body {
background: blue;
}
}
@media screen and (min-width: 35em) { /* tablet portrait */
body {
background: yellow;
}
@james2doyle
james2doyle / mobile meta
Created October 2, 2012 17:20
mobile meta viewport tags
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="pragma" content="no-cache">
@james2doyle
james2doyle / Javascript Ease
Created October 9, 2012 13:14
Javascript easing function
function easeIn(pos){
return -Math.cos(pos * (Math.PI/2)) + 1;
}
function easeOut(pos){
return Math.cos(pos * (Math.PI/2));
}
function elastic(pos) {
return -1 * Math.pow(4,-8*pos) * Math.sin((pos*6-1)*(2*Math.PI)/2) + 1;
@james2doyle
james2doyle / dabblet.css
Created October 17, 2012 16:04
Responsive accordion
/**
* Responsive accordion
*/
body {
margin: 3em;
}
.accordion {
height: auto;