Skip to content

Instantly share code, notes, and snippets.

@cochrancj
Created January 31, 2017 23:01
Show Gist options
  • Save cochrancj/4f47f4cedf1a581bedf0e6b9fe42570f to your computer and use it in GitHub Desktop.
Save cochrancj/4f47f4cedf1a581bedf0e6b9fe42570f to your computer and use it in GitHub Desktop.
#dailycssimages 14 - Cheesecake
<div class="container">
<div class="cheesecake">
<div class="top-crust"></div>
<div class="crust"></div>
<div class="cheesecake-top"></div>
<div class="cheesecake-side"></div>
</div>
<div class="cherries">
<span class="cherry"></span>
<span class="cherry"></span>
<span class="cherry"></span>
</div>
<div class="left-eye"></div>
<div class="left-eye-shine-large"></div>
<div class="left-eye-shine-small"></div>
<div class="right-eye"></div>
<div class="right-eye-shine-large"></div>
<div class="right-eye-shine-small"></div>
<div class="left-cheek"></div>
<div class="right-cheek"></div>
<div class="mouth"></div>
</div>
// Source: https://i.ytimg.com/vi/BOMS5834O_c/maxresdefault.jpg
* {
box-sizing: border-box;
}
body {
background-color: salmon;
}
.container {
position: absolute;
margin-left: 5em;
margin-top: 5em;
}
.top-crust {
border: 2em solid burlywood;
border-radius: 80%;
min-width: 2em;
min-height: 12em;
position: absolute;
z-index: 1;
transform: rotate(10deg);
border-right-color: transparent;
border-bottom-color: transparent;
border-top-color: transparent;
margin-left: 5.1em;
margin-top: -2em;
}
.crust {
border-bottom: 1.2em solid burlywood;
border-left: 0.5em solid burlywood;
width: 14.4em;
height: 10em;
transform: rotate(-5deg);
position: absolute;
z-index: 1;
margin-top: 7em;
margin-left: 5.5em;
}
.cheesecake-top {
width: 0;
height: 0;
border-left: 75px solid transparent;
border-right: 75px solid transparent;
border-top: 230px solid #F4E2D0;
-moz-border-radius: 25%;
-webkit-border-radius: 25%;
border-radius: 25%;
position: absolute;
z-index: 0;
transform: rotate(-77deg);
margin-left: 7.8em;
margin-top: -1.8em;
}
.cheesecake-side {
width: 14.3em;
height: 9em;
background-color: #F4E2D0;
position: absolute;
z-index: 0;
transform: rotate(-5deg);
margin-left: 5.5em;
margin-top: 7.5em;
border-top: 1px solid snow;
}
.cheesecake {
transform: rotate(5deg);
}
.cherries {
margin-left: 1em;
}
.cherry {
width: 2em;
height: 2em;
background-color: darkred;
position: absolute;
z-index: 2;
border-radius: 50%;
}
.cherry:nth-child(1) {
margin-left: 8em;
margin-top: 3em;
}
.cherry:nth-child(2) {
margin-left: 10em;
margin-top: 3em;
}
.cherry:nth-child(3) {
margin-left: 9em;
margin-top: 4.5em;
}
.left-eye {
width: 2.5em;
height: 2.5em;
background-color: black;
position: absolute;
z-index: 2;
border-radius: 50%;
margin-top: 10em;
margin-left: 7.5em;
}
.left-eye-shine-large {
width: 1em;
height: 1em;
background-color: snow;
position: absolute;
z-index: 2;
border-radius: 50%;
margin-top: 10.3em;
margin-left: 7.9em;
}
.left-eye-shine-small {
width: 0.5em;
height: 0.5em;
background-color: snow;
position: absolute;
z-index: 2;
border-radius: 50%;
margin-top: 11.3em;
margin-left: 9em;
}
.right-eye {
width: 2.5em;
height: 2.5em;
background-color: black;
position: absolute;
z-index: 2;
border-radius: 50%;
margin-top: 10em;
margin-left: 12.5em;
}
.right-eye-shine-large {
width: 1em;
height: 1em;
background-color: snow;
position: absolute;
z-index: 2;
border-radius: 50%;
margin-top: 10.3em;
margin-left: 12.9em;
}
.right-eye-shine-small {
width: 0.5em;
height: 0.5em;
background-color: snow;
position: absolute;
z-index: 2;
border-radius: 50%;
margin-top: 11.3em;
margin-left: 14em;
}
.left-cheek {
width: 2.5em;
height: 2.5em;
background-color: pink;
position: absolute;
z-index: 2;
border-radius: 50%;
margin-top: 13em;
margin-left: 5.5em;
box-shadow: -2px -2px 2px rgba(255,192,103,0.6);
}
.right-cheek {
width: 2.5em;
height: 2.5em;
background-color: pink;
position: absolute;
z-index: 2;
border-radius: 50%;
margin-top: 13em;
margin-left: 14.5em;
box-shadow: 2px -2px 2px rgba(255,192,103,0.6);
}
.mouth {
width: 1em;
height: 1em;
background-color: black;
position: absolute;
z-index: 2;
border-radius: 50%;
margin-top: 14em;
margin-left: 10.5em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment