← Back to list

From a Student’s Frustration to 100+ Components: The Journey of Building AFK Motion

We’ve all been there. You load up a modern SaaS landing page or a creative portfolio, and everything just flows. Elements glide into place…

HEMANATH-AFK · 2026-06-08 10:34 · 0 claps · 5.6 min read
#npm #node #foss #github #afk
Open on Medium ↗
Wiki topics: INV · Investing & Markets EDU · Education & Learning 🔓 · Open Source

From a Student’s Frustration to 100+ Components: The Journey of Building AFK Motion

We’ve all been there. You load up a modern SaaS landing page or a creative portfolio, and everything just flows. Elements glide into place, backgrounds react to your mouse, and the scroll feels less like navigating a document and more like directing a film.

As developers, we know the magic isn’t real — it’s just math, state, and a whole lot of DOM manipulation. But achieving that premium, cinematic feel in React without sacrificing performance is a notoriously difficult balancing act.

That balancing act is why I built AFK Motion (@hemanath-afk/afk-motion). Today, as the project hits Version 2.0.0, I want to step back and share the story of how a frustrating series of copy-pasted code snippets evolved into a premium, tree-shakeable React micro-interaction library.

The Beginning

As an IT engineering student navigating my B.Tech studies in Puducherry, learning frontend development felt like discovering a superpower. React gave me the tools to build functional interfaces, but my early projects felt stiff. I was fascinated by websites that felt alive — the ones with fluid animations, physics-based interactions, and cinematic polish.

I started building these effects from scratch. But very quickly, a painful pattern emerged. I found myself repeatedly digging through old project repositories just to copy and paste the same hover effects, intersection observers, and scroll-linked animations. The boilerplate was exhausting.

I didn’t just want a cool button; I wanted a reusable system. I wanted to build an animation library that I could plug into any project — a toolkit designed for building immersive portfolios, SaaS dashboards, and futuristic web experiences. I decided it was time to bundle my code and publish my very first npm package.

I thought it would take a weekend. I was incredibly naive.

The Struggles of Version 1.0.0

Hitting npm publish for the first time feels like standing on a stage without a script. It is terrifying.

Being completely new to the open-source ecosystem, the actual code for the animations turned out to be the easiest part of the process. The real nightmare was the infrastructure. I was suddenly drowning in a sea of build configuration issues and package architecture debates.

  • The Module Madness: I lost days trying to understand the difference between CommonJS and ES Modules. Why were my imports failing? What exactly is the exports field in package.json?
  • The Build Nightmares: Setting up the bundler was an exercise in pure frustration. My initial builds weren’t tree-shakeable, meaning anyone importing a single button was downloading my entire library.
  • Imposter Syndrome: I stared at the GitHub workflow errors, questioning if I was even cut out for this. The fear of publishing publicly was paralyzing. What if my code is a joke? What if experienced developers look at my repo and laugh at my architecture? Will anyone even use this?

Every “module not found” error felt like a personal failure. But each time my code broke, I dug into the documentation. Slowly, the mysterious black box of npm packaging started to make sense. Those early struggles didn’t just teach me how to publish a package; they taught me how modern JavaScript actually works under the hood.

Building AFK Motion

With the infrastructure finally stable, I focused heavily on the engineering philosophy behind the library. I didn’t just want to build wrappers around existing tools; I wanted to build it right.

  • Component Architecture: Every element had to be modular. You shouldn’t have to pay a performance tax for components you don’t use. I implemented strict tree-shaking support so that importing one text animation only bundles that exact code.
  • React Best Practices: I leaned heavily into custom hooks to separate animation logic from UI rendering, ensuring the library remained flexible and declarative.
  • Accessibility First: Animations are beautiful, but not at the expense of usability. I integrated prefers-reduced-motion checks natively, ensuring the web remains accessible for everyone.

Why Performance Matters

If you’ve ever tried to attach a state update to a mousemove or scroll event in React, you know exactly what happens: your application grinds to a halt.

React’s render cycle is fantastic for UI state, but it is fundamentally the wrong tool for 60fps animations. Updating React state on every scroll event triggers a waterfall of re-renders and layout thrashing. Mouse tracking bottlenecks create noticeable lag, making a site feel heavy and unresponsive.

