Created
February 20, 2017 21:33
-
-
Save sergiu-radu/3f7780dd4fa39c54c2198aa20da4080b to your computer and use it in GitHub Desktop.
Creative Dissection Puzzles with CSS and SVG
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
$figures: ( | |
('pentagon', $pentagon-transform, '../img/face-1.jpg'), | |
('hexagon', $hexagon-transform, '../img/face-2.jpg'), | |
('octagon', $octagon-transform, '../img/face-3.jpg'), | |
); | |
@each $figure in $figures { | |
$name: nth($figure, 1); | |
$transform: nth($figure, 2); | |
$image: nth($figure, 3); | |
.clip-#{$name} .clip { | |
background-image: url('#{$image}'); | |
@for $i from 1 through length($transform) { | |
&:nth-child(#{$i}) { | |
clip-path: url('../##{$name}-#{$i}'); | |
transform: nth($transform, $i); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment