<?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: Black Hat</title>
    <description>The latest articles on DEV Community by Black Hat (@black_hat_a50abf4e679f4aa).</description>
    <link>https://dev.to/black_hat_a50abf4e679f4aa</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%2F4234743%2F5762fcde-2d70-48c5-b1b6-eb6db65d3d18.png</url>
      <title>DEV Community: Black Hat</title>
      <link>https://dev.to/black_hat_a50abf4e679f4aa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/black_hat_a50abf4e679f4aa"/>
    <language>en</language>
    <item>
      <title>I Built a Zero-Dependency Glassmorphism &amp; Neumorphism CSS Generator (Vanilla JS) 🚀</title>
      <dc:creator>Black Hat</dc:creator>
      <pubDate>Mon, 09 Nov 2026 09:02:16 +0000</pubDate>
      <link>https://dev.to/black_hat_a50abf4e679f4aa/i-built-a-zero-dependency-glassmorphism-neumorphism-css-generator-vanilla-js-lnj</link>
      <guid>https://dev.to/black_hat_a50abf4e679f4aa/i-built-a-zero-dependency-glassmorphism-neumorphism-css-generator-vanilla-js-lnj</guid>
      <description>&lt;p&gt;Whenever I needed a quick Glassmorphism card or a Neumorphic button for a project, I found myself fighting with bloated UI generators, generic templates, or massive CSS frameworks.&lt;/p&gt;

&lt;p&gt;I wanted absolute control over the shadow math, the blur, and the cyber-aesthetic glows—without installing a single dependency.&lt;/p&gt;

&lt;p&gt;So, I got bored and built my own: black-hat-exe CORP. UI Studio.&lt;/p&gt;

&lt;p&gt;It is a high-performance, single-page application built entirely from scratch to generate production-ready CSS3. Here is a look under the hood at how I engineered it.&lt;/p&gt;

&lt;p&gt;🛠️ The Tech Stack (Zero Dependencies)&lt;br&gt;
As a frontend developer, I am a massive advocate for keeping the DOM light. I bypassed Tailwind and Bootstrap for the core architecture and wrote this entirely in:&lt;/p&gt;

&lt;p&gt;Vanilla JavaScript: For the real-time DOM manipulation and shadow math.&lt;/p&gt;

&lt;p&gt;Semantic HTML5 &amp;amp; Custom CSS3: Utilizing strict CSS Grid and Flexbox layouts.&lt;/p&gt;

&lt;p&gt;GitHub Pages: Hosted live and indexed directly via Google Search Console.&lt;/p&gt;

&lt;p&gt;🎛️ 10 Granular UX Controls&lt;br&gt;
The core engine reads 10 inputs in real-time. Instead of just giving you a generic "blur" slider, I mapped out controls for:&lt;/p&gt;

&lt;p&gt;Dual-Shadow Distances (Critical for authentic Neumorphism)&lt;/p&gt;

&lt;p&gt;Shadow Intensity &amp;amp; Spread&lt;/p&gt;

&lt;p&gt;Backdrop Filter Blurs&lt;/p&gt;

&lt;p&gt;Cyber Glow Overlays&lt;/p&gt;

&lt;p&gt;Dynamic Border Opacity&lt;/p&gt;

&lt;p&gt;🧠 The Neumorphism Shadow Math&lt;br&gt;
The trickiest part of Neumorphism is ensuring the dual shadows (the light highlight and the dark shadow) perfectly contrast with the surface color you select.&lt;/p&gt;

&lt;p&gt;Instead of hardcoding colors, I wrote a Vanilla JS function to dynamically parse the hex code, convert it to RGB, and clamp the brightness up and down based on your intensity slider.&lt;/p&gt;

&lt;p&gt;JavaScript&lt;br&gt;
// Lighten or darken RGB color for Neumorphic dual shadows&lt;br&gt;
function adjustBrightness(rgb, factor) {&lt;br&gt;
    var r = clampChannel(rgb.r + factor);&lt;br&gt;
    var g = clampChannel(rgb.g + factor);&lt;br&gt;
    var b = clampChannel(rgb.b + factor);&lt;br&gt;
    return 'rgb(' + r + ', ' + g + ', ' + b + ')';&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;// In the engine, it dynamically splits the shadows:&lt;br&gt;
var darkShadow = adjustBrightness(rgb, -contrastShift);&lt;br&gt;
var lightShadow = adjustBrightness(rgb, contrastShift);&lt;br&gt;
This guarantees that whether your card is #151e2e (Dark Mode) or #ffffff (Light Mode), the CSS output is mathematically perfect.&lt;/p&gt;

&lt;p&gt;📱 Bulletproof Viewport Scaling&lt;br&gt;
One of the biggest issues with multi-panel tools is horizontal blowout on mobile devices. I engineered a strict &lt;a class="mentioned-user" href="https://dev.to/media"&gt;@media&lt;/a&gt; query utilizing minmax(0, 1fr) on the CSS Grid. If you load the studio on a phone, the fixed header smoothly auto-hides on scroll, and the dual-panel layout seamlessly stacks into a single column without breaking the viewport bounds.&lt;/p&gt;

&lt;p&gt;⚡ Try it Live&lt;br&gt;
You can play with the real-time engine and export the CSS code here:&lt;br&gt;
👉 Live UI Studio v2.5&lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://black-hat-exe.github.io/UI-Studio/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fblack-hat-exe.github.io%2FUI-Studio%2Fpreview-image.jpg" height="400" class="m-0" width="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://black-hat-exe.github.io/UI-Studio/" rel="noopener noreferrer" class="c-link"&gt;
            black-hat-exe CORP. — UI Studio (Glassmorphism &amp;amp; Neumorphism CSS Generator)
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Free Glassmorphism, Neumorphism, and Cyber UI CSS Generator. Export hand-crafted, production-ready CSS3.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
          black-hat-exe.github.io
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;If you are a developer, try playing with the shadow spread sliders or testing the viewport scaling—let me know if you can break the UI anywhere! 🐛&lt;/p&gt;

&lt;p&gt;(P.S. If you like the dark cyber-aesthetic but hate coding layouts from scratch, I also take custom frontend architecture commissions over on my Fiverr profile.)&lt;/p&gt;

&lt;p&gt;Let me know what you think of the dual-shadow logic in the comments!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>javascript</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
