Skip to content

Instantly share code, notes, and snippets.

@meramos
Created December 20, 2020 17:40
Show Gist options
  • Select an option

  • Save meramos/df9c1ec1bd42e3e1c9718629e4e4ae3f to your computer and use it in GitHub Desktop.

Select an option

Save meramos/df9c1ec1bd42e3e1c9718629e4e4ae3f to your computer and use it in GitHub Desktop.
Full style.scss style sheet for dressup game.
#container{
position: absolute;
margin:auto;
width: 1000px;
height: 1123px;
}
#body{
position:absolute;
width:794px; /* width of actual image */
height:1123px; /* height of actual image */
background-image: url("../img/body.png");
background-repeat: no-repeat;
}
#background{
bottom: 1246px;
right: 1119px;
position: absolute;
}
#eyes, #ears, #nose, #mouth, #clothes{
position:absolute;
width:794px; /* width of actual image */
height:1123px; /* height of actual image */
}
// update this map when new items or categories are added
$items: ("eyes": 9, "ears": 3, "mouth": 4, "nose": 3, "clothes": 3);
@each $item, $total in $items {
@for $i from 1 through $total {
.#{$item}#{$i} {
background-image: url(../img/#{$item}/#{$item}#{$i}.png);
}
}
}
// Position "next" buttons
$height: 410px;
@each $item, $total in $items {
$height: $height + 30px;
#next#{$item}{
position:absolute;
left:600px;
top: $height;
}
}
// Position "randomize" button
#randomize{
position:absolute;
left:600px;
top:600px;
font-weight: bold;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment