Skip to content

Instantly share code, notes, and snippets.

@siygle
Created July 3, 2012 18:08
Show Gist options
  • Select an option

  • Save siygle/3041453 to your computer and use it in GitHub Desktop.

Select an option

Save siygle/3041453 to your computer and use it in GitHub Desktop.
.box {
width: 880px;
height: 330px;
border-radius: .5em;
}
.sunrise {
position: absolute;
background: #eee;
box-shadow: 0 0 10px rgba(0, 0, 0, .7);
}
.slider {
width: 520px;
overflow: hidden;
display: inline-block;
-webkit-transform: skewX(-20deg);
transform: skewX(-20deg);
-webkit-transition: width 1.2s ease-in-out;
transition: width 1.2s ease-in-out;
margin-left: -76px;
border-right: 10px solid ghostwhite;
pointer-events: none;
}
.sunset {
-webkit-transform: skewX(20deg);
transform: skewX(20deg);
margin-left: 76px;
background: #555;
pointer-events: auto;
}
.slider:hover {
width: 760px;
}
.sunrise:hover + .slider {
width: 250px;
}
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="index.css" media="screen" type="text/css">
</head>
<body>
<div class="box sunrise"><a href="#box2"></a></div>
<div class="slider">
<div class="box sunset"><a href="#box1"></a></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment