<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Ahmod Musa]]></title><description><![CDATA[Ahmod Musa]]></description><link>https://ahmodmusa.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 17:53:52 GMT</lastBuildDate><atom:link href="https://ahmodmusa.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Mastering the Cyberpunk Glitch Effect: A Pure CSS Tutorial (Line-by-Line Breakdown)]]></title><description><![CDATA[Have you ever looked at the UI of Cyberpunk 2077 or classic sci-fi movies and admired those glitchy, glowing neon signs?
It creates a "High Tech, Low Life" vibe that is incredibly popular right now for gaming sites, developer portfolios, and creative...]]></description><link>https://ahmodmusa.hashnode.dev/mastering-the-cyberpunk-glitch-effect-a-pure-css-tutorial-line-by-line-breakdown</link><guid isPermaLink="true">https://ahmodmusa.hashnode.dev/mastering-the-cyberpunk-glitch-effect-a-pure-css-tutorial-line-by-line-breakdown</guid><category><![CDATA[Cyberpunk]]></category><dc:creator><![CDATA[Ahmod Musa]]></dc:creator><pubDate>Wed, 21 Jan 2026 15:42:07 GMT</pubDate><content:encoded><![CDATA[<p>Have you ever looked at the UI of <em>Cyberpunk 2077</em> or classic sci-fi movies and admired those glitchy, glowing neon signs?</p>
<p>It creates a "High Tech, Low Life" vibe that is incredibly popular right now for gaming sites, developer portfolios, and creative landing pages.</p>
<p>Today, we are going to build that exact effect.</p>
<p>The best part? We are doing it with <strong>Pure CSS</strong>. No JavaScript libraries, no heavy images. Just clean code.</p>
<p>Let’s break down the logic behind the "Glitch."</p>
<h3 id="heading-1-the-html-structure-the-skeleton">1. The HTML Structure (The Skeleton)</h3>
<p>We start with a simple anchor tag. However, there is one specific attribute you need to pay attention to: <code>data-text</code>.</p>
<pre><code class="lang-plaintext">&lt;a href="https://ahmodmusa.com" target="_blank" class="cyber-link" data-text="ahmodmusa.com"&gt;
  ahmodmusa.com
