A Pen by The Rye Agency on CodePen.
Created
April 25, 2016 07:46
-
-
Save anonymous/8073b7de1291a28c832c6630abef9bc2 to your computer and use it in GitHub Desktop.
ONwBpO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
<div class="overlay"> | |
<a href="#" class="overlay__title">Little teaser about the content</a> | |
<div class="overlay__content"> | |
<div class="overlay__inner"> | |
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> | |
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> | |
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> | |
</div> | |
</div> | |
</div> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$('.overlay__title').click(function(e) { | |
e.preventDefault(); | |
$('.overlay').toggleClass('overlay--active'); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$colour: #7736B0; | |
$padding: 15px; | |
body { | |
font-family: sans-serif; | |
} | |
* { | |
box-sizing: border-box; | |
} | |
.overlay { | |
position: fixed; | |
bottom: 0; | |
right: 20px; | |
width: 300px; | |
border: $colour 3px solid; | |
border-bottom: 0; | |
border-radius: 4px 4px 0 0; | |
box-shadow: rgba(0,0,0,0.2) 0 -2px 20px; | |
&__title { | |
text-decoration: none; | |
display: block; | |
background: $colour; | |
color: #fff; | |
padding: $padding; | |
position: relative; | |
&::after { | |
content: "➜"; | |
position: absolute; | |
transform: rotate(-90deg); | |
top: $padding; | |
right: $padding; | |
transition: all 0.3s ease-in-out; | |
} | |
.overlay--active &::after { | |
transform: rotate(90deg); | |
} | |
} | |
&__content { | |
height: 0px; | |
overflow: hidden; | |
transition: height 0.3s ease-in-out; | |
.overlay--active & { | |
height: 300px; | |
} | |
} | |
&__inner { | |
padding: $padding; | |
height: 100%; | |
overflow: scroll; | |
} | |
/* Small Screens */ | |
@media only screen and (max-width: 736px) { | |
width: 100%; | |
right: 0; | |
border-radius: 0; | |
&--active .overlay__content { | |
height: 80vh; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment