Rubber Duck animation-timeline

Scroll to write the duck

Delete it all

duck.css

/* duck.css */ .bath { background: #dcedf0; } .duck > * { position: absolute; } .tail { inset: 26% 76% 44% 1%; background: #f2b100; border-radius: 0 50% 50% 50%; rotate: 8deg; } .body { inset: 37.5% 12% 0 2%; background: #ffd21f; border-radius: 45% 50% 50% 50% / 55% 60% 40% 45%; box-shadow: inset -1.2em -1em 1.4em #e69500, inset 0.6em 0.8em 1em #fff3a6; } .wing { inset: 50% 44% 22.5% 22%; background: #f7b500; border-radius: 10% 70% 60% 50%; rotate: -10deg; } .head { inset: 2.5% 14% 47.5% 46%; background: #ffd21f; border-radius: 50%; box-shadow: inset -0.9em -0.7em 1em #e69500, inset 0.5em 0.5em 0.8em #fff3a6; } .eye { inset: 15% 25% 76% 68%; background: radial-gradient(circle at 35% 30%, #fff 18%, #161616 22%); border-radius: 50%; } .beak { inset: 25% 80% 61% 0;0 61% 80%; background: #ff8a1f; border-radius: 30% 80% 80% 30% / 50%; } .water { inset: 64% 0 0; background: #3a9fd0b0; box-shadow: inset 0 0.3em #ffffff70; } .duck { animation: bob 3s ease-in-out infinite; } @keyframes bob { 50% { translate: 0 -0.3em; rotate: -2deg; } }

Preview

This browser can't run animation-timeline yet, so the file is already written and the duck is done.