Last active
August 29, 2015 14:08
-
-
Save thetron/514a21aeec15ba1b688a to your computer and use it in GitHub Desktop.
Mimicking iOS's missing cover art in CSS and HTML
This file contains 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
<a href="#" class="cover"> | |
<p class="title"> | |
<span class="primary"> | |
{{title}} | |
</span> | |
{{subTitle}} | |
</p> | |
<div class="art"></div> | |
</a> |
This file contains 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
.cover{ | |
@include transform-origin(center 16px); | |
@include transform(rotate(-60deg)); | |
} |
This file contains 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
@include transform(rotate(-60deg) scale(0.5)); |
This file contains 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
.cover { | |
display: block; | |
height: 100%; | |
overflow: hidden; | |
position: relative; | |
.art { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
} | |
.title { | |
position: absolute; | |
color: #777; | |
text-transform: uppercase; | |
text-align: center; | |
font-size: 12px; | |
font-weight: normal; | |
line-height: 12px; | |
width: $book_featured_height; // not a typo | |
height: $book_featured_height; | |
left: 50%; | |
top: 50%; | |
margin-left: -$book_featured_height/2; | |
margin-top: -16px; | |
.primary { | |
display: block; | |
font-size: 16px; | |
font-weight: bold; | |
line-height: 16px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment