Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created October 5, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/d9db8c71ebfbb550c8a0 to your computer and use it in GitHub Desktop.
Save chuck0523/d9db8c71ebfbb550c8a0 to your computer and use it in GitHub Desktop.
$border: #eee 2px dashed;
$nameList: belt1, belt2, belt3, belt4;
$colorList: #3f171d, #573121, #774635, #b20008;
$degList: 15deg, -15deg, 25deg, -10deg;
$translateList: 0vh, -10vh, 50vh, 40vh;
body {
background-color: #eee;
overflow: hidden;
background-image: url('bg.jpg');
-webkit-background-size: cover;
background-size: cover;
& div {
@each $class in $nameList {
$index : index($nameList, $class);
&.#{$class} {
box-sizing: border-box;
margin-left: -200%;
padding-top: 10px;
width: 500%;
height: 100px;
background-color: nth($colorList, $index);
box-shadow: 5px 5px 5px 1px rgba(0, 0, 0, .4);
-webkit-transform: translate(0, nth($translateList, $index)) rotateZ(nth($degList, $index));
transform: translate(0, nth($translateList, $index)) rotateZ(nth($degList, $index));
&:after {
content: "";
display: block;
height: 80px;
border-top: $border;
border-bottom: $border;
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment