Skip to content

Instantly share code, notes, and snippets.

@phongjalvn
Created June 5, 2012 05:46
Show Gist options
  • Save phongjalvn/2872931 to your computer and use it in GitHub Desktop.
Save phongjalvn/2872931 to your computer and use it in GitHub Desktop.
remember to define focus styles!
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
background-color:transparent;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
body {
line-height: 1;
color: black;
background: transparent;
}
ol, ul {
list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
body,td,th { font-family: 'Anivers', sans-serif; }
body { background: #e4e4e4; }
html, body { width:100%; height:100%; margin:0; padding:0; }
html {display:table;}
body { display:table-cell; vertical-align:middle; }
#canvas { height: 300px; max-width: 400px; margin:0 auto; position: relative; background: url(http://i.imgur.com/iTe0j.jpg); }
.shad { box-shadow: 0 0 5px rgba(0,0,0,0.5); }
p { margin: 0px 0 12px; text-align: justify; }
a { color: #fff; text-decoration: none; }
a.img { }
#cont { width: 383px; height: 210px; position: relative; position: absolute; top: 48px; left: 17px; }
#open, #close { width: 22px; height: 200px; position: absolute; left: 144px; top: 2px; z-index: 100; cursor: pointer; }
#open { }
#close { display: none }
#close a#x { width: 14px; height: 14px; display: block; position: absolute; top: 92px; background-position: -454px 0; }
#pocket, #card, #shadow, #peek, a#x, .socialBox a { background: url(http://i.imgur.com/NePdG.png); }
#peek { width: 27px; height: 200px; position: absolute; top: 2px; left: 2px; background-position: -427px 0; }
#shadow { width: 22px; height: 200px; position: absolute; left: 144px; top: 2px; z-index: 75; opacity: 0.5; background-position: -405px 0; }
#shadow.open { opacity: 1; }
#pocket { width: 240px; height: 210px; position: absolute; right: 0; z-index: 75; background-position: -165px 0; }
#pocket .info { width: 200px; position: absolute; right: 0; top: 25px; }
#pocket .info span { font-size: 13px; color: #E2DFD7; display: block; margin-bottom: 15px; }
#pocket .info, #pocket .info a { font-size: 15px; color: #77654A; text-decoration: none; }
.socialBox { width: 162px; display: block; text-align: center; margin-top: -2px; }
.socialBox a { width: 38px; height: 31px; margin: 0 5px; display: inline-block; }
.socialBox a.tw { background-position: -454px -14px; } .socialBox a.tw:hover { background-position: -454px -44px; }
.socialBox a.fb { width: 18px; background-position: -454px -76px; } .socialBox a.fb:hover { background-position: -454px -106px; }
.socialBox a.zer { width: 23px; background-position: -472px -76px; } .socialBox a.zer:hover { background-position: -472px -105px; }
.socialBox a.dr { width: 30px; background-position: -454px -138px; } .socialBox a.dr:hover { background-position: -454px -168px; }
#card { width: 162px; height: 207px; padding: 3px 0 0 3px; position: absolute; left: 141px; z-index: 25; }
#card.open { left: 0; }
<div id="canvas" class="shad">
<div id="cont">
<div id="open">
</div>
<div id="close">
<a id="x"></a>
</div>
<div id="pocket">
<div class="info">
Ryan Hudson-Peralta <span>DESIGNER/FRONT-END DEV</span>
586.477.4717 <span>phone</span>
<a href="mailto:[email protected]">[email protected]</a>
<span>email</span>
<div class="socialBox">
<a href="http://twitter.com/hudsonperalta" class="tw"></a>
<a href="http://facebook.com/hudsonperalta" class="fb"></a>
<a href="http://zerply.com/hudsonperalta" class="zer"></a>
<a href="http://dribbble.com/hudsonperalta" class="dr"></a>
</div>
</div>
</div>
<div id="shadow">
</div>
<div id="card">
<div id="peek">
</div>
<img src="images/photo-hp.jpg">
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://cherne.net/brian/resources/jquery.hoverIntent.minified.js"></script>
<script>
$('#open').hover(function(){
var clicked = $(this).data('clicked', false);
$('#card').stop().animate( {left: 135}, 300);
},function(){
var clicked = $(this).data('clicked');
if(!clicked) $('#card').stop().animate( {left: 141}, 300);
}).click(function(){
$(this).data('clicked', true);
$(this).hide();
$('#peek').animate( {left: 164}, 750, function () { $('#shadow').addClass('open'); });
$('#card').stop().animate( {left: 0}, 750);
$('#close').delay(500).fadeIn(200);
});
$('#close').on('click', function () {
$(this).fadeOut(200);
$('#peek').animate( {left: 2}, 750);
$('#shadow').removeClass('open');
$('#card').stop().animate( {left: 141}, 750, function () {
$('#open').show();
});
});
$(function() {
});
</script>
{"version":"1.1","settings":{"fontsize":"100","prefixfree":"1"},"view":[{"template":"r\nc","active":true,"seethrough":false},{"template":"r\nh","active":false,"seethrough":false},{"template":"r","active":false,"seethrough":false}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment