<?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: Devvill Monki Ventures</title>
    <description>The latest articles on DEV Community by Devvill Monki Ventures (@devvillmonkiventures).</description>
    <link>https://dev.to/devvillmonkiventures</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%2F430866%2Fda9b6eb1-7834-48aa-80a8-a9de29d4b36e.png</url>
      <title>DEV Community: Devvill Monki Ventures</title>
      <link>https://dev.to/devvillmonkiventures</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devvillmonkiventures"/>
    <language>en</language>
    <item>
      <title>My Kubernetes Background Jobs Were Running 3x (Here's the Simple Fix)</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Wed, 17 Sep 2025 08:54:55 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/my-kubernetes-background-jobs-were-running-3x-heres-the-simple-fix-pl4</link>
      <guid>https://dev.to/devvillmonkiventures/my-kubernetes-background-jobs-were-running-3x-heres-the-simple-fix-pl4</guid>
      <description>&lt;p&gt;Had a background job in Kubernetes. Super simple - check for pending work every 5 minutes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;setInterval&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;checkPendingJobs&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Send emails, process data, cleanup tasks&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deployed to 3 pods for "high availability." Big mistake.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Actually Happened
&lt;/h2&gt;

&lt;p&gt;Monday morning: Users getting duplicate emails, database CPU spiking. Checking logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Pod-A: Processing job #123 - sending welcome email
Pod-B: Processing job #123 - sending welcome email  
Pod-C: Processing job #123 - sending welcome email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All 3 pods wake up at the exact same time, query the database, find the same pending jobs, and process them in parallel. &lt;/p&gt;

&lt;p&gt;Classic race condition.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Fixed It (Wrong Way First)
&lt;/h2&gt;

&lt;p&gt;Tried database locks. Tried Redis locks. Tried leader election. All complex, all brittle.&lt;/p&gt;

&lt;p&gt;Then realized something obvious: &lt;strong&gt;Why am I trying to coordinate 3 workers when I only need 1 job to run?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Simple Solution
&lt;/h2&gt;

&lt;p&gt;Deleted the &lt;code&gt;setInterval&lt;/code&gt;. Made it an HTTP endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/jobs/process&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;checkPendingJobs&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;done&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Added external scheduler (GCP Cloud Scheduler):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud scheduler &lt;span class="nb"&gt;jobs &lt;/span&gt;create http my-job &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--schedule&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"*/5 * * * *"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--uri&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://myapp.com/jobs/process"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Scheduler hits the endpoint, load balancer picks one pod, job runs once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Beats Locking
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No race conditions possible&lt;/strong&gt; - only one request&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Way less code&lt;/strong&gt; - no coordination logic&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better reliability&lt;/strong&gt; - managed scheduler vs app timers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easier debugging&lt;/strong&gt; - clear request logs&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Works everywhere&lt;/strong&gt; - AWS EventBridge, cron, whatever&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Pattern
&lt;/h2&gt;

&lt;p&gt;Stop asking "How do I coordinate multiple instances?"&lt;/p&gt;

&lt;p&gt;Start asking "Do I need multiple instances doing this?"&lt;/p&gt;

&lt;p&gt;Most background jobs are perfect for external triggers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File processing → storage events&lt;/li&gt;
&lt;li&gt;Cache warming → deployment hooks
&lt;/li&gt;
&lt;li&gt;Cleanup tasks → schedulers&lt;/li&gt;
&lt;li&gt;Health checks → external monitoring&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Been running this for months. Zero duplicate jobs. Zero 2 AM alerts.&lt;/p&gt;

&lt;p&gt;Sometimes the best distributed systems solution is... not distributing the work.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Similar war stories? Drop them below.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>docker</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Roles &amp; Permissions: Building a Secure and Efficient Full-Stack Product</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Mon, 30 Jun 2025 08:58:47 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/roles-permissions-building-a-secure-and-efficient-full-stack-product-2gd3</link>
      <guid>https://dev.to/devvillmonkiventures/roles-permissions-building-a-secure-and-efficient-full-stack-product-2gd3</guid>
      <description>&lt;p&gt;Role-based permissions are more than just toggling features on or off—they’re a foundation for scalable, maintainable products. As a Senior Engineer eyeing a Technical Architect path, you’ll often decide who sees what, ensuring security, consistency, and efficiency across your stack.&lt;/p&gt;

&lt;p&gt;In this post, we’ll explore:&lt;/p&gt;

&lt;p&gt;The importance of role-based access in UI + backend.&lt;br&gt;
A Strategy Pattern implementation to keep logic clean and flexible.&lt;br&gt;
Best practices to future-proof your approach.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Why Roles &amp;amp; Permissions Matter
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Better User Experience: Show only what’s relevant. Users aren’t overwhelmed with irrelevant features.&lt;/li&gt;
&lt;li&gt;Security &amp;amp; Compliance: Minimize accidental or malicious access.&lt;/li&gt;
&lt;li&gt;Cleaner Code: Centralize permission checks; no more copy-paste checks scattered everywhere.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  2. Frontend Implementation: Hiding UI Elements
&lt;/h2&gt;

&lt;p&gt;Imagine a React app where certain features (like “Delete User” or “Edit Billing”) are visible only to specific roles. We can use the Strategy Pattern to decide at runtime which set of permissions apply:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// strategy/permissionStrategies.js

// [Strategy Pattern] Each strategy defines a permission set for a specific role.
export const adminPermissions = {
  canDeleteUser: true,
  canEditBilling: true,
  canViewAnalytics: true
};

export const managerPermissions = {
  canDeleteUser: false,
  canEditBilling: true,
  canViewAnalytics: true
};

export const userPermissions = {
  canDeleteUser: false,
  canEditBilling: false,
  canViewAnalytics: true
};

// A helper to get the right strategy object for the current user role
export const getPermissions = (role) =&amp;gt; {
  switch (role) {
    case "admin":
      return adminPermissions;
    case "manager":
      return managerPermissions;
    default:
      return userPermissions;
  }
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// components/FeatureButton.jsx

import React from "react";
import { getPermissions } from "../strategy/permissionStrategies";

function FeatureButton({ role, feature, onClick, children }) {
  const perms = getPermissions(role);

  // Only render button if user has the correct permission
  if (!perms[feature]) return null;

  return (
    &amp;lt;button
      onClick={onClick}
      className="p-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600"
    &amp;gt;
      {children}
    &amp;lt;/button&amp;gt;
  );
}

export default FeatureButton;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;How it works&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strategy Objects (adminPermissions, managerPermissions, userPermissions) define capabilities per role.&lt;/li&gt;
&lt;li&gt;In the component, we lookup permissions based on the user role at runtime.&lt;/li&gt;
&lt;li&gt;If the user cannot perform the feature, we simply don’t render the button.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;This approach:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keeps UI logic simple—no big if-else blocks in every component.&lt;/li&gt;
&lt;li&gt;Centralizes permission definitions for easy future updates.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Backend Implementation: Enforcing Access
&lt;/h2&gt;

&lt;p&gt;Hiding UI elements is good, but server-side checks are crucial. Otherwise, a savvy user could still call APIs directly. Let’s implement a Strategy Pattern in Node.js (Express):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// controllers/permissionStrategyController.js

// [Strategy Pattern] Each strategy defines backend logic for handling roles differently.
const adminStrategy = {
  canDeleteUser: () =&amp;gt; true,
  canEditBilling: () =&amp;gt; true,
  canViewAnalytics: () =&amp;gt; true,
};

const managerStrategy = {
  canDeleteUser: () =&amp;gt; false,
  canEditBilling: () =&amp;gt; true,
  canViewAnalytics: () =&amp;gt; true,
};

const userStrategy = {
  canDeleteUser: () =&amp;gt; false,
  canEditBilling: () =&amp;gt; false,
  canViewAnalytics: () =&amp;gt; true,
};

function getBackendStrategy(role) {
  switch (role) {
    case "admin":
      return adminStrategy;
    case "manager":
      return managerStrategy;
    default:
      return userStrategy;
  }
}

// Example: Deleting a user in the backend
exports.deleteUser = (req, res) =&amp;gt; {
  const { userRole } = req.body; // e.g., 'admin', 'manager', 'user'
  const strategy = getBackendStrategy(userRole);

  if (!strategy.canDeleteUser()) {
    return res.status(403).json({ error: "Unauthorized action" });
  }

  // Proceed with deletion...
  // ...
  return res.json({ message: "User deleted successfully" });
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key Points&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strategy Pattern: Each role has an object that encapsulates its capabilities.&lt;/li&gt;
&lt;li&gt;Centralized logic: All permissions are in one place, preventing accidental oversights.&lt;/li&gt;
&lt;li&gt;Consistent with Frontend: If the UI hides a feature, the backend also rejects it if requested directly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Why This Makes a Great Product Feature
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;User-Centric: Restricting the UI to relevant features improves usability.&lt;/li&gt;
&lt;li&gt;Security: Minimizes potential abuse or accidental misuse by ensuring checks at both the frontend and backend.&lt;/li&gt;
&lt;li&gt;Extensibility: Adding a new role (e.g., supervisor) is as simple as adding another strategy. No rewriting everywhere else.&lt;/li&gt;
&lt;li&gt;Maintainability: Developers quickly find and update permission rules without wading through scattered checks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Areas for Improvement &amp;amp; Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Database Storage: Instead of hardcoding, store roles &amp;amp; permissions in a database.&lt;/li&gt;
&lt;li&gt;JWT / Session Management: Ensure user roles in requests are validated (e.g., via tokens).&lt;/li&gt;
&lt;li&gt;Caching: Caching permission sets for frequent lookups can boost performance.&lt;/li&gt;
&lt;li&gt;Logging &amp;amp; Auditing: Keep track of role changes or permission overrides for compliance.&lt;/li&gt;
&lt;li&gt;Test Coverage: Unit tests for each strategy ensure no accidental changes break permissions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Roles and permissions might seem trivial until your product hits scale or faces security issues. By aligning frontend UI checks with backend server enforcement, using a Strategy Pattern, you keep your code organized, your product safe, and your users happy.&lt;/p&gt;

&lt;p&gt;Feel free to adapt this approach to suit your stack—just don’t forget that a well-thought-out permissions system is a massive competitive advantage in any tech product.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thanks for reading!&lt;/strong&gt;&lt;br&gt;
If you found this helpful, share your own roles/permissions tips in the comments and let’s learn together.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>rbac</category>
      <category>productdevelopment</category>
      <category>bestpractices</category>
    </item>
    <item>
      <title>Pixelated Image Animation with Framer Motion</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Mon, 30 Jun 2025 08:54:48 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/pixelated-image-animation-with-framer-motion-4n45</link>
      <guid>https://dev.to/devvillmonkiventures/pixelated-image-animation-with-framer-motion-4n45</guid>
      <description>&lt;h2&gt;
  
  
  Creating a Stunning Pixelated Image Animation with Framer Motion
&lt;/h2&gt;

&lt;p&gt;Ever wanted to create that mesmerizing effect where an image appears to assemble itself pixel by pixel as you scroll? Today, I'll walk you through building a captivating pixelated image animation using React and Framer Motion that will make your portfolio stand out from the crowd.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 What We're Building
&lt;/h2&gt;

&lt;p&gt;We're creating an animated component that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Breaks an image into a grid of individual pixels&lt;/li&gt;
&lt;li&gt;Scatters these pixels randomly across the screen initially&lt;/li&gt;
&lt;li&gt;Assembles them into the complete image as the user scrolls&lt;/li&gt;
&lt;li&gt;Provides smooth, performant animations using Framer Motion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🛠️ The Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;React&lt;/strong&gt; - For component structure&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Framer Motion&lt;/strong&gt; - For smooth animations and scroll-based triggers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript&lt;/strong&gt; - For type safety and better developer experience&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tailwind CSS&lt;/strong&gt; - For styling (optional but recommended)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🎨 The Animation Breakdown
&lt;/h2&gt;

&lt;p&gt;The magic happens in two main components:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The PixelatedImage Component
&lt;/h3&gt;

&lt;p&gt;This is our main orchestrator that sets up the grid and manages the overall animation.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The Pixel Component
&lt;/h3&gt;

&lt;p&gt;Each individual pixel that knows how to animate itself from a random position to its final location.&lt;/p&gt;

&lt;h2&gt;
  
  
  💻 Implementation
&lt;/h2&gt;

&lt;p&gt;Let's dive into the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// PixelatedImage.tsx&lt;/span&gt;
&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;use client&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;motion&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useTransform&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;MotionValue&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;framer-motion&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useMemo&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;PixelProps&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;i&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;src&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;gridSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;scrollYProgress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;MotionValue&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Pixel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;gridSize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;scrollYProgress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;PixelProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;gridSize&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;col&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="nx"&gt;gridSize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Calculate which part of the image this pixel should show&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;backgroundPosition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;col&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gridSize&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;% &lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;row&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gridSize&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;%`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;backgroundSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;gridSize&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;% &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;gridSize&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;%`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Generate random initial positions (cached with useMemo)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;initialX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;initialY&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useMemo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Calculate animation timing for staggered effect&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;numPixels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gridSize&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;gridSize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pixelProgress&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;numPixels&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;animationStart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;pixelProgress&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;animationDuration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Create smooth transforms based on scroll progress&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTransform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;scrollYProgress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;animationStart&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;animationStart&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;animationDuration&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;initialX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTransform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;scrollYProgress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;animationStart&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;animationStart&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;animationDuration&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;initialY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;opacity&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTransform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;scrollYProgress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;animationStart&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;animationStart&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;animationDuration&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;scale&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTransform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;scrollYProgress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;animationStart&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;animationStart&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;animationDuration&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;motion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;
      &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;w-full h-full&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;
        &lt;span class="na"&gt;backgroundImage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`url(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;)`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;backgroundPosition&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;backgroundSize&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;}}&lt;/span&gt;
    &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;PixelatedImageProps&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;src&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;scrollYProgress&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;MotionValue&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PixelatedImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;scrollYProgress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;PixelatedImageProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;gridSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 20x20 grid = 400 pixels&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;numPixels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gridSize&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;gridSize&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;relative w-[250px] h-[250px] md:w-[400px] md:h-[400px]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* Background circle for aesthetic */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;absolute inset-0 rounded-full bg-gray-200 dark:bg-gray-800&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;

      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* Pixel grid */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;
        &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;relative z-10 w-full h-full grid&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{{&lt;/span&gt;
          &lt;span class="na"&gt;gridTemplateColumns&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`repeat(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;gridSize&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;, 1fr)`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;gridTemplateRows&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`repeat(&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;gridSize&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;, 1fr)`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;}}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;numPixels&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Pixel&lt;/span&gt;
            &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;gridSize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;gridSize&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;scrollYProgress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;scrollYProgress&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="p"&gt;))}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;PixelatedImage&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔍 How It Works
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Grid Setup&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We create a 20x20 CSS Grid, giving us 400 individual pixels. Each pixel is a &lt;code&gt;div&lt;/code&gt; that shows a specific portion of the source image using CSS &lt;code&gt;background-position&lt;/code&gt; and &lt;code&gt;background-size&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Background Positioning Magic&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;backgroundPosition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;col&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gridSize&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;% &lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;row&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gridSize&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;%`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;backgroundSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;gridSize&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;% &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;gridSize&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;%`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This calculates exactly which part of the image each pixel should display. Think of it like cutting a photo into a jigsaw puzzle - each piece knows exactly where it belongs.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Staggered Animation&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pixelProgress&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;numPixels&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;animationStart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;pixelProgress&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of all pixels animating at once, we stagger them based on their index. This creates a beautiful cascading effect where pixels assemble in sequence.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Smooth Transforms&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Using Framer Motion's &lt;code&gt;useTransform&lt;/code&gt;, we create smooth transitions for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Position&lt;/strong&gt; (x, y) - From random scatter to final position&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Opacity&lt;/strong&gt; - Fade in effect&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scale&lt;/strong&gt; - Subtle zoom-in for extra polish&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🎪 Usage in a Scroll-Based Layout
&lt;/h2&gt;

