Penguin by

Vili

On: 9 Jun 2016

<div id="container">
  <div id="penguin">
    <div id="body">
      <div id="tummy"></div>
      <div id="bandana">
        <div id="moon-box">
          <div id="plate"></div>
        </div>
      </div>
      <div id="lWing"></div>
      <div id="rWing"></div>
      <div id="beak"></div>
      <div id="lEye">
        <div id="iris"></div>
      </div>
      <div id="rEye">
        <div id="iris"></div>
      </div>
      <div id="lLeg"></div>
      <div id="rLeg"></div>
    </div>
  </div>
  <div id="pacman">
    <div id="pacEye"></div>
  </div>
</div>
#container {
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(deepskyblue,lime);
  height: 100vh;
  width: 100vw;
}

:root {
  --penH: 30vmin;
  --penW: 15vmin;
  --rad: 13vmin;
  --push: 40vmin;
  --aLen: 5vmin;
}

#penguin {
  position: relative;
  top: var(--push);
  left: -30vmin;
  height: var(--penH);
  width: var(--penW);
  animation-name: flip;
  animation-duration: 6s;
  animation-delay: 0s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

#body {
  background: black;
  position: absolute;
  height: 100%;
  width: 100%;
  border-radius: 30%;
}

#bandana {
  background: #0c2fdf;
  position: absolute;
  top: 1%;
  left: 4%;
  height: 12%;
  width: 92%;
  border-radius: 33%; 
}

#moon-box {
  position: absolute;
  left: 40%;
  width: 25%;
  height: 100%;
}

#plate {
  background: #cccccc;
  position: absolute;
  top: 10%;
  left: -50%;
  height: 80%;
  width: 200%;
  border-radius: 10%;
  text-align: center;
  font-size: 2.6vmin;
}
#plate:after {
  content: "~JA~";
}

#tummy {
  background: white;
  position: absolute;
  top: 10%;
  left: 21%;
  height: 85%;
  width: 70%;
  border-radius: 40%;
}

#lWing {
  position: absolute;
  top: 43%;
  left: 18%;
  width: 0; 
  height: 0; 
  border-right: var(--aLen) solid transparent;
  border-bottom: var(--aLen) solid black;
}

#rWing {
  position: absolute;
  top: 43%;
  left: 97%;
  width: 0; 
  height: 0; 
  border-right: var(--aLen) solid transparent;
  border-bottom: var(--aLen) solid black;
}

#beak {
  position: absolute;
  top: 25%;
  left: 55%;
  width: 0; 
  height: 0;
  border-right: 5vmin solid transparent;
  border-bottom: 2vmin solid orange;
}

#lEye {
  background: black;
  position: absolute;
  top: 15%;
  left: 36%;
  height: 10%;
  width: 20%;
  border-radius: 50%;
}

#rEye {
  background: black;
  position: absolute;
  top: 15%;
  left: 60%;
  height: 10%;
  width: 20%;
  border-radius: 50%;
}

#iris {
  background: white;
  position: absolute;
  top: 25%;
  left: 50%;
  height: 30%;
  width: 30%;
  border-radius: 50%;
}

#lLeg {
  background: orange;
  position: absolute;
  top: 96%;
  left: 24%;
  height: 10%;
  width: 30%;
  border-radius: 35%;
  animation-name: runL;
  animation-duration: 0.4s;
  animation-delay: 0s;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}

#rLeg {
  background: orange;
  position: absolute;
  top: 96%;
  left: 60%;
  height: 10%;
  width: 30%;
  border-radius: 35%;
  animation-name: runR;
  animation-duration: 0.4s;
  animation-delay: 0s;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}

#pacman {
  position: absolute;
  top: 45vmin;
  left: 90vmin;
  height: 0;
  width: 0;
  border-right: var(--rad) solid yellow;
  border-top: var(--rad) solid yellow;
  border-left: var(--rad) solid transparent;
  border-bottom: var(--rad) solid yellow;
  border-top-left-radius: var(--rad) ;
  border-top-right-radius: var(--rad);
  border-bottom-left-radius: var(--rad) ;
  border-bottom-right-radius: var(--rad);
  animation-name: nom;
  animation-duration: 0.5s;
  animation-delay: 1s;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}

#pacEye {
  background: black;
  position: absolute;
  bottom: 6vmin;
  right: 1vmin;
  height: 3vmin;
  width: 3vmin;
  border-radius: 50%;
}

@keyframes flip {
   0% { top: var(--push); left: -100vmin; }
  30% { top: var(--push); left: 45vmin; 
  transform: rotate(0deg); }
  50% { top: 2vmin; }
  70% { top: var(--push); left: 135vmin;
  transform: rotate(360deg); }
  100% { top: var(--push); left: 250vmin;
  transform: rotate(360deg); }
}

@keyframes runL {
  25% { top: 100%; }
  75% { top: 92%; }
}

@keyframes runR {
  25% { top: 92%; }
  75% { top: 100%; }
}

@keyframes nom {
  50% { border-left-color: yellow; }
}

24