Created
November 13, 2015 17:33
-
-
Save una/8a24c4f559722c97a102 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
<div class="tomatoes"></div> |
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
// ---- | |
// Sass (v3.4.14) | |
// Compass (v1.0.3) | |
// ---- | |
@mixin three-dee($img, $dist: 5px, $deg: 5deg, $width: 100%, $height: 500px) { | |
z-index: 1; | |
width: $width; | |
height: $height; | |
position: relative; | |
transform: rotateY($deg); | |
perspective: $width; | |
background: url('#{$img}'), cyan; | |
background-blend-mode: lighten; | |
background-size: cover; | |
&:after { | |
content: ''; | |
position: absolute; | |
display: block; | |
width: $width; | |
height: $height; | |
z-index: 2; | |
perspective: -$width; | |
margin-left: $dist; | |
transform: rotateY(-$deg/2); | |
background: url('#{$img}'), red; | |
background-blend-mode: lighten; | |
background-size: cover; | |
mix-blend-mode: darken; | |
} | |
} | |
.tomatoes { | |
@include three-dee('https://upload.wikimedia.org/wikipedia/commons/3/30/Rubik_cube.png', 5px, 10deg, 400px, 400px); | |
} |
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
.tomatoes { | |
z-index: 1; | |
width: 400px; | |
height: 400px; | |
position: relative; | |
transform: rotateY(10deg); | |
perspective: 400px; | |
background: url("https://upload.wikimedia.org/wikipedia/commons/3/30/Rubik_cube.png"), cyan; | |
background-blend-mode: lighten; | |
background-size: cover; | |
} | |
.tomatoes:after { | |
content: ''; | |
position: absolute; | |
display: block; | |
width: 400px; | |
height: 400px; | |
z-index: 2; | |
perspective: -400px; | |
margin-left: 5px; | |
transform: rotateY(-5deg); | |
background: url("https://upload.wikimedia.org/wikipedia/commons/3/30/Rubik_cube.png"), red; | |
background-blend-mode: lighten; | |
background-size: cover; | |
mix-blend-mode: darken; | |
} |
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
<div class="tomatoes"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment