Skip to content

Instantly share code, notes, and snippets.

View parrfolio's full-sized avatar
My God, It's Full of Stars

Ryan Parr parrfolio

My God, It's Full of Stars
View GitHub Profile
@parrfolio
parrfolio / hardware-acceleration-ios
Created May 23, 2012 21:53
Hardware Acceleration iOS
#foo {
-webkit-transform: translate3d(x,y,z);
}
@parrfolio
parrfolio / css3-animation-template
Created May 23, 2012 17:15
CSS3 Animation Template
foo {
animation-name: spin;
animation-duration: 3s;
animation-timing-function: ease | linear | ease-in | ease-out | ease-in-out | step-start | step-end | steps(10,start | end) | cubic-bezier(<number>, <number>, <number>, <number>);
animation-delay: 3s;
animation-iteration-count: infinite | 10;
animation-direction: alternate | normal;
animation-fill-mode: forward | backwards | both | none;
animation-play-state: running | paused;
}
@parrfolio
parrfolio / css3-animations
Created March 6, 2012 23:46
flip, shake, fade CSS3 Animations
@-webkit-keyframes shake {
0%, 100% {-webkit-transform: translateX(0);}
10%, 30%, 50%, 70%, 90% {-webkit-transform: translateX(-10px);}
20%, 40%, 60%, 80% {-webkit-transform: translateX(10px);}
}
@-moz-keyframes shake {
0%, 100% {-moz-transform: translateX(0);}
10%, 30%, 50%, 70%, 90% {-moz-transform: translateX(-10px);}
20%, 40%, 60%, 80% {-moz-transform: translateX(10px);}
@parrfolio
parrfolio / image-replacement
Created March 6, 2012 18:13
Updated CSS Image Replacement
.foo {
font: 0/0 a;
color: transparent;
text-shadow: none;
background: url("your-image-here");
}
@parrfolio
parrfolio / slideup-slidedown
Created February 29, 2012 00:02
Slide Up/Slide Down Accessible jQuery
var $button = $('#myButton'),
$text = $('#myText'),
visible = true;
$button.click(function(){
if ( visible ) {
$text.slideUp('fast',function(){
$text.addClass('hide')
.slideDown(0);
});
@parrfolio
parrfolio / jquery.animate.done.callback
Created December 12, 2011 18:07
jQuery Animation Done Callback
$('div').animate({"opacity": "0"}, 1000).promise().done(function(){
// animations are finished, run code
});
@parrfolio
parrfolio / Styling_Ordered_List_Numbers
Created November 21, 2011 17:37
Styling Ordered List Numbers
ol {
counter-reset:li; /* Initiate a counter */
margin-left:0; /* Remove the default left margin */
padding-left:0; /* Remove the default left padding */
}
ol > li {
position:relative; /* Create a positioning context */
margin:0 0 6px 2em; /* Give each list item a left margin to make room for the numbers */
padding:4px 8px; /* Add some spacing around the content */
list-style:none; /* Disable the normal item numbering */
@parrfolio
parrfolio / css
Created November 4, 2011 17:05
Vertical Center Boxes
.block {
text-align: center;
background: #c0c0c0;
border: #a0a0a0 solid 1px;
margin: 20px;
}
.block:before {
content: '';
display: inline-block;
@parrfolio
parrfolio / jqueryRotateTabs
Created October 26, 2011 15:32
Simple Auto Rotate Tabs Jquery
$(function() {
var $list = $('#animation li');
$list.filter(':first').addClass('go');
setInterval(function() {
if( $list.filter('.go').index() !== $list.length - 1 ) {
$list.filter('.go').removeClass('go').next().addClass('go');
}
else {
$list.removeClass('go').filter(':first').addClass('go');
@parrfolio
parrfolio / webkit-overflow-scrolling: touch
Created October 15, 2011 05:14
webkit-overflow-scrolling: touch
overflow: scroll;
-webkit-overflow-scrolling: touch;