&lt;/a&gt;
</code></pre>
<p><strong>Why</strong> <code>data-text</code>? To create a glitch effect, we need two layers of the same text: the "Real" layer and the "Glitch" layer. Instead of writing the text twice in HTML (which is bad for SEO), we use <code>data-text</code>. CSS will grab this value later to create the ghost layer automatically.</p>
<h3 id="heading-2-the-base-styling-the-neon-look">2. The Base Styling (The Neon Look)</h3>
<p>First, let's give the button that futuristic Cyan glow. We use a combination of <code>box-shadow</code> and <code>text-shadow</code>.</p>
<pre><code class="lang-plaintext">.cyber-link {
  position: relative; /* Parent for absolute pseudo-elements */
  text-decoration: none;
  font-size: 24px;
  color: #00f7ff; /* The classic Cyberpunk Cyan */
  border: 2px solid #00f7ff;
  padding: 20px 40px;
  text-transform: uppercase;
  letter-spacing: 4px; /* Wide spacing looks more cinematic */
  font-weight: bold;
  overflow: hidden; /* Hides anything outside the border */
  transition: 0.2s;
/* The Neon Glow Magic */
text-shadow: 0 0 5px #00f7ff;
box-shadow: 0 0 10px #00f7ff, inset 0 0 5px #00f7ff;
}
</code></pre>
<p><strong>Key Takeaway:</strong> The <code>inset</code> property in <code>box-shadow</code> makes the glow appear <em>inside</em> the button as well, giving it a glass-tube neon feel.</p>
<h3 id="heading-3-the-scanline-texture-retro-tv-vibe">3. The Scanline Texture (Retro TV Vibe)</h3>
<p>Old monitors have scanlines. We can simulate this texture using the <code>::before</code> pseudo-element and a CSS gradient.</p>
<pre><code class="lang-plaintext">.cyber-link::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
/* Creating the stripes /
background: repeating-linear-gradient(
0deg,
transparent,
transparent 2px,
rgba(0, 247, 255, 0.1) 3px,
rgba(0, 247, 255, 0.1) 4px
);
z-index: -1; / Place it behind the text /
pointer-events: none; / Ignore mouse clicks */
}
</code></pre>
<p>This creates subtle, transparent stripes across the button, adding depth and texture to the flat color.</p>
<h3 id="heading-4-the-glitch-layer-where-the-magic-happens">4. The Glitch Layer (Where the Magic Happens)</h3>
<p>Now for the complex part. We use <code>::after</code> to create a copy of the text using <code>content: attr(data-text)</code>. We color it <strong>Magenta</strong> (Pink) to contrast with the Cyan.</p>
<pre><code class="lang-plaintext">.cyber-link::after {
  content: attr(data-text); /* Grabs text from HTML */
  position: absolute;
  top: 0;
  left: -2px; /* Offset it slightly to the left */
  width: 100%; height: 100%;
  padding: 20px 40px;
  background: #050505;
  color: #ff00ea; /* Glitch Color (Magenta) */
  border: 2px solid #ff00ea;
  z-index: -2;
  opacity: 0; /* Hidden by default */
/* Slicing the text */
clip-path: polygon(0 20%, 100% 20%, 100% 50%, 0 50%);
}
</code></pre>
<p><strong>What is</strong> <code>clip-path</code>? Imagine taking a pair of scissors and cutting a strip out of the text. That is what <code>clip-path</code> does here. It only shows a specific slice of the pink text.</p>
<h3 id="heading-5-hover-amp-animation-action">5. Hover &amp; Animation (Action!)</h3>
<p>When the user hovers over the link, we want three things to happen:</p>
<ol>
<li><p>The background fills up.</p>
</li>
<li><p>The "Glitch Layer" becomes visible.</p>
</li>
<li><p>The Glitch Layer starts shaking/jerking randomly.</p>
</li>
</ol>
<pre><code class="lang-plaintext">/* Invert colors on hover */
.cyber-link:hover {
  background: #00f7ff;
  color: #050505;
  box-shadow: 0 0 30px #00f7ff; /* Super bright glow */
  text-shadow: none;
}
/* Reveal and animate the glitch */
.cyber-link:hover::after {
opacity: 1;
left: 4px;
animation: glitch-jerk 0.3s linear infinite alternate;
}
</code></pre>
<p><strong>The Keyframes:</strong> This animation rapidly changes the <code>clip-path</code> (the slice position) and moves the text left and right (<code>transform: translate</code>).</p>
<pre><code class="lang-plaintext">@keyframes glitch-jerk {
  0% {
    clip-path: polygon(0 20%, 100% 20%, 100% 50%, 0 50%);
    transform: translate(0);
  }
  50% {
    clip-path: polygon(0 30%, 100% 30%, 100% 60%, 0 60%);
    transform: translate(-2px); /* Jerk Left */
  }
  100% {
    clip-path: polygon(0 10%, 100% 10%, 100% 40%, 0 40%);
    transform: translate(2px); /* Jerk Right */
  }
}
</code></pre>
<h3 id="heading-the-complete-code-copy-amp-paste">🚀 The Complete Code (Copy &amp; Paste)</h3>
<p>Here is the full file. You can save this as an <code>.html</code> file and open it in your browser to see the result.</p>
<pre><code class="lang-plaintext">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta charset="UTF-8"&gt;
&lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
&lt;title&gt;Cyberpunk Glitch Effect&lt;/title&gt;
&lt;style&gt;
  /* Base Layout */
  body {
    margin: 0; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    background-color: #050505;
    font-family: 'Courier New', monospace;
  }