&lt;p&gt;Here's how to integrate it into a scroll-triggered section:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;About&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;scrollRef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;scrollYProgress&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useScroll&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;scrollRef&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;start start&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;end end&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;imageScrollYProgress&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useTransform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;scrollYProgress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;section&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;scrollRef&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;py-16 h-[500vh]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sticky top-0 container mx-auto flex items-center h-screen&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;w-1/2 flex items-center justify-center&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;PixelatedImage&lt;/span&gt;
            &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/your-image.png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
            &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;scrollYProgress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;imageScrollYProgress&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* Your content here */&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/section&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ⚡ Performance Considerations
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;useMemo for Random Values&lt;/strong&gt;: We cache the random initial positions to prevent recalculation on every render.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CSS Grid Over Absolute Positioning&lt;/strong&gt;: CSS Grid is more performant than calculating absolute positions for hundreds of elements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Transform Instead of Layout Properties&lt;/strong&gt;: Using &lt;code&gt;transform&lt;/code&gt; for animations is hardware-accelerated and doesn't trigger layout recalculations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reasonable Grid Size&lt;/strong&gt;: 20x20 (400 pixels) provides good visual quality without overwhelming the browser.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🎨 Customization Ideas
&lt;/h2&gt;

&lt;p&gt;Want to make it your own? Try these variations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Different Grid Sizes&lt;/strong&gt;: Smaller grids (10x10) for a more chunky pixel effect, larger grids (30x30) for smoother transitions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Animation Patterns&lt;/strong&gt;: Instead of sequential, try animating from center outward or in a spiral pattern&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Color Effects&lt;/strong&gt;: Add color transitions or filters during the animation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiple Images&lt;/strong&gt;: Create a slideshow effect with multiple pixelated images&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🚀 Browser Support
&lt;/h2&gt;

