Skip to content

Instantly share code, notes, and snippets.

View freshyill's full-sized avatar
💭
😎 Cool

Chris Coleman freshyill

💭
😎 Cool
View GitHub Profile
@freshyill
freshyill / wpcustompostclass.php
Created August 17, 2011 05:36
Add a custom post class in WordPress
<?php // First, create a custom field named 'custom_class' in WordPress and give it a value ?>
<?php // The Loop...
if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php // Declare a variable using the custom field
$custom_classes = get_post_meta($post->ID, 'custom_class', false); ?>
@freshyill
freshyill / fancyform
Created August 17, 2011 18:57
Fancy show/hide form with CSS3 and jQuery
<!doctype html>
<html>
<head>
<style type="text/css">
body {background: #333; font-family: Helvetica; padding: 20px;}
.container {width: 80%; margin: 20px auto; padding: 0; position: relative;}
article {background: #666; margin: 0; padding: 50px; border-radius: 4px; box-shadow: 0 0 15px #000, 0 1px 1px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,0.3) inset; position: relative; -webkit-perspective: 1000; z-index: 2; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.5);}
@freshyill
freshyill / alert.js
Created September 2, 2011 01:05
Simple IE 6 alert with conditional comments and jQuery
$('document').ready(function(){
// Grab the message from the text file
var ie6message = 'alert.txt';
// Create a div to hold the alert
var alertdiv = $('<div id="alert">');
// Load the message into the div
alertdiv.load(ie6message);
// Insert the message into the page. Notice the .ie6 class, which only appears when using IE 6.
$('.ie6 body').prepend(alertdiv);
});
@freshyill
freshyill / vendor-prefix-example.sass
Created September 6, 2011 17:01
CSS3 vendor prefix mixin
// Example variable
$realistic-drop: 1px 1px 5px #000, 1px 1px 1px #000;
// Example mixin
@mixin box-shadow ($box-shadow) {
-webkit-box-shadow: $box-shadow;
-moz-box-shadow: $box-shadow;
-ms-box-shadow: $box-shadow;
-o-box-shadow: $box-shadow;
box-shadow: $box-shadow;
@freshyill
freshyill / dabblet.css
Created December 16, 2011 15:58
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
/**
* Rotator
*/
body {font-family: Arial Rounded MT Bold; color: #333;}
h2 { font-weight: normal;}
/* Stage */
@keyframes stage {
from {background-color: #ccc;} /* Slide 1 / Start */
20.0% {background-color: #ccc;}
/**
* Rotator
*/
body {font-family: Arial Rounded MT Bold; color: #333;}
h2 { font-weight: normal;}
.outline {overflow: hidden;}
.adventures-stage {overflow: hidden; border: 1px solid #222; height: 300px; width: 700px; margin: 50px auto; position: relative; z-index: 5; border-radius: 4px;}
[class^=slide] {box-sizing: border-box; position: absolute; transition: .2s all ease 0; padding: 20px;}
/**
* Rotator
*/
body {font-family: Arial Rounded MT Bold; color: #333;}
h2 { font-weight: normal;}
.bones .stage {overflow: visible;}
.bones [class^=carousel] {background: rgba(1,1,1,.2);}
@freshyill
freshyill / dabblet.css
Created May 9, 2012 15:11
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.shadowy {
border: 1px solid #ccc;
padding: 20px;
width: 500px;
box-shadow: 1px 0 0 1px rgba(0,0,0,.1) inset;
}
@freshyill
freshyill / dabblet.css
Created May 11, 2012 19:42
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {font-family: Arial Rounded MT Bold;}
* {box-sizing: border-box;}
a { text-decoration: none;}