Есть div (один, это важно) и css. Сделать золотое яйцо.
Контейнер
Код:
.box {
display: inline-block;
width: 256px;
height: 320px;
background: orange;
border-radius: 60%/70% 70% 50% 50%;
}
Текстура
Код:
.gold-zoom {
background:
linear-gradient(to top right, orange 12%, transparent 0%, transparent 88%, orange 0%),
linear-gradient(to bottom right, transparent 37%, yellow 0%, yellow 63%, transparent 0%),
linear-gradient(to top right, transparent 37%, orange 0%, orange 63%, transparent 0%) red;
background-size: 256px 320px;
}
.gold {
background:
linear-gradient(to top right, orange 12%, transparent 0%, transparent 88%, orange 0%),
linear-gradient(to bottom right, transparent 37%, yellow 0%, yellow 63%, transparent 0%),
linear-gradient(to top right, transparent 37%, orange 0%, orange 63%, transparent 0%) red;
background-size: 3px 3.75px;
}
Свет
Код:
.sunrise {box-shadow: inset -160px -160px 192px -48px #444, -1px -16px 64px -32px orange;}
.sunset {box-shadow: inset 160px -160px 192px -48px #444, 1px -16px 64px -32px orange;}
.noon {box-shadow: inset 0px -80px 192px -0px #444, 0px -32px 80px -24px orange;}
.midnight {box-shadow: inset 0px 0px 256px 256px #444, 0px -32px 80px -24px orange;}
Крутим
Код:
.roll {
transform-origin: bottom;
animation: 6s linear 0s infinite normal roll;
}
@keyframes roll {
from {box-shadow: inset -320px -160px 192px -48px #444, 0px -16px 80px -32px orange;}
50% {box-shadow: inset 320px -80px 192px 0px #444, 0px -32px 80px -24px orange;}
to {box-shadow: inset -320px -160px 192px 416px #444, 0px -16px 80px -32px orange;}
}
Вертим
Код:
.rock {
transform-origin: bottom;
animation: 6s ease 0s infinite normal rock;
}
@keyframes rock {
from {transform: rotate3d(1, 1, 1, -3deg);}
50% {transform: rotate3d(1, 1, 1, 3deg);}
to {transform: rotate3d(1, 1, 1, -3deg);}
}
И все вместе
Код:
.egg {
display: inline-block;
width: 256px;
height: 320px;
background: orange;
border-radius: 60%/70% 70% 50% 50%;
background:
linear-gradient(to top right, orange 12%, transparent 0%, transparent 88%, orange 0%),
linear-gradient(to bottom right, transparent 37%, yellow 0%, yellow 63%, transparent 0%),
linear-gradient(to top right, transparent 37%, orange 0%, orange 63%, transparent 0%) red;
background-size: 3px 3.75px;
transform-origin: bottom;
animation: 6s linear 0s infinite normal egg;
}
@keyframes egg {
from {
transform: rotate3d(1, 1, 1, -3deg);
box-shadow: inset -320px -160px 192px -48px #444, 0px -16px 80px -32px orange;
}
50% {
transform: rotate3d(1, 1, 1, 3deg);
box-shadow: inset 320px -80px 192px 0px #444, 0px -32px 80px -24px orange;
}
to {
transform: rotate3d(1, 1, 1, -3deg);
box-shadow: inset -320px -160px 192px 416px #444, 0px -16px 80px -32px orange;
}
}