<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Siva Ranchani</title>
    <description>The latest articles on DEV Community by Siva Ranchani (@siva_ranchani_aa4aa7a30cc).</description>
    <link>https://dev.to/siva_ranchani_aa4aa7a30cc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4108174%2F119ca2d1-b7d9-485e-bb01-4dae54168db4.jpeg</url>
      <title>DEV Community: Siva Ranchani</title>
      <link>https://dev.to/siva_ranchani_aa4aa7a30cc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/siva_ranchani_aa4aa7a30cc"/>
    <language>en</language>
    <item>
      <title>How to Build an Animated CSS Penguin: A Step-by-Step Guide #html5 #css3 #animation #Responsive web design</title>
      <dc:creator>Siva Ranchani</dc:creator>
      <pubDate>Thu, 03 Sep 2026 15:00:20 +0000</pubDate>
      <link>https://dev.to/siva_ranchani_aa4aa7a30cc/how-to-build-an-animated-css-penguin-a-step-by-step-guide-html5-css3-animation-responsive-web-3hjb</link>
      <guid>https://dev.to/siva_ranchani_aa4aa7a30cc/how-to-build-an-animated-css-penguin-a-step-by-step-guide-html5-css3-animation-responsive-web-3hjb</guid>
      <description>&lt;p&gt;**While completing the freeCodeCamp Responsive Web Design Certification, I built an interactive penguin mascot to master pure CSS styling, positional layout techniques, and keyframe animations.&lt;/p&gt;

&lt;p&gt;In this tutorial, I'll walk you through the end-to-end process of structuring the HTML elements, applying custom styles, and creating a waving animation using pure CSS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Project Overview &amp;amp; Interactive Demo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before diving into the code, you can view and test the complete live code directly on my CodePen:&lt;/p&gt;

&lt;p&gt;Live Demo: &lt;a href="https://codepen.io/editor/Siva-Ranchani/pen/01a067b1-27e2-712b-9d65-d0c674b3eee5" rel="noopener noreferrer"&gt;View my Penguin Project on CodePen&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Building the HTML Foundation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The penguin is composed of semantic div elements representing the head, facial features, body, heart badge, and arms.&lt;/p&gt;

&lt;p&gt;HTML&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I &amp;lt;span&amp;gt;♥&amp;lt;/span&amp;gt; CSS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Positioning and Background Gradients&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To create the vibrant background seen in the preview, we use CSS linear gradients across a multi-layered canvas:&lt;/p&gt;

&lt;p&gt;CSS&lt;br&gt;
/* Background environment layout */&lt;br&gt;
body {&lt;br&gt;
  background: linear-gradient(90deg, rgb(88, 175, 236), rgb(182, 255, 255));&lt;br&gt;
  margin: 0;&lt;br&gt;
  padding: 0;&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;/* Parent container setup */&lt;br&gt;
.penguin {&lt;br&gt;
  position: relative;&lt;br&gt;
  margin: 0 auto;&lt;br&gt;
  width: 200px;&lt;br&gt;
  height: 200px;&lt;br&gt;
  z-index: 3;&lt;br&gt;
}&lt;br&gt;
Using position: relative on .penguin creates an anchor frame. Every child element inside (like the eyes, beak, and arms) can then be placed precisely using position: absolute.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Crafting the Keyframe Wave Animation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To animate the penguin waving its arm smoothly back and forth, we define a @keyframes sequence and anchor the arm's rotational pivot point using transform-origin.&lt;/p&gt;

&lt;p&gt;CSS&lt;br&gt;
/* Define keyframe rotation */&lt;br&gt;
@keyframes wave {&lt;br&gt;
  0% {&lt;br&gt;
    transform: rotate(0deg);&lt;br&gt;
  }&lt;br&gt;
  50% {&lt;br&gt;
    transform: rotate(110deg);&lt;br&gt;
  }&lt;br&gt;
  100% {&lt;br&gt;
    transform: rotate(0deg);&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;/* Apply animation to the arm &lt;em&gt;/&lt;br&gt;
.arm.right {&lt;br&gt;
  position: absolute;&lt;br&gt;
  top: 10%;&lt;br&gt;
  left: 5%;&lt;br&gt;
  /&lt;/em&gt; Set shoulder joint pivot point */&lt;br&gt;
  transform-origin: 0% 0%; &lt;br&gt;
  animation: wave 3s infinite ease-in-out;&lt;br&gt;
}&lt;br&gt;
By default, CSS elements rotate around their middle (50% 50%). Setting transform-origin: 0% 0% locks the rotation to the top-left shoulder, allowing the arm to swing naturally instead of spinning in place.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Summary &amp;amp; Key Takeaways&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Layering with z-index: Controls feature stacking order so eyes and beak sit cleanly above face shapes.&lt;/p&gt;

&lt;p&gt;Transform Origins: Crucial for setting realistic joints and motion paths for 2D CSS animations.&lt;/p&gt;

&lt;p&gt;Timing Functions: ease-in-out creates organic acceleration and deceleration during animation cycles.&lt;/p&gt;

&lt;p&gt;About the Author&lt;/p&gt;

&lt;p&gt;I am a MERN Stack Developer focused on building responsive, performant, and user-centric web applications. Currently expanding her skills through freeCodeCamp certifications, she specializes in clean CSS architecture, React UI components, and full-stack API integration.&lt;/p&gt;

&lt;p&gt;i am available for remote frontend development roles, technical writing, and freelance projects.&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>html</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