&lt;p&gt;This animation works great in all modern browsers that support:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CSS Grid (IE11+)&lt;/li&gt;
&lt;li&gt;CSS Transforms (IE9+)&lt;/li&gt;
&lt;li&gt;ES6 features (or with appropriate polyfills)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🎉 Conclusion
&lt;/h2&gt;

&lt;p&gt;This pixelated image animation is a perfect example of how modern web technologies can create engaging, performant visual effects. The combination of CSS Grid, Framer Motion, and clever mathematical calculations results in an animation that's both visually stunning and technically solid.&lt;/p&gt;

&lt;p&gt;The key takeaways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Break complex animations into smaller, manageable pieces&lt;/li&gt;
&lt;li&gt;Use CSS features like Grid and transforms for performance&lt;/li&gt;
&lt;li&gt;Leverage Framer Motion's scroll-based animations for smooth interactions&lt;/li&gt;
&lt;li&gt;Cache expensive calculations to maintain 60fps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ready to add some pixel magic to your next project? Give it a try and let me know what creative variations you come up with!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Found this helpful? Follow me for more web animation tutorials and React tips! 🚀&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔗 Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.framer.com/motion/" rel="noopener noreferrer"&gt;Framer Motion Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/snippets/css/complete-guide-grid/" rel="noopener noreferrer"&gt;CSS Grid Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://web.dev/animations-guide/" rel="noopener noreferrer"&gt;Web Animation Performance&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>react</category>
      <category>animation</category>
      <category>tailwindcss</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Mobile App with Expo &amp; Firebase Auth - Part 1: Setup</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Sun, 06 Apr 2025 16:33:26 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/mobile-app-with-expo-firebase-auth-part-1-setup-1ki9</link>
      <guid>https://dev.to/devvillmonkiventures/mobile-app-with-expo-firebase-auth-part-1-setup-1ki9</guid>
      <description>&lt;p&gt;In this first post, I'll show you how to set up your Expo project and configure Firebase for authentication.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Create Your Expo Project
