<a href="#chicken_1" class="chickenDiv">
<div class="chickenLeg"></div>
<div class="chickenLeg"></div>
<div class="chickenBody" id="chicken_1">
<div class="chickenHead">
<div class="chickenCrest"></div>
<div class="chickenEye"></div>
<div class="chickenEye"></div>
</div>
<div class="eggWrapper">
<div class="eggDiv"></div>
</div>
</div>
<div class="bgDiv"></div>
</a>
<a href="#chicken_2" class="chickenDiv">
<div class="chickenLeg"></div>
<div class="chickenLeg"></div>
<div class="chickenBody" id="chicken_2">
<div class="chickenHead">
<div class="chickenCrest"></div>
<div class="chickenEye"></div>
<div class="chickenEye"></div>
</div>
<div class="eggWrapper">
<div class="eggDiv"></div>
</div>
</div>
<div class="bgDiv"></div>
</a>
<a href="#chicken_3" class="chickenDiv">
<div class="chickenLeg"></div>
<div class="chickenLeg"></div>
<div class="chickenBody" id="chicken_3">
<div class="chickenHead">
<div class="chickenCrest"></div>
<div class="chickenEye"></div>
<div class="chickenEye"></div>
</div>
<div class="eggWrapper">
<div class="eggDiv"></div>
</div>
</div>
<div class="bgDiv"></div>
</a>
<p class="linkDiv">Follow me on Twitter:<a href="https://twitter.com/adircode" target="_blank">@adircode</a></p>
:root {
--sizeVar: clamp(100px, 20vw, 50vh);
}
body {
background-color: black;
overflow: hidden;
}
div,
a {
position: absolute;
}
.chickenDiv {
width: 20vw;
width: var(--sizeVar);
height: 20vw;
height: var(--sizeVar);
bottom: 20%;
left: 50%;
margin-left: -10vw;
margin-left: calc(var(--sizeVar) / -2);
animation: none 300ms linear;
}
.chickenDiv,
.chickenDiv:focus,
.chickenDiv:active {
-webkit-tap-highlight-color: transparent;
}
.bgDiv {
width: 110%;
height: 110%;
left: 0%;
top: -10%;
border-radius: 50%;
background-color: rgb(2, 0, 36);
background: linear-gradient(
0deg,
rgba(2, 0, 36, 1) 0%,
rgba(80, 9, 121, 1) 35%,
rgba(239, 0, 255, 1) 100%
);
z-index: -2;
}
.chickenDiv::after,
.chickenDiv::before {
position: absolute;
content: "";
width: 80%;
height: 15%;
left: 10%;
border-radius: 50%;
}
.chickenDiv::after {
bottom: -7%;
clip-path: polygon(0 54%, 100% 54%, 100% 100%, 0% 100%);
border-bottom: 2vw solid rgb(117, 80, 56);
border-bottom: calc(var(--sizeVar) / 10) solid rgb(117, 80, 56);
}
.chickenDiv::before {
bottom: -2%;
background-color: rgb(95, 62, 41);
}
body a:nth-of-type(2) {
left: 20%;
}
body a:nth-of-type(3) {
left: 80%;
}
.chickenBody {
width: 80%;
height: 60%;
bottom: 0;
left: 10%;
background-color: whitesmoke;
border-radius: 50% 0 50% 50%;
border-radius: 50% 50% 50% 50% / 50% 20% 80% 50%;
animation: reverseChicken 300ms linear;
animation-fill-mode: both;
pointer-events: none;
}
.chickenBody .chickenHead {
height: 50%;
width: 40%;
border-radius: 50%;
left: -15%;
top: 0;
background-color: whitesmoke;
animation: reverseHead 400ms linear;
animation-fill-mode: both;
}
.chickenBody .chickenCrest,
.chickenBody .chickenCrest::after,
.chickenBody .chickenCrest::before {
width: 30%;
height: 30%;
background-color: red;
top: -30%;
transform: translate(100%, 20%) scale(1, 1);
transform-origin: center bottom;
border-radius: 50% 50% 0 0;
z-index: -1;
}
.chickenBody .chickenCrest {
animation: reverseCrest 600ms linear;
}
.chickenBody:target .chickenCrest {
animation-name: crestAnim;
}
.chickenBody .chickenCrest::after,
.chickenBody .chickenCrest::before {
position: absolute;
content: "";
width: 100%;
height: 80%;
top: auto;
bottom: 0;
transform: rotate(25deg) translateX(60%);
}
.chickenBody .chickenCrest::before {
transform: rotate(-25deg) translateX(-60%);
}
.chickenBody .chickenHead::after {
position: absolute;
content: "";
width: 20%;
height: 20%;
top: 50%;
background-color: orange;
transform: rotate(-45deg);
border-radius: 20% 80% 50% 50% / 20% 50% 50% 80%;
}
.chickenHead .chickenEye {
width: 10%;
height: 10%;
top: 30%;
left: 5%;
border-radius: 50%;
background-color: black;
animation: eyeAnim 3000ms linear infinite;
}
.chickenHead .chickenEye:nth-of-type(2) {
left: 25%;
}
.chickenDiv:nth-of-type(2) .chickenHead .chickenEye {
animation-delay: 1000ms;
}
.chickenDiv:nth-of-type(3) .chickenHead .chickenEye {
animation-delay: 1500ms;
}
.chickenBody:target .chickenHead {
animation-name: headAnim;
}
.chickenBody:target {
animation-name: chichenAnim;
}
.chickenLeg {
width: 4%;
height: 41%;
bottom: 0;
left: 55%;
background-color: orange;
}
.chickenLeg:nth-of-type(2) {
left: 45%;
}
.eggWrapper {
width: 100%;
height: 100%;
animation: eggBlink 400ms steps(1) infinite;
animation-play-state: running;
}
.chickenBody:target .eggWrapper {
animation-play-state: paused;
}
.eggDiv {
width: 40%;
height: 50%;
left: 25%;
top: 20%;
background-color: whitesmoke;
border-radius: 20% 80% 50% 50% / 20% 50% 50% 80%;
z-index: 0;
animation: eggReverse 500ms linear 0s;
animation-fill-mode: forwards;
}
.chickenBody:target .eggDiv {
animation: eggDrop 500ms ease-in 500ms;
animation-fill-mode: forwards;
}
p {
position: absolute;
bottom: 8px;
left: 0;
width: 100%;
text-align: center;
color: whitesmoke;
font-family: sans-serif;
font-size: 1em;
}
p a {
position: relative;
color: rgba(239, 0, 255, 0.8);
margin-left: 8px;
}
@keyframes eggBlink {
0% {
visibility: hidden;
}
50% {
visibility: visible;
}
}
@keyframes chichenAnim {
0% {
bottom: 0;
height: 60%;
width: 80%;
left: 10%;
}
30% {
bottom: 0;
height: 40%;
width: 100%;
left: 0;
}
60% {
bottom: 10%;
height: 90%;
width: 60%;
left: 20%;
}
100% {
bottom: 40%;
height: 60%;
width: 80%;
left: 10%;
}
}
@keyframes reverseChicken {
0% {
bottom: 40%;
height: 60%;
width: 80%;
left: 10%;
}
30% {
bottom: 10%;
height: 90%;
width: 60%;
left: 20%;
}
60% {
bottom: 0;
height: 40%;
width: 100%;
left: 0;
}
100% {
bottom: 0;
height: 60%;
width: 80%;
left: 10%;
}
}
@keyframes headAnim {
0% {
top: 0;
}
40% {
top: 50%;
}
80% {
top: -20%;
}
100% {
top: 0;
}
}
@keyframes reverseHead {
0% {
top: 0;
}
20% {
top: -20%;
}
60% {
top: 40%;
}
100% {
top: 0;
}
}
@keyframes crestAnim {
0% {
transform: translate(100%, 20%) scale(1, 1);
}
40% {
transform: translate(100%, 20%) scale(1, 1);
}
70% {
transform: translate(100%, 20%) scale(1.2, 0.5);
}
90% {
transform: translate(100%, 20%) scale(0.8, 1.1);
}
100% {
transform: translate(100%, 20%) scale(1, 1);
}
}
@keyframes reverseCrest {
0% {
transform: translate(100%, 20%) scale(1, 1);
}
20% {
transform: translate(100%, 20%) scale(1, 1);
}
40% {
transform: translate(100%, 20%) scale(0.5, 3);
}
60% {
transform: translate(100%, 20%) scale(1, 1);
}
85% {
transform: translate(100%, 20%) scale(1.2, 0.5);
}
100% {
transform: translate(100%, 20%) scale(1, 1);
}
}
@keyframes eyeAnim {
0% {
transform: scaleY(1);
}
6% {
transform: scaleY(0.2);
}
14% {
transform: scaleY(0.2);
}
20% {
transform: scaleY(1);
}
100% {
transform: scaleY(1);
}
}
@keyframes eggDrop {
0% {
top: 20%;
transform: rotate(45deg);
}
50% {
top: 80%;
transform: rotate(45deg);
}
80% {
top: 110%;
transform: rotate(45deg);
}
90% {
top: 120%;
transform: rotate(-18deg);
}
96% {
top: 120%;
transform: rotate(8deg);
}
100% {
top: 120%;
transform: rotate(0deg);
}
}
@keyframes eggReverse {
0% {
top: 120%;
transform: rotate(0deg);
}
30% {
top: 20%;
transform: rotate(0deg);
}
100% {
top: 20%;
transform: rotate(0deg);
}
}
@media only screen and (max-width: 600px) {
:root {
--sizeVar: 20vw;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.