/* 1. Main Link Style */
.cyber-link {
position: relative;
text-decoration: none;
font-size: 24px;
color: #00f7ff;
border: 2px solid #00f7ff;
padding: 20px 40px;
text-transform: uppercase;
letter-spacing: 4px;
font-weight: bold;
overflow: hidden;
transition: 0.2s;
text-shadow: 0 0 5px #00f7ff;
box-shadow: 0 0 10px #00f7ff, inset 0 0 5px #00f7ff;
z-index: 1;
}
/* 2. Scanline Texture */
.cyber-link::before {
content: '';
position: absolute;
top: 0; left: 0; width: 100%; height: 100%;
background: repeating-linear-gradient(
0deg, transparent, transparent 2px,
rgba(0, 247, 255, 0.1) 3px, rgba(0, 247, 255, 0.1) 4px
);
z-index: -1; pointer-events: none;
}
/* 3. The Glitch Layer (Pink) */
.cyber-link::after {
content: attr(data-text);
position: absolute;
top: 0; left: -2px; width: 100%; height: 100%;
padding: 20px 40px;
background: #050505;
color: #ff00ea;
border: 2px solid #ff00ea;
z-index: -2; opacity: 0;
transition: 0.1s;
clip-path: polygon(0 20%, 100% 20%, 100% 50%, 0 50%);
}
/* 4. Hover States */
.cyber-link:hover {
background: #00f7ff; color: #050505;
box-shadow: 0 0 30px #00f7ff; text-shadow: none;
}
.cyber-link:hover::after {
opacity: 1; left: 4px;
animation: glitch-jerk 0.3s linear infinite alternate;
}
/* 5. Glitch Animation Keyframes */
@keyframes glitch-jerk {
0% { clip-path: polygon(0 20%, 100% 20%, 100% 50%, 0 50%); transform: translate(0); }
50% { clip-path: polygon(0 30%, 100% 30%, 100% 60%, 0 60%); transform: translate(-2px); }
100% { clip-path: polygon(0 10%, 100% 10%, 100% 40%, 0 40%); transform: translate(2px); }
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;a href="https://ahmodmusa.com" target="_blank" class="cyber-link" data-text="ahmodmusa.com"&gt;
ahmodmusa.com
&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<h3 id="heading-conclusion">Conclusion</h3>
<p>The beauty of this effect is that it looks complex, but it relies on standard CSS properties like <code>clip-path</code> and pseudo-elements.</p>
<p>Feel free to copy this code and use it in your next sci-fi project, portfolio, or 404 page.</p>
<p><strong>Did you find this tutorial helpful?</strong> Check out my other <a target="_blank" href="https://www.google.com/search?q=Neon+Future%3A+Building+a+3D+Cyberpunk+Glitch+Card+\(Pure+CSS+%26+JS+Versions\)&amp;sourceid=chrome&amp;ie=UTF-8"><strong>HTML &amp; CSS Experiments</strong></a> or <a target="_blank" href="https://ahmodmusa.com/contact/"><strong>Hire Me</strong></a> to build a unique web experience for your brand.</p>
<p>Happy Coding! 💻⚡</p>
]]></content:encoded></item><item><title><![CDATA[Create a 3D Cyberpunk Glitch Card using CSS & JS (No Libraries)]]></title><description><![CDATA[There is something undeniably cool about the Cyberpunk aesthetic. The neon lights and high-tech vibe scream future. In this tutorial, we will build a Cyberpunk Glitch Card that feels like it was ripped straight out of a sci-fi game UI.
The result? A ...]]></description><link>https://ahmodmusa.hashnode.dev/create-a-3d-cyberpunk-glitch-card-using-css-and-js-no-libraries</link><guid isPermaLink="true">https://ahmodmusa.hashnode.dev/create-a-3d-cyberpunk-glitch-card-using-css-and-js-no-libraries</guid><category><![CDATA[CSS]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[showcase]]></category><dc:creator><![CDATA[Ahmod Musa]]></dc:creator><pubDate>Thu, 01 Jan 2026 17:08:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1767287256882/3b60613d-a2d6-4c53-a290-472386ee7580.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There is something undeniably cool about the Cyberpunk aesthetic. The neon lights and high-tech vibe scream future. In this tutorial, we will build a <strong>Cyberpunk Glitch Card</strong> that feels like it was ripped straight out of a sci-fi game UI.</p>
<p>The result? A 3D Interactive Profile Card that reacts to your mouse movement and features a jagged, glitching text animation.</p>
<p>In this tutorial, I’m going to show you exactly how I built it. We will use CSS clip-path for the angled corners and a few lines of JavaScript for that smooth 3D tilt effect.</p>
<h5 id="heading-why-build-a-cyberpunk-glitch-card">Why Build a Cyberpunk Glitch Card?</h5>
<p>This isn't just a static image. Here is what makes this card special:</p>
<ul>
<li><p><strong>Holographic Glitch Text:</strong> I used CSS keyframes and the clip property to make the text look like it's malfunctioning.</p>
</li>
<li><p><strong>3D Tilt Effect:</strong> The card follows your mouse cursor in a 3D space.</p>
</li>
<li><p><strong>Angled UI:</strong> Using clip-path, we cut the corners of the card to give it that sharp, industrial sci-fi look.</p>
</li>
</ul>
<p><a target="_blank" href="https://codepen.io/Ahmod-Musa/pen/vEKNxbq"><strong>Demo</strong></a></p>
<p><strong>The Source Code</strong> You can copy-paste the code below to use this card in your own portfolio or project.</p>
<p>Below is the complete source code for the <strong>Cyberpunk Glitch Card</strong>. You can copy-paste it directly into your project.</p>
<p><strong>1. The HTML Structure</strong> We need a container for the 3D perspective and a wrapper for the glitch effect on the avatar. Notice the data-text attribute on the title—that's the secret to the glitch effect!</p>
<pre><code class="lang-plaintext">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Cyberpunk Glitch Card&lt;/title&gt;
    &lt;link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet"&gt;