&lt;/h2&gt;

&lt;p&gt;Open your terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expo init MyAuthApp
cd MyAuthApp
expo start

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This initializes your project and starts the Expo development server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Set Up Firebase
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Go to the &lt;a href="https://console.firebase.google.com/" rel="noopener noreferrer"&gt;Firebase&lt;/a&gt; Console and create a new project.&lt;/li&gt;
&lt;li&gt;In the Authentication section, enable Email/Password and Google sign-in.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Install Firebase in your project:&lt;br&gt;
&lt;code&gt;npm install firebase&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Create a file named firebaseConfig.js with your Firebase credentials:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import firebase from 'firebase/app';
import 'firebase/auth';

const firebaseConfig = {
  apiKey: "YOUR_API_KEY",
  authDomain: "YOUR_PROJECT_ID.firebaseapp.com",
  // ...other settings
};

if (!firebase.apps.length) {
  firebase.initializeApp(firebaseConfig);
}

export { firebase };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Create an Auth Context
&lt;/h2&gt;

&lt;p&gt;Make a new file called AuthContext.js inside a context folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { createContext, useState, useEffect } from 'react';
import { firebase } from '../firebaseConfig';

export const AuthContext = createContext();

export const AuthProvider = ({ children }) =&amp;gt; {
  const [user, setUser] = useState(null);
  const [loading, setLoading] = useState(true);

  useEffect(() =&amp;gt; {
    const unsubscribe = firebase.auth().onAuthStateChanged(currentUser =&amp;gt; {
      setUser(currentUser);
      setLoading(false);
    });
    return unsubscribe;
  }, []);

  return (
    &amp;lt;AuthContext.Provider value={{ user, loading }}&amp;gt;
      {children}
    &amp;lt;/AuthContext.Provider&amp;gt;
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, wrap your main component with the Auth Provider in App.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import { AuthProvider } from './context/AuthContext';
import Routes from './Routes';

export default function App() {
  return (
    &amp;lt;AuthProvider&amp;gt;
      &amp;lt;Routes /&amp;gt;
    &amp;lt;/AuthProvider&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
In this post, we set up an Expo project, configured Firebase for authentication, and created a simple Auth Context to handle user sessions. Next time, I'll cover building the login and sign-up screens.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>firebase</category>
      <category>mobile</category>
      <category>programming</category>
    </item>
    <item>
      <title>From Full Stack to Full Circle: My Journey Towards Technical Architecture</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Fri, 28 Mar 2025 05:19:55 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/from-full-stack-to-full-circle-my-journey-towards-technical-architecture-51d3</link>
      <guid>https://dev.to/devvillmonkiventures/from-full-stack-to-full-circle-my-journey-towards-technical-architecture-51d3</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;“You’re either building the product… or you’re building yourself while building it.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I’m Vinay, a full-stack engineer from Bengaluru—Node.js, React, and an obsession for clean, scalable systems. But beyond code, my journey is shaped by &lt;em&gt;crossing roles&lt;/em&gt;, &lt;em&gt;carving paths&lt;/em&gt;, and &lt;em&gt;confronting assumptions&lt;/em&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎢 From Developer to Product Whisperer
&lt;/h2&gt;

&lt;p&gt;I started as the typical “heads-down” dev. Feature tickets in, PRs out. But I always found myself asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Why are we building this? Who is this really for?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That curiosity led me to blur the lines between engineering and product ownership. Soon, I was leading conversations—not just commits. I wasn’t just writing logic; I was shaping it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenge?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Earning credibility while wearing multiple hats. When you don’t "look the part," you often have to &lt;em&gt;prove the part&lt;/em&gt; tenfold.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 The Vision Now: Becoming a Technical Architect
&lt;/h2&gt;

&lt;p&gt;My next chapter? Stepping into the shoes of a Technical Architect—someone who can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Design systems that scale,&lt;/li&gt;
&lt;li&gt;Mentor minds that grow,&lt;/li&gt;
&lt;li&gt;And connect business goals with beautiful code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s not just a career pivot—it’s a mindset shift. From “What code solves this?” to “What architecture empowers the team?”&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Lessons I’ve Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Titles follow impact.&lt;/strong&gt; Don’t wait for a designation to lead.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bridge tech and people.&lt;/strong&gt; Code is easy. Communication is the boss level.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mentor as you grow.&lt;/strong&gt; There’s always someone behind you and someone ahead.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  👋 To My Fellow Underdogs
&lt;/h2&gt;

&lt;p&gt;To those underrepresented in tech: &lt;em&gt;You’re not alone&lt;/em&gt;. Visibility matters. Your story matters. And your unique lens can reshape how we build for the world.&lt;/p&gt;

&lt;p&gt;If no one's handing you the blueprint—&lt;em&gt;draw your own.&lt;/em&gt;&lt;/p&gt;




</description>
      <category>devchallenge</category>
      <category>wecoded</category>
      <category>dei</category>
      <category>career</category>
    </item>
    <item>
      <title>Leveraging Currying to Optimize React</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Tue, 16 May 2023 17:51:20 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/leveraging-currying-to-optimize-react-koa</link>
      <guid>https://dev.to/devvillmonkiventures/leveraging-currying-to-optimize-react-koa</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;When working with forms in React, efficient and concise code is essential to improve readability and maintainability. In this article, we'll explore how &lt;a href="https://javascript.info/currying-partials" rel="noopener noreferrer"&gt;currying&lt;/a&gt; can be used to optimize form handling in React components. We'll compare the initial implementation with the optimized version and discuss the benefits of using currying.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Initial Implementation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Initially,we create separate event handler functions for each input field, resulting in repetitive code. While this approach works, it can lead to code duplication and reduced maintainability as the number of form fields increases.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState } from 'react';

function App() {
  const [name, setName] = useState("");
  const [email, setEmail] = useState("");
  const [notes, setNotes] = useState("");

  const handleNameChange = (e) =&amp;gt; {
    setName(e.target.value);
  };

  const handleEmailChange = (e) =&amp;gt; {
    setEmail(e.target.value);
  };

  const handleNotesChange = (e) =&amp;gt; {
    setNotes(e.target.value);
  };

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;input
        type="text"
        value={name}
        onChange={handleNameChange}
        placeholder="Name"
      /&amp;gt;
      &amp;lt;br /&amp;gt;
      &amp;lt;input
        type="email"
        value={email}
        onChange={handleEmailChange}
        placeholder="Email"
      /&amp;gt;
      &amp;lt;br /&amp;gt;
      &amp;lt;textarea
        value={notes}
        onChange={handleNotesChange}
        placeholder="Notes"
      &amp;gt;&amp;lt;/textarea&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Optimized Implementation with Currying&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To optimize the code, we can leverage currying to create a reusable event handler function. Currying allows us to generate specialized event handler functions on the fly by partially applying arguments. Here's the optimized implementation using currying:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Optimized Implementation with Currying
// ...

const handleChange = (stateFunc) =&amp;gt; (e) =&amp;gt; {
  stateFunc(e.target.value);
};

// ...

&amp;lt;input
  type="text"
  value={name}
  onChange={handleChange(setName)}
  placeholder="Name"
/&amp;gt;

// ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above, we define a single &lt;strong&gt;handleChange&lt;/strong&gt; function that takes a &lt;strong&gt;stateFunc&lt;/strong&gt; as an argument. This function returns a new function that is used as the onChange event handler for each input field. By &lt;strong&gt;currying&lt;/strong&gt; the stateFunc, we create specialized event handlers for each input field without duplicating code.&lt;/p&gt;

&lt;p&gt;Check Source Code &lt;a href="https://codesandbox.io/s/crazy-mccarthy-8bxujc?file=/src/App.js" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Benefits of Currying&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Code Reusability&lt;/li&gt;
&lt;li&gt;Concise and Readable Code&lt;/li&gt;
&lt;li&gt;Flexibility and Scalability&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's all, Bye &amp;amp; thanks&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Reload other tabs with a value change in current tab</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Tue, 16 May 2023 17:15:09 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/reload-other-tabs-with-a-value-change-in-current-tab-128b</link>
      <guid>https://dev.to/devvillmonkiventures/reload-other-tabs-with-a-value-change-in-current-tab-128b</guid>
      <description>&lt;p&gt;Have you ever faced the need to reload multiple tabs of your web application after a user changes some settings, like switching their account? One solution to this problem is to use the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage" rel="noopener noreferrer"&gt;localStorage API&lt;/a&gt; to communicate changes across multiple tabs.&lt;/p&gt;

&lt;p&gt;I will explain how to do this in a react application. I'll be explaining in class based component so it will be easily understood.&lt;/p&gt;

&lt;p&gt;Let's consider an example where User is switching his profile, and considering &lt;strong&gt;accountID&lt;/strong&gt; is the unique value which changes on account/profile switch and we will store that in local storage of the browser.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using the Storage Event&lt;/strong&gt;&lt;br&gt;
The &lt;strong&gt;storage&lt;/strong&gt; event is fired on the &lt;strong&gt;window&lt;/strong&gt; object when a key in the localStorage object is updated. You can use it to detect changes in the values stored in localStorage and perform any necessary updates in your application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const accountID = "abc" // getting a new unique account ID
localStorage.setItem('accountID', accountID);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event" rel="noopener noreferrer"&gt;Window: storage event&lt;/a&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The **storage event **is fired on all window objects (i.e., all open tabs), but we only want to handle changes made in the current tab.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class MyComponent extends React.Component {
  componentDidMount() {
    window.addEventListener('storage', this.handleStorageChange);
  }

  componentWillUnmount() {
    window.removeEventListener('storage', this.handleStorageChange);
  }

  handleStorageChange = e =&amp;gt; {
    if (e.storageArea != localStorage) {
      return;
    }
    if (e.key === 'accountID') {
      // Reload all other tabs here
    }
  }

  render() {
    // Your component's rendering logic here
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;strong&gt;Reload&lt;/strong&gt; logic is given below:&lt;/p&gt;

&lt;p&gt;Either you can reload the same page&lt;/p&gt;

&lt;p&gt;&lt;code&gt;window.location.reload();&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;or you can load them back to home page of your app&lt;br&gt;
            &lt;code&gt;window.location.replace(window.siteURL);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;That's all folks you can achieve by doing go. You can replicate the same logic in function based component also.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>react</category>
    </item>
    <item>
      <title>Let's Talk About Intl in JavaScript</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Thu, 11 May 2023 09:17:33 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/introduction-to-intl-in-javascript-4e94</link>
      <guid>https://dev.to/devvillmonkiventures/introduction-to-intl-in-javascript-4e94</guid>
      <description>&lt;p&gt;Are you tired of dealing with pesky internationalization issues in your JavaScript code? Fear not, my friend! The &lt;strong&gt;Intl&lt;/strong&gt; object is here to save the day!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Intl and Why Should You Use It?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Have you ever written code that displayed dates or numbers in a specific format based on the user's locale? It's a common problem when building applications that cater to a global audience. Enter &lt;strong&gt;Intl&lt;/strong&gt;, the savior of internationalization woes!&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Intl&lt;/strong&gt;, you can easily format dates, times, numbers, and currencies in a way that is appropriate for the user's locale. No more manually parsing strings or relying on third-party libraries! And the best part? &lt;strong&gt;Intl&lt;/strong&gt; is built-in to modern browsers, so no need to worry about external dependencies.&lt;/p&gt;

&lt;p&gt;The Intl library provides several classes and methods for i18n, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Intl.Collator&lt;/strong&gt;: used for string comparison&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intl.NumberFormat&lt;/strong&gt;: used for formatting numbers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intl.DateTimeFormat&lt;/strong&gt;: used for formatting dates and times&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intl.PluralRules&lt;/strong&gt;: used for pluralization&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intl.ListFormat&lt;/strong&gt;: used for formatting lists&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Intl.RelativeTimeFormat&lt;/strong&gt;: used for formatting relative time&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How to Use Intl?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Formatting numbers&lt;/strong&gt;&lt;br&gt;
To format a number using &lt;strong&gt;Intl&lt;/strong&gt;, you can create a new &lt;strong&gt;Intl.NumberFormat&lt;/strong&gt; instance and pass in the locale you want to format the number for. Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const number = 123456.789;
const formatter = new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'USD',
});

console.log(formatter.format(number)); // $123,456.79
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Formatting dates&lt;/strong&gt;&lt;br&gt;
To format a date using &lt;strong&gt;Intl&lt;/strong&gt;, you can create a new &lt;strong&gt;Intl.DateTimeFormat&lt;/strong&gt; instance and pass in the locale you want to format the date for. Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const date = new Date();
const formatter = new Intl.DateTimeFormat('en-US', {
  dateStyle: 'medium',
  timeStyle: 'medium',
});

console.log(formatter.format(date)); // May 11, 202
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Why use Intl?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;When building web applications that are meant to be used by people all over the world, it's important to consider the language, cultural norms, and formatting preferences of your users. Using &lt;strong&gt;Intl&lt;/strong&gt; can help you create a more user-friendly experience by providing localized and culturally-appropriate formatting for text, numbers, and dates.&lt;/p&gt;

&lt;p&gt;Here are a few reasons why you might want to use &lt;strong&gt;Intl&lt;/strong&gt; in your web applications:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Improved user experience&lt;/strong&gt;&lt;br&gt;
Using &lt;strong&gt;Intl&lt;/strong&gt; can help create a more seamless and user-friendly experience for your users by providing localized formatting that matches their language and cultural norms. This can help improve user engagement and reduce confusion or frustration caused by unfamiliar formatting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Simplified development&lt;/strong&gt;&lt;br&gt;
Instead of manually implementing complex formatting rules for each language and locale, &lt;strong&gt;Intl&lt;/strong&gt; provides a set of standardized APIs that simplify the process of formatting text, numbers, and dates for different cultures. This can save development time and reduce the likelihood of errors caused by manual formatting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Reduced maintenance&lt;/strong&gt;&lt;br&gt;
By using &lt;strong&gt;Intl&lt;/strong&gt;, you can rely on the library to handle i18n formatting concerns, rather than building and maintaining your own custom formatting solutions. This can reduce the amount of code you need to write and maintain, and help ensure that your application stays up-to-date with changing i18n standards.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Say goodbye to internationalization headaches with &lt;strong&gt;Intl&lt;/strong&gt; in JavaScript! It's a simple and powerful tool that can save you time and frustration in your coding journey. Give it a try and see for yourself! And who knows, maybe one day you'll even get a call from the United Nations thanking you for making their lives easier. Okay, maybe not, but still, it's worth a shot!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>DON'T MAKE ME THINK</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Thu, 25 Feb 2021 19:43:02 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/don-t-make-me-think-11g9</link>
      <guid>https://dev.to/devvillmonkiventures/don-t-make-me-think-11g9</guid>
      <description>&lt;p&gt;&lt;em&gt;Don't Make Me Think is a book by Steve Krug about human-computer interaction and web usability. The book's premise is that a good software program or web site should let users accomplish their intended tasks as easily and directly as possible.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In this blog, I will try to summarize the book in a short and simple way...&lt;/p&gt;

&lt;h1&gt;
  
  
  What is &lt;strong&gt;UX&lt;/strong&gt;?
&lt;/h1&gt;

&lt;p&gt;User experience is about how a user interacts with, and experiences, a particular product, system or service. It includes a person's perceptions of utility, ease of use, and efficiency.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is &lt;strong&gt;UI&lt;/strong&gt;?
&lt;/h1&gt;

&lt;p&gt;In the industrial design field of human-computer interaction, a user interface is a space where interactions between humans and machines occur.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. First Law of Usability&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first view of the website should tell the User what that website is about and what it will do. &lt;/li&gt;
&lt;li&gt;If the website has Navbar in Header or Sidebar, highlight the section to tell the user where they are in the website.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Design for Scanning, not Reading&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;People don't read, they just scan the website. &lt;/li&gt;
&lt;li&gt;So highlight the &lt;strong&gt;Keyword&lt;/strong&gt;. &lt;/li&gt;
&lt;li&gt;Keep the content &lt;em&gt;Short and Simple.&lt;/em&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Make Click mindless&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Try to have minimum clickable as much as possible for a viewport. &lt;/li&gt;
&lt;li&gt;Choose important Key clickables and highlight that more. &lt;/li&gt;
&lt;li&gt; Don't confuse the user with too many interactions. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Less is More&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep a minimum amount of content on a viewport. &lt;/li&gt;
&lt;li&gt;Avoid irrelevant/unnecessary content. &lt;/li&gt;
&lt;li&gt;Avoid instructions on the page.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Help Users to Navigate&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate people around all the pages like a journey from different sections of the web page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. User Testing&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The main step for any development is user testing.&lt;/li&gt;
&lt;li&gt;You develop the webpage by keeping in mind all the above points. &lt;/li&gt;
&lt;li&gt;Later you need to give the webpage for human testing and have to collect their experience details with the website and should improve on those points. &lt;/li&gt;
&lt;li&gt;This step has to be done periodically.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are the above points that I have noted down from the book. Please feel free to improve the content or correct me if I'm wrong. &lt;/p&gt;

&lt;p&gt;Thank you!!!&lt;/p&gt;

</description>
      <category>ux</category>
      <category>webdev</category>
      <category>uiweekly</category>
      <category>design</category>
    </item>
    <item>
      <title>React Ref to add className</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Fri, 30 Oct 2020 14:17:12 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/react-ref-to-add-classname-27nk</link>
      <guid>https://dev.to/devvillmonkiventures/react-ref-to-add-classname-27nk</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Floqu9gk3snppy74fchny.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Floqu9gk3snppy74fchny.png" alt="React" width="512" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hey there React developers! Wanna Know how to add className dynamically with some really cool example? Then you are in right place. Go through the post to understand in-depth.  &lt;/p&gt;

&lt;h3&gt;
  
  
  What is &lt;strong&gt;React&lt;/strong&gt;?
&lt;/h3&gt;

&lt;p&gt;React is a JavaScript library for building user interfaces.&lt;br&gt;
Click &lt;a href="https://reactjs.org/" rel="noopener noreferrer"&gt;here&lt;/a&gt; to know more.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is &lt;strong&gt;React Ref&lt;/strong&gt;?
&lt;/h3&gt;

&lt;p&gt;Refs provide a way to access DOM nodes or React elements created in the render method.&lt;br&gt;
Click &lt;a href="https://reactjs.org/docs/refs-and-the-dom.html#gatsby-focus-wrapper" rel="noopener noreferrer"&gt;here&lt;/a&gt; to know more.&lt;/p&gt;

&lt;p&gt;Let's consider an example where you create a list of buttons using the map function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;buttonsArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Button 1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Button 2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Button 3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;buttonsArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
   &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;   &lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's create &lt;em&gt;ref&lt;/em&gt; to list of buttons. I have created refs as “callback refs”&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;buttonsArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Button 1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Button 2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Button 3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="nx"&gt;buttonsArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buttonElement&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Along with this, you need to declare "this.buttonElement" inside the constructor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buttonElement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now starts the magic, let's consider you have written all the necessary CSS. From the list of buttons, you want the first button to be active on page loading. How to make it? Check the below code... &lt;br&gt;
&lt;em&gt;considering "active" is the CSS className&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nf"&gt;componentDidMount&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buttonElement&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buttonElement&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;active&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also add different styles for all 3 buttons...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nf"&gt;componentDidMount&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buttonElement&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buttonElement&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;active&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buttonElement&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buttonElement&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;foo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buttonElement&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buttonElement&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bar&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Explaination:
&lt;/h4&gt;

&lt;p&gt;'this.buttonElement' is a list of buttons so in order to make the first element to be active we added 'active' className to index=0 element. &lt;/p&gt;

&lt;h4&gt;
  
  
  Extra:
&lt;/h4&gt;

&lt;p&gt;You can also make a click event to the first button.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nf"&gt;componentDidMount&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;buttonElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have need of the above code, then you don't need to add className, because the click event in-turn make the button to active and CSS will take care of that condition.&lt;/p&gt;

&lt;p&gt;Here just to make the code snippet understandable, I have implemented using a button. You can make use of any HTML element or any event.&lt;/p&gt;

&lt;p&gt;Thank You,&lt;/p&gt;

</description>
      <category>react</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Create Your Own Simple Virtual Assistant</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Fri, 17 Jul 2020 20:24:06 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/create-your-own-simple-virtual-assistant-1kfp</link>
      <guid>https://dev.to/devvillmonkiventures/create-your-own-simple-virtual-assistant-1kfp</guid>
      <description>&lt;h1&gt;
  
  
  What is &lt;strong&gt;Virtual Assistant&lt;/strong&gt;?
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Definition&lt;/em&gt;: An intelligent virtual assistant (IVA) or intelligent personal assistant (IPA) is a software agent that can perform tasks or services for an individual based on commands or questions.&lt;/p&gt;

&lt;p&gt;In simple words, it's a set of programs that will do tasks on its own which decreases users work on a machine over a set of commands.&lt;/p&gt;

&lt;p&gt;There are different kinds of Virtual System in the industry for general-purpose, social media, marketing etc.&lt;/p&gt;

&lt;h1&gt;
  
  
  Difference between a &lt;strong&gt;Chatbot&lt;/strong&gt; and &lt;strong&gt;Virtual Assistant&lt;/strong&gt;:
&lt;/h1&gt;

&lt;p&gt;Generally, a chatbot provides service through text message, they possess limited functionality and have no need for high-level algorithms.&lt;br&gt;
On the other hand, Virtual assistants provide a more interactive platform. Virtual assistants provide a more interactive platform. Advanced NLP techniques and other complex algorithms are used.&lt;/p&gt;
&lt;h1&gt;
  
  
  Now what are we building??
&lt;/h1&gt;

&lt;p&gt;Popular Virtual assistants like Alexa from Amazon, Siri from Apple, Cortana from Microsoft make use of highly sophisticated algorithms.&lt;/p&gt;

&lt;p&gt;But I'm going to create a simple virtual assistant for our local machine which can perform simple tasks on my voice command built using basic concepts of &lt;strong&gt;Python&lt;/strong&gt; and using its libraries.&lt;/p&gt;
&lt;h3&gt;
  
  
  Lets get started...
&lt;/h3&gt;

&lt;p&gt;Firstly you need to install python on your machine.&lt;br&gt;
Click &lt;a href="https://www.python.org/downloads/" rel="noopener noreferrer"&gt;here&lt;/a&gt; to download.&lt;br&gt;
I recommend python3.6 or above  &lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Packages&lt;/strong&gt; need to installed:
&lt;/h2&gt;

&lt;p&gt;Open the command prompt and install these packages using the below commands&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install SpeechRecognition
pip install gtts
pip install playsound
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After all the installation we need to download &lt;a href="https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio" rel="noopener noreferrer"&gt;pyaudio&lt;/a&gt;. Open the link and download the file based on your machine. &lt;br&gt;
Set the downloaded file location with pip install&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install 'file name with its absolute path'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So now we are good to go... &lt;br&gt;
Before that, let me explain two major packages that we are using,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://pythonprogramminglanguage.com/speech-recognition/" rel="noopener noreferrer"&gt;Speech Recognition&lt;/a&gt;: This python library converts the spoken words to text. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pypi.org/project/gTTS" rel="noopener noreferrer"&gt;Google Text-to-Speech&lt;/a&gt;: This python library converts text to speech.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Our Implementation Idea:
&lt;/h2&gt;

&lt;p&gt;Using Speech Recognition, we going to convert user voice commands into words and machine perform tasks based on keyword from those converted texts. After performing the task the result is converted into speech using gtts(Google Text-to-Speech) library.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Lets code&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Create a new python file with .py extension.&lt;/p&gt;

&lt;p&gt;First import all the required package&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;speech_recognition&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;sr&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;gtts&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;gTTS&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;playsound&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now will create a listen() function which converts the voice received from microphone into text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Recognizer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;sr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Microphone&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I am listening..&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;audio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;phrase_time_limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;""&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recognize_google&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;audio&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;en-US&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You said:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;sr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;UnknownValueError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I cannot hear you&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;sr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RequestError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Request Failed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After listening, there should be a response, so will create a respond() function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;tts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;gTTS&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;en&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;tts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Speech.mp3&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;playsound&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;playsound&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Speech.mp3&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Speech.mp3&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we need to create our Virtual Assistant. It checks the pattern using &lt;em&gt;if&lt;/em&gt; conditions and performs the set of instructions inside the &lt;em&gt;if&lt;/em&gt; body.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;voice_assistant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Who are you&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;listening&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
        &lt;span class="nf"&gt;respond&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I am your assistant&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;how are you&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;listening&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
        &lt;span class="nf"&gt;respond&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I am well&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;listening&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;UnboundLocalError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;TimedOut--&amp;gt;Re-Launch&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating all the required functions, we need to call those functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;respond&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, What can I do for you?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;listening&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;listening&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;#calling the listen()
&lt;/span&gt;    &lt;span class="n"&gt;listening&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;voice_assistant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can modify the responses and also can build more interactions in voice_assistant() function.&lt;/p&gt;

&lt;p&gt;After this run file by opening command prompt&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python filename.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The overall working, data flow all explained in the below image,&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fopc9qa19egp99f1hpeki.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fopc9qa19egp99f1hpeki.jpg" alt="Alt Text" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let us make our virtual assistant to tell the current date and time So for that, we are importing time module&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ctime&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now add the below if condition in voice_assistant() function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;time&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;listening&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
        &lt;span class="nf"&gt;respond&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;crime&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Get the full code &lt;a href="https://github.com/VinayVeerappaji/My-Virtual-Assitance" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;br&gt;
Try to increase the lively interactions with virtual assistant using more if conditions. &lt;br&gt;
If any doubts feel free to comment down. &lt;br&gt;
&lt;strong&gt;Stay tuned&lt;/strong&gt; to know more what else our virtual assistant can do. &lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>git Cheat Sheet</title>
      <dc:creator>Devvill Monki Ventures</dc:creator>
      <pubDate>Tue, 14 Jul 2020 18:39:18 +0000</pubDate>
      <link>https://dev.to/devvillmonkiventures/git-cheat-sheet-4bg9</link>
      <guid>https://dev.to/devvillmonkiventures/git-cheat-sheet-4bg9</guid>
      <description>&lt;h1&gt;
  
  
  What is git?
&lt;/h1&gt;

&lt;p&gt;Git is a version control management system.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why git?
&lt;/h1&gt;

&lt;p&gt;Git helps in keeping track of changes made to code.&lt;br&gt;&lt;br&gt;
   It also synchronize code between different people.&lt;br&gt;&lt;br&gt;
   Helps in testing the changes to code without losing the &lt;br&gt;
   original.&lt;br&gt;&lt;br&gt;
   Able to revert back to any older versions of code. &lt;/p&gt;

&lt;h1&gt;
  
  
  What is GitHub?
&lt;/h1&gt;

&lt;p&gt;GitHub is a online platform which allows to store git &lt;br&gt;
   repositories.&lt;br&gt;
   There are other websites like GitHub such as Gitlab, &lt;br&gt;
   BitBucket, GitBucket etc.. &lt;/p&gt;

&lt;h1&gt;
  
  
  What is Repository?
&lt;/h1&gt;

&lt;p&gt;Repository is simply a place to keep track of code and all &lt;br&gt;
   the changes to code.&lt;br&gt;
   There are two kinds of repositories, &lt;strong&gt;Local&lt;/strong&gt; and &lt;br&gt;
   &lt;strong&gt;Remote&lt;/strong&gt;. &lt;strong&gt;Local repository&lt;/strong&gt; is the one that is in your &lt;br&gt;
   local machine and &lt;strong&gt;Remote repository&lt;/strong&gt; is stored on a server like github.  &lt;/p&gt;

&lt;h1&gt;
  
  
  Now will jump into &lt;strong&gt;Git commands&lt;/strong&gt;
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git clone 'url'&lt;/code&gt; : downloads the remote repository from server into the local machine &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git init&lt;/code&gt; : to initialize git to the current working directory&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git status&lt;/code&gt; : shows the current activity on the repository&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git add 'filename' // 'filenames' // '.'&lt;/code&gt;: add the files to staging area which needs to be included in the next commit&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git commit -m "message"&lt;/code&gt;: saves the changes made to the repository with the message&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git push&lt;/code&gt; : pushes local repository to remote repository&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git pull&lt;/code&gt; : pulls remote repository to local repository 
(for any remote changes)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git log&lt;/code&gt; : lists all the commits that have been made to the repository&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git reset --hard 'commit'&lt;/code&gt; : revert backs the repository to the given commit&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git branch 'branch name'&lt;/code&gt; : creates a new branch &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git checkout 'branch name'&lt;/code&gt; : to switch between the branches of the repository&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git merge&lt;/code&gt;: to merge the branch and master
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Still there are other git commands but I listed down some of the important and commonly used.&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>githunt</category>
    </item>
  </channel>
</rss>
