A frying pan dips, flicks and tosses a pancake that spins through the air and lands back with a squash. Anticipation, overshoot and a catch make it feel like a real flip.
Also known as: cooking loader, pancake flip animation, food cooking loader css.
<div class="ldr-frying-pan" role="status" aria-label="Cooking"> <span class="ldr-frying-pan-cake"></span> <span class="ldr-frying-pan-pan"></span> </div>
.ldr-frying-pan {
--s: var(--ldr-size, 48px);
--c: var(--ldr-color, #3b82f6);
position: relative;
width: calc(var(--s) * 1.3);
height: var(--s);
}
.ldr-frying-pan-pan {
position: absolute;
left: 36%;
bottom: 18%;
width: 56%;
height: 17%;
border-radius: 0 0 50% 50% / 0 0 100% 100%;
background: var(--c);
transform-origin: -40% 20%;
animation: ldr-frying-pan-toss 1.8s infinite;
}
.ldr-frying-pan-pan::before {
content: "";
position: absolute;
right: 96%;
top: 8%;
width: 66%;
height: calc(var(--s) / 11);
border-radius: var(--s);
background: var(--c);
transform: rotate(-6deg);
transform-origin: 100% 50%;
}
.ldr-frying-pan-cake {
position: absolute;
left: 42%;
bottom: 35%;
width: 44%;
height: calc(var(--s) / 8);
border-radius: 50%;
background: color-mix(in srgb, var(--ldr-color, #3b82f6) 60%, transparent);
animation: ldr-frying-pan-flip 1.8s infinite;
}
@keyframes ldr-frying-pan-toss {
0%, 10% { transform: rotate(0); }
18% { transform: rotate(5deg); }
25% { transform: rotate(-12deg); }
36% { transform: rotate(0); }
68% { transform: rotate(0); }
73% { transform: rotate(4deg); }
82%, 100% { transform: rotate(0); }
}
@keyframes ldr-frying-pan-flip {
0%, 12% { transform: translateY(0) rotate(0); }
19% { transform: translateY(calc(var(--s) * 0.04)) rotate(0); animation-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1); }
45% { transform: translateY(calc(var(--s) * -0.5)) rotate(-190deg); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
70% { transform: translateY(0) rotate(-360deg) scale(1, 1); }
74% { transform: translateY(calc(var(--s) * 0.02)) rotate(-360deg) scale(1.1, 0.7); }
82%, 100% { transform: translateY(0) rotate(-360deg) scale(1, 1); }
}
@media (prefers-reduced-motion: reduce) {
.ldr-frying-pan, .ldr-frying-pan *, .ldr-frying-pan::before, .ldr-frying-pan::after, .ldr-frying-pan *::before, .ldr-frying-pan *::after {
animation-duration: 3s;
}
}--ldr-color on the element or a parent.
Currently previewing #3b82f6.--ldr-size. Every dimension in the snippet is
derived from it. Currently previewing 64px.animation shorthand.
Delays on the children are relative, so they keep their rhythm.role="status" and an
aria-label so screen readers announce the wait. The reduced-motion rule
at the end slows the animation for users who asked for less motion.