Skip to content

Instantly share code, notes, and snippets.

View jonathansampson's full-sized avatar
🦁
*roar*

Sampson jonathansampson

🦁
*roar*
View GitHub Profile
@jonathansampson
jonathansampson / dabblet.css
Created May 31, 2012 04:11
CSS Dice: An Experiment by Jonathan Sampson - @jonathansampson
/* CSS Dice: An Experiment by Jonathan Sampson - @jonathansampson */
.die.one .dot {
box-shadow: 0 .2em 0 #FFF
}
.die.two .dot {
background: transparent;
box-shadow: -2.3em -2.3em 0 #345,
2.3em 2.3em 0 #345,
-2.3em -2.3em 0 #FFF,
2.3em 2.4em 0 #FFF
@jonathansampson
jonathansampson / dabblet.css
Created June 26, 2012 15:43
Delayed Animations
/**
* Delayed Animations
*/
@keyframes fadeToBlue {
50% {
background: blue
}
}
.foo {
@jonathansampson
jonathansampson / dabblet.css
Created January 19, 2013 07:13
Make it a marquee
/* Make it a marquee */
.marquee {
width: 450px;
margin: 0 auto;
overflow: hidden;
white-space: nowrap;
box-sizing: border-box;
animation: marquee 50s linear infinite;
}
@jonathansampson
jonathansampson / dabblet.css
Created February 4, 2013 21:15
A Bandeira do Brasil
/**
* A Bandeira do Brasil
*/
body { margin: 0 }
html { background: #111111 }
.brasil {
/* Adjust for larger/smaller flag */
font-size: 20px;
@jonathansampson
jonathansampson / dabblet.css
Created February 13, 2013 06:45
Repeating Lateral Text Shadows - By @LeaVerou
/* Repeating Lateral Text Shadows - By @LeaVerou */
body { margin: 0 }
h1 {
color: #3D6AA2;
position: relative;
font: bold 2em/1em 'Segoe UI';
}
@jonathansampson
jonathansampson / gist:6954377
Last active December 25, 2015 09:29
Initial attempts at logging the console support for each major browser/version.
/*
(function () {
var prop, props = [];
for ( prop in console ) {
props.push({
name: prop,
type: Object.prototype.toString.call( console[ prop ] )
@jonathansampson
jonathansampson / Proto-Crawler.js
Last active August 29, 2015 13:57
Enumerates all properties of an object, including those found along the prototype chain.
var output = (function ( object ) {
"use strict";
function getProperties ( object ) {
return object ? Object.getOwnPropertyNames( object )
.concat( getProperties( Object.getPrototypeOf( object ) ) ) : [] ;
}
function getUnique ( array ) {
@jonathansampson
jonathansampson / Object-Crawler.js
Last active August 29, 2015 14:01
Creates an object that reveals browser features and functionality
/*global document, prompt */
(function( global ) {
"use strict";
var response = {
browser: {
name: prompt( "Browser Name? (Chrome, IExplorer, etc)" ),
version: prompt( "Browser Version? (34, 11, etc)" )
},
// based on https://snipt.net/gregwhitworth/w3c-keyword-colors-90c153dd/
// adds alphabetical index, hex, and rgb values
var colors = {
"a": [
[
"aliceblue",
"#F0F8FF",
"rgb(240, 248, 255)"
],
[
@jonathansampson
jonathansampson / valueAsNumber.js
Created August 4, 2014 15:48
`valueAsNumber` shim for Internet Explorer 11
(function () {
/* Internet Explorer 11 may have trouble retrieving the number type
of an input value. This short script performs a quick test, and repairs
the functionality if necessary. Load before attempting to use the
`valueAsNumber` property on input elements. */
"use strict";
var a = document.createElement( "input" );