Penguin by
Stefan
On: 16 Jun 2016
Personal site: http://www.smarinov.com/
<h1>Hello, I am a penguin!</h1>
<h2>Please don't touch me!</h2>
<div class="penguin">
<div class="head circle"></div>
<div class="beak circle"></div>
<div class="sound">
<div id="arcs">
<div>
<div>
<div>
<div></div>
</div>
</div>
</div>
</div>
</div>
<div class="eye circle">
<div class="pupil circle"></div>
</div>
<div class="body circle">
<div class="belly circle"></div>
<div class="wing circle"></div>
</div>
<div class="outline circle"></div>
<div class="feet circle"></div>
</div>
body { background-color: white; }
h1 {
color: black;
font-size: large;
margin-top: -0.3em;
}
h2 {
color: darkgreen;
font-size: smaller;
margin-top: -1em;
}
.circle {
border-radius: 50%;
display: inline-block;
}
.penguin {
width: 180px;
height: 285px;;
position: relative;
margin-left: 25px;
}
.penguin .head {
background: black;
width: 80px;
height: 80px;
position: absolute;
margin-left: 50px;
}
.penguin .beak {
background: orange;
border-radius: 70% 10% 10% 50%;
width: 20px;
height: 15px;
position: absolute;
margin-top: 50px;
margin-left: 40px;
}
.penguin .eye {
background: lightgray;
width: 20px;
height: 20px;
position: absolute;
margin-top: 20px;
margin-left: 65px;
}
.penguin .pupil {
background: black;
width: 70%;
height: 70%;
position: relative;
margin-top: 20%;
margin-left: 7%;
}
.penguin .body {
background: black;
width: 100px;
height: 200px;
position: absolute;
margin-left: 40px;
margin-top: 80px;
}
.penguin .belly {
background: white;
width: 50%;
height: 70%;
position: relative;
margin-top: 40%;
margin-left: -10%;
}
.penguin .wing {
background: black;
border: 1px solid lightgray;
border-top-color: transparent;
width: 40%;
height: 70%;
position: relative;
margin-left: -15%;
}
.penguin .outline {
background: transparent;
border: 1px solid black;
width: 98px;
height: 198px;
position: absolute;
margin-left: 40px;
margin-top: 80px;
}
.penguin .feet {
background: orange;
border-radius: 70% 50% 20% 40%;
width: 30px;
height: 20px;
position: absolute;
margin-left: 60px;
margin-top: 265px;
}
.penguin .sound {
position: absolute;
margin-top: 15px;
margin-left: 10px;
}
#arcs div {
/* Modified from: https://stackoverflow.com/questions/16470412/ */
border: 2px solid transparent;
border-radius: 50%;
display: inline-block;
min-width: 30px;
min-height: 30px;
padding: 5px;
position: relative;
}
.penguin:hover {
-moz-transform: scale(-1, 1);
-webkit-transform: scale(-1, 1);
-o-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
transform: scale(-1, 1);
}
.penguin:hover .head { background: darkblue; }
.penguin:hover .beak { background: firebrick; }
.penguin:hover .pupil { background: red; }
.penguin:hover .body { background: darkblue; }
.penguin:hover .wing { background: darkblue; }
.penguin:hover .outline { border-color: darkblue; }
.penguin:hover .feet { background: firebrick; }
.penguin:hover #arcs div { border-left-color: red; }
20