&lt;/head&gt;
&lt;body&gt;

    &lt;div class="container"&gt;
        &lt;div class="card" id="cyber-card"&gt;
            &lt;div class="card-content"&gt;
                &lt;div class="glitch-wrapper"&gt;
                    &lt;img src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?q=80&amp;w=1000" alt="Cyber Avatar" class="avatar"&gt;
                    &lt;div class="glitch-effect"&gt;&lt;/div&gt;
                &lt;/div&gt;

                &lt;h2 class="cyber-title" data-text="ALEX_MERCER"&gt;ALEX_MERCER&lt;/h2&gt;
                &lt;p class="cyber-role"&gt;SYSTEM_ARCHITECT // LVL.99&lt;/p&gt;

                &lt;div class="stats"&gt;
                    &lt;div class="stat-box"&gt;
                        &lt;span class="label"&gt;SPEED&lt;/span&gt;
                        &lt;span class="value"&gt;98%&lt;/span&gt;
                    &lt;/div&gt;
                    &lt;div class="stat-box"&gt;
                        &lt;span class="label"&gt;HACK&lt;/span&gt;
                        &lt;span class="value"&gt;100%&lt;/span&gt;
                    &lt;/div&gt;
                    &lt;div class="stat-box"&gt;
                        &lt;span class="label"&gt;STEALTH&lt;/span&gt;
                        &lt;span class="value"&gt;85%&lt;/span&gt;
                    &lt;/div&gt;
                &lt;/div&gt;

                &lt;button class="cyber-btn"&gt;INITIALIZE &lt;i class="fas fa-bolt"&gt;&lt;/i&gt;&lt;/button&gt;
            &lt;/div&gt;

            &lt;div class="corner top-left"&gt;&lt;/div&gt;
            &lt;div class="corner top-right"&gt;&lt;/div&gt;
            &lt;div class="corner bottom-left"&gt;&lt;/div&gt;
            &lt;div class="corner bottom-right"&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p><strong>2. The CSS (The Magic)</strong> This is where the heavy lifting happens. I used CSS variables for the Neon Cyan and Pink colors so you can easily change the theme. The @keyframes glitch-anim handles the text distortion.</p>
<pre><code class="lang-plaintext">@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&amp;family=Share+Tech+Mono&amp;display=swap');

:root {
    --primary: #00f3ff; /* Cyan Neon */
    --secondary: #ff0055; /* Pink Neon */
    --bg: #050505;
    --card-bg: #111;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg);
    /* Grid Background Pattern */
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Share Tech Mono', monospace;
    overflow: hidden;
}

.container { perspective: 1000px; }

.card {
    width: 350px;
    padding: 40px 30px;
    background: var(--card-bg);
    border: 1px solid rgba(0, 243, 255, 0.2);
    position: relative;
    transform-style: preserve-3d;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.1);
    /* Angled corners using clip-path */
    clip-path: polygon(
        0 0, 100% 0, 100% 85%, 90% 100%, 0 100%
    );
}

/* --- Avatar &amp; Glitch --- */
.glitch-wrapper {
    width: 120px; height: 120px;
    margin: 0 auto 20px;
    position: relative;
}

.avatar {
    width: 100%; height: 100%;
    object-fit: cover;
    border: 2px solid var(--primary);
    filter: grayscale(100%);
    transition: 0.3s;
}

.card:hover .avatar { filter: grayscale(0%); border-color: var(--secondary); }