To achieve premium performance in AFK Motion, I had to step outside of standard React paradigms:

  • Bypassing React State: Instead of triggering renders, AFK Motion utilizes requestAnimationFrame to run stable animation loops that talk directly to the DOM via refs.
  • Hardware Acceleration: We lean entirely on CSS transforms (translate3d, scale) and opacity, forcing the browser to hand the animation workload over to the GPU.
  • Passive Listeners: By utilizing passive event listeners, we ensure that scroll animations never block the main thread, resulting in butter-smooth scroll scrubbing.

The Evolution to Version 2.0.0

What started as a handful of utility components has grown into a massive ecosystem. Version 2.0.0 is the realization of what AFK Motion was always meant to be.

The library now boasts more than 100+ components spread across 18 categories. We’ve entirely rewritten the core architecture to ensure flawless React 19 compatibility. The scroll systems are completely new, offering hardware-accelerated scroll scrubbing that feels native to the browser.

But the most exciting leap is our expansion into the future of UI. As the web leans heavier into Agentic AI and immersive tech, we’ve introduced brand new 3D interactions and AI-focused UI components designed specifically for platforms dealing with LLMs and chat interfaces.

Key Features of AFK Motion

To give you an idea of what you can build, here is a snapshot of the ecosystem:

  • Scroll Animations: Hardware-accelerated parallax and scroll-scrubbing elements. Perfect for narrative-driven SaaS landing pages.
  • Hover & Mouse Effects: Magnetic buttons and cursor-following spotlights that add a cinematic feel to personal portfolios.
  • Text Animations: Split-text reveals, glowing typewriter effects, and dynamic gradients.
  • 3D Components: Interactive, tilt-aware cards and geometric elements that add depth without the overhead of WebGL.
  • AI Components: Ready-to-use, tech-stylized chat bubbles, loading states, and generative-reveal text components designed for modern AI applications.
  • Dashboards, Cards, Buttons & Navigations: A massive suite of foundational micro-interactions for web apps.

Lessons Learned

If you take anything away from my journey, let it be these developer truths:

  • Shipping is better than perfection. If I had waited until the codebase was flawless, 1.0.0 would never have launched. Get it out there.
  • Documentation is a feature. You can write the greatest code in the world, but if your README.md is bad, no one will use it.
  • Every bug teaches something. The grueling errors I faced with ESM and CJS taught me more about module resolution than any tutorial ever could. Open source teaches real-world engineering.
  • Building in public creates opportunities. Sharing your progress, your failures, and your wins connects you with developers who will help you grow.

Advice for Students

To the students and indie devs reading this: Start building. You don’t need a senior engineering title or a decade of experience to contribute to the open-source community. If you find yourself solving the same problem twice, package the solution and publish it.

Don’t be intimidated by npm, GitHub, or the fear of judgment. Your first package might fail. Your second might be buggy. But by your third, you’ll understand system architecture in a way that simply cannot be taught in a classroom. Build things you want to use, and let your portfolio speak for your passion.

Looking Ahead

Version 2.0.0 is a massive milestone, but it’s just the foundation. The roadmap for AFK Motion involves expanding into an even more comprehensive interaction ecosystem. I am focusing on building out more complex 3D components, refining the developer experience with richer documentation, and opening the doors wider for community contributions.

Anyways,

Building AFK Motion has been the most challenging and rewarding experience of my development journey so far. It forced me out of my comfort zone, shattered my imposter syndrome, and showed me the incredible power of the open-source community.

Every massive, industry-standard tool started as a small experiment by a developer trying to solve a personal frustration. Don’t underestimate what you can build late at night in your dorm room. Pick a problem, write the code, and hit publish.

Happy coding.

— Hems


메타데이터
post_id
c5e4ed0ab3a5
slug
from-a-students-frustration-to-100-components-the-journey-of-building-afk-motion-c5e4ed0ab3a5
url
https://medium.com/@hemanath-afk/from-a-students-frustration-to-100-components-the-journey-of-building-afk-motion-c5e4ed0ab3a5
canonical_url
https://medium.com/@hemanath-afk/from-a-students-frustration-to-100-components-the-journey-of-building-afk-motion-c5e4ed0ab3a5
author_url
https://medium.com/@hemanath-afk
status
ok
fetched_at
2026-06-09 15:37:30