Halloween Pumpkin by
Eva Lettner
On: 17 Oct 2016
Personal site: http://www.evalettner.com
<div class="container">
<div class="frame">
<div class="tombstone">
</div>
<ul class="fence">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<div class="pumpkin">
<div class="pumpkin-body">
<ul class="eyes">
<li></li>
<li></li>
</ul>
<div class="mouth"></div>
</div>
</div>
<div class="moon">
</div>
<div class="cloud"></div>
<div class="cloud2"></div>
</div>
</div>
<div class="shadow"></div>
body {
background-color: #555;
}
.container {
position: absolute;
top: 50%;
left: 50%;
margin-top: -100px;
margin-left: -100px;
}
.frame {
width: 200px;
height: 200px;
border-radius: 100%;
border: 5px solid white;
background-image: linear-gradient(to bottom, #333333 60%, #222 40%);
}
.pumpkin {
position: relative;
top: 55%;
left: 50%;
margin-left: -35px;
}
.pumpkin-body {
width: 70px;
height: 60px;
background-color: #fac331;
border-radius: 40px;
background-image: linear-gradient(to right, #fac331 50%, #d4692b 50%);
box-shadow: 0px 0px 10px 0px rgba(240, 139, 49, 0.75);
&:after{
content: "";
position: absolute;
width: 50px;
height: 60px;
left: 10px;
background-color: #ef8b31;
border-radius: 50%;
}
&:before {
content: "";
position: absolute;
height: 20px;
width: 12px;
left: 28px;
top: -18px;
background-image: linear-gradient(
to left top,
#ef8b31 50%,
transparent 50%
);
}
}
.eyes li {
list-style: none;
position: absolute;
z-index: 5;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 14px solid black;
&:first-child{
left: 16px;
top: 18px;
transform: rotate(-90deg);
}
&:nth-child(2){
top: 18px;
left: 42px;
transform: rotate(90deg);
}
}
.mouth {
position: absolute;
top: 35px;
left: 16px;
height: 19px;
width: 38px;
z-index: 5;
background-color: black;
border-radius: 0 0 38px 38px;
&:before, &:after {
content: "";
position: absolute;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 8px solid #ef8b31;
}
&:before {
left: 3px;
}
&:after {
left: 27px;
}
}
.tombstone {
position: absolute;
border-top: 60px solid #eaeaeb;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
height: 0;
width: 40px;
border-radius: 4px;
top: 80px;
left: 15px;
transform: rotate(-7deg) scale(0.9);
&:after {
content: "";
width: 46px;
height: 10px;
background-color: #777a7f;
position: absolute;
top: -2px;
left: -3px;
border-radius: 3px;
}
&:before {
content: "RIP";
width: 30px;
height: 20px;
position: absolute;
top: -45px;
left: 6px;
}
}
.fence li{
list-style: none;
position: absolute;
float: left;
background-color: #222;
width: 5px;
height: 40px;
right: 15px;
top: 90px;
&:after {
content: "";
position: absolute;
width: 5px;
height: 5px;
background-color: #222;
left: 5px;
top: 10px;
}
&:nth-child(2){
right: 25px;
}
&:nth-child(3){
right: 35px;
}
&:nth-child(4){
right: 45px;
}
}
.moon {
background-color: #f2f0e5;
width: 40px;
height: 40px;
border-radius: 100%;
position: absolute;
top: 20px;
left: 110px;
box-shadow: 0px 0px 20px 0px rgba(255, 255, 255, 0.75);
&:before, &:after {
content: "";
position: absolute;
background-color: #c3c4c7;
border-radius: 100%;
}
&:before{
height: 15px;
width: 15px;
left: 5px;
top: 7px;
}
&:after{
height: 7px;
width: 7px;
top: 24px;
left: 15px;
}
}
.cloud {
position: absolute;
top: 35px;
left: -26px;
height: 25px;
width: 50px;
background-color: white;
border-radius: 50px 50px 0 0;
animation: cloudy 20s linear infinite;
&:after {
content: "";
position: absolute;
background-color: white;
height: 15px;
width: 30px;
border-radius: 30px 30px 0 0;
left: 37px;
bottom: 0;
}
}
@keyframes cloudy{
50% {
transform: translateX(200px);
}
}
@keyframes cloudy2{
50% {
transform: translateX(-200px);
}
}
.cloud2{
position: absolute;
top: 5px;
right: -26px;
height: 15px;
width: 30px;
background-color: white;
border-radius: 30px 30px 0 0;
animation: cloudy2 38s linear infinite;
&:after {
content: "";
position: absolute;
background-color: white;
height: 7px;
width: 15px;
border-radius: 15px 15px 0 0;
left: -10px;
bottom: 0;
}
}
.shadow {
width: 208px;
height: 300px;
background-image: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 100%);
position: absolute;
left: 50%;
top: 50%;
margin-left: 0px;
margin-top: -44px;
z-index: -1;
transform: rotate(-45deg);
}
29