<?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: Abu Sofian</title>
    <description>The latest articles on DEV Community by Abu Sofian (@abusofianid).</description>
    <link>https://dev.to/abusofianid</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3502059%2Fee0ed4ba-c713-4f50-b717-144f473a63e9.jpg</url>
      <title>DEV Community: Abu Sofian</title>
      <link>https://dev.to/abusofianid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abusofianid"/>
    <language>en</language>
    <item>
      <title>The Friendly Floating Ghost</title>
      <dc:creator>Abu Sofian</dc:creator>
      <pubDate>Sat, 01 Nov 2025 08:36:18 +0000</pubDate>
      <link>https://dev.to/abusofianid/floating-ghost-halloween-55de</link>
      <guid>https://dev.to/abusofianid/floating-ghost-halloween-55de</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/frontend-2025-10-15"&gt;Frontend Challenge - Halloween Edition, CSS Art&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;👻 The Friendly Floating Ghost.&lt;br&gt;
Hello, Everyone! Here is my submission for the CSS Art: Halloween Challenge.&lt;br&gt;
I wanted to create a design that was clean, simple, and captured a classic Halloween spirit. This is my "Friendly Floating Ghost," created entirely with HTML and CSS.&lt;br&gt;
You can view the live demo here: &lt;a href="https://codepen.io/abusofianid/pen/LEGgLpb" rel="noopener noreferrer"&gt;https://codepen.io/abusofianid/pen/LEGgLpb&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Key Features &amp;amp; CSS Techniques&lt;br&gt;
My main goal was to bring the ghost to life using only CSS animations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Effective Use of CSS (Animation):

&lt;ul&gt;
&lt;li&gt;Main Float Effect: The ghost's entire body gently floats up and down using a @keyframes animation (float) with ease-in-out timing for a smooth, spooky hover effect.&lt;/li&gt;
&lt;li&gt;Dynamic Wavy Bottom: The "tail" of the ghost isn't just one static shape. It's made of four separate div elements. Each one has its own wave animation, but I used animation-delay on them at different intervals. This makes them bob up and down unevenly, creating a much more fluid and realistic "waving" motion.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Creativity &amp;amp; Aesthetic (The Shape):

&lt;ul&gt;
&lt;li&gt;The ghost's shape is built using border-radius in different ways: a large value creates the perfectly round head, while a different border-radius setting on the mouth creates the simple, hollow "O" shape.&lt;/li&gt;
&lt;li&gt;The design is intentionally minimal and uses high contrast (a white ghost on a dark purple background) for a clean and clear aesthetic outcome.
I had a lot of fun on this challenge and focused on making the CSS animations the star of the show. I hope you enjoy it!
Complete Code (HTML + CSS)
Here is the complete code. You can copy and paste this into a single file (e.g., ghost.html) and open it in any browser.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;Floating Ghost&amp;lt;/title&amp;gt;
    &amp;lt;style&amp;gt;
        /* Scene Setup */
        body {
            background-color: #0d001a; /* Very dark purple */
            display: grid;
            place-items: center;
            min-height: 100vh;
            margin: 0;
            overflow: hidden;
        }

        /* Ghost Body */
        .ghost {
            position: relative;
            width: 150px;
            height: 200px;
            background-color: #f0f0f0; /* Off-white */

            /* Creates the rounded head */
            border-radius: 75px 75px 0 0;

            /* Adds the floating animation */
            animation: float 3s ease-in-out infinite;

            /* Shadow for a slight 3D effect */
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        }

        /* Ghost Eyes */
        .ghost-eyes {
            position: absolute;
            top: 60px;
            width: 100%;
            display: flex;
            justify-content: space-around;
        }

        .eye {
            width: 25px;
            height: 25px;
            background-color: #222;
            border-radius: 50%;
        }

        /* Ghost Mouth */
        .ghost-mouth {
            position: absolute;
            top: 100px;
            left: 50%;
            transform: translateX(-50%);
            width: 40px;
            height: 20px;
            background-color: #222;
            border-radius: 0 0 20px 20px; /* Inverted half-circle */
        }

        /* Wavy Ghost Bottom */
        .ghost-bottom {
            position: absolute;
            bottom: -20px; /* Sits just below the main body */
            left: 0;
            width: 100%;
            display: flex;
        }

        .ghost-bottom .wave {
            width: 25%; /* 4 waves */
            height: 20px;
            background-color: #f0f0f0;
            border-radius: 0 0 15px 15px; /* Half-circle */

            /* Animates the bottom wave */
            animation: wave 1s ease-in-out infinite alternate;
        }

        /* Stagger the animation delays so they don't move together */
        .ghost-bottom .wave:nth-child(2) {
            animation-delay: 0.2s;
        }
        .ghost-bottom .wave:nth-child(3) {
            animation-delay: 0.4s;
        }
        .ghost-bottom .wave:nth-child(4) {
            animation-delay: 0.6s;
        }

        /* -- Keyframe Animations -- */

        /* Floating animation (up and down) */
        @keyframes float {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-20px); /* Moves up 20px */
            }
        }

        /* Waving animation for the bottom pieces */
        @keyframes wave {
            0% {
                transform: translateY(0);
            }
            100% {
                transform: translateY(-8px); /* Moves up and down slightly */
            }
        }

    &amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;

    &amp;lt;div class="ghost"&amp;gt;
        &amp;lt;div class="ghost-eyes"&amp;gt;
            &amp;lt;div class="eye"&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;div class="eye"&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div class="ghost-mouth"&amp;gt;&amp;lt;/div&amp;gt;

        &amp;lt;div class="ghost-bottom"&amp;gt;
            &amp;lt;div class="wave"&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;div class="wave"&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;div class="wave"&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;div class="wave"&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>frontendchallenge</category>
      <category>devchallenge</category>
      <category>css</category>
    </item>
  </channel>
</rss>