/* --- Typography --- */
.cyber-title {
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 5px;
    position: relative;
    letter-spacing: 2px;
}

/* Glitch Text Effect */
.cyber-title::before, .cyber-title::after {
    content: attr(data-text);
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--card-bg);
}

.cyber-title::before {
    left: 2px; text-shadow: -1px 0 var(--secondary);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.cyber-title::after {
    left: -2px; text-shadow: -1px 0 var(--primary);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

.cyber-role {
    text-align: center;
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 30px;
    opacity: 0.8;
}

/* --- Stats Grid --- */
.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 15px 0;
}

.stat-box { text-align: center; }
.stat-box .label { display: block; font-size: 0.7rem; color: #888; margin-bottom: 5px; }
.stat-box .value { font-size: 1.1rem; color: #fff; font-weight: bold; }

/* --- Button --- */
.cyber-btn {
    width: 100%;
    padding: 15px;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
}

.cyber-btn::before {
    content: ''; position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: var(--primary);
    transition: 0.3s; z-index: -1;
}

.cyber-btn:hover { color: #000; box-shadow: 0 0 15px var(--primary); }
.cyber-btn:hover::before { left: 0; }

/* --- Decorative Corners --- */
.corner { position: absolute; width: 10px; height: 10px; border: 2px solid var(--primary); transition: 0.3s; }
.top-left { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.top-right { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.bottom-left { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.bottom-right { bottom: -2px; right: -2px; border-left: none; border-top: none; width: 20px; border-color: var(--secondary); }

.card:hover .corner { width: 100%; height: 100%; opacity: 0.1; }

/* --- Keyframes --- */
@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 30px, 0); transform: skew(0.5deg); }
    10% { clip: rect(50px, 9999px, 70px, 0); transform: skew(0.2deg); }
    20% { clip: rect(20px, 9999px, 60px, 0); transform: skew(0.8deg); }
    100% { clip: rect(80px, 9999px, 100px, 0); transform: skew(0.1deg); }
}
@keyframes glitch-anim-2 {
    0% { clip: rect(60px, 9999px, 80px, 0); transform: skew(0.6deg); }
    10% { clip: rect(10px, 9999px, 30px, 0); transform: skew(0.3deg); }
    100% { clip: rect(90px, 9999px, 100px, 0); transform: skew(0.1deg); }
}
</code></pre>
<p><strong>3. The JavaScript (The Interaction)</strong> We don't need a heavy library like Three.js here. A simple event listener tracking the xAxis and yAxis of the mouse is enough to create a realistic tilt.</p>
<pre><code class="lang-plaintext">const card = document.getElementById('cyber-card');

document.addEventListener('mousemove', (e) =&gt; {
    let xAxis = (window.innerWidth / 2 - e.pageX) / 20;
    let yAxis = (window.innerHeight / 2 - e.pageY) / 20;

    card.style.transform = `rotateY(${xAxis}deg) rotateX(${yAxis}deg)`;
});

card.addEventListener('mouseenter', () =&gt; {
    card.style.transition = 'none';
});

card.addEventListener('mouseleave', () =&gt; {
    card.style.transition = 'all 0.5s ease';
    card.style.transform = `rotateY(0deg) rotateX(0deg)`;
});
</code></pre>
<p><strong>How the "Glitch" Works</strong> If you look at the CSS for .cyber-title, you will see I used ::before and ::after pseudo-elements. These elements contain the exact same text as the title (grabbed via attr(data-text)).</p>
<p>By positioning them slightly apart and animating their clip property rapidly, we create the illusion that the text is splitting and twitching. It’s a classic trick, but it works perfectly for this style.</p>
<p><strong>Conclusion</strong> Building UI components like this is a great way to practice modern CSS properties like clip-path and transform-style. Plus, it looks awesome on a developer portfolio!</p>
<p>Feel free to grab the code, change the colors, and make it your own. If you build something cool with it, tag me—I’d love to see it.</p>
<p>Happy Coding! 👾</p>
<p>If you like this, check out my [<a target="_blank" href="https://ahmodmusa.com/futuristic-login-form-html-css/">Futuristic Login Form</a>] tutorial as well.</p>
<p>I regularly share cool UI components like this. If you found this useful, check out my personal blog for more: [<a target="_blank" href="http://AhmodMusa.com">AhmodMusa.com</a>]</p>
]]></content:encoded></item></channel></rss>