<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Brittney Spalding</title>
        <link>https://paragraph.com/@brittney-spalding-2</link>
        <description>I delivered effective production to 4+ companies, from startups to Fortune 500s, with a focus on development Web/Mobile project.</description>
        <lastBuildDate>Sun, 19 Jul 2026 01:20:51 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Brittney Spalding</title>
            <url>https://storage.googleapis.com/papyrus_images/e0a4744cb4b2a1a7604bd7caf3fa253c6f64f78694dc4c1465d9d2f20498d83e.jpg</url>
            <link>https://paragraph.com/@brittney-spalding-2</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Streamlining Fade-In Animations in React UI Development]]></title>
            <link>https://paragraph.com/@brittney-spalding-2/streamlining-fade-in-animations-in-react-ui-development</link>
            <guid>eVwQSktiBXAw2esFuCCx</guid>
            <pubDate>Thu, 16 Nov 2023 20:49:58 GMT</pubDate>
            <description><![CDATA[IntroductionFade-in animations can significantly enhance the user experience by introducing elements gracefully into the UI. In React development, creating reusable components can streamline the process and maintain code consistency across a project. In this article, we&apos;ll explore a concise method using React, Framer Motion, and Intersection Observer to achieve a reusable fade-in animation component.Code BreakdownThe FadeIn component is designed to animate its children by fading them in ...]]></description>
            <content:encoded><![CDATA[<h2 id="h-introduction" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Introduction</strong></h2><p>Fade-in animations can significantly enhance the user experience by introducing elements gracefully into the UI. In React development, creating reusable components can streamline the process and maintain code consistency across a project. In this article, we&apos;ll explore a concise method using React, Framer Motion, and Intersection Observer to achieve a reusable fade-in animation component.</p><h2 id="h-code-breakdown" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Code Breakdown</strong></h2><p>The FadeIn component is designed to animate its children by fading them in as they become visible in the viewport. Here&apos;s a breakdown of the key components and their roles:</p><p><strong>Dependencies</strong>: The component imports necessary dependencies such as motion and useAnimation from Framer Motion, as well as useInView from react-intersection-observer.</p><p><strong>Props</strong>: The FadeIn component accepts three props:</p><ul><li><p>children: Represents the content or elements to be faded in.</p></li><li><p>className: Allows for additional styling.</p></li><li><p>checkInView: A boolean flag to determine if the animation should occur when the element is in view. Logic:</p></li></ul><p><strong>useAnimation</strong>: Initializes animation controls provided by Framer Motion.</p><p><strong>useInView</strong>: Provides a reference and a boolean flag (inView) to detect if the component is in the viewport.</p><p><strong>useEffect</strong>: Triggers the animation when the component enters the viewport (inView) or based on the checkInView prop.</p><p><strong>Motion Component</strong>: Utilizes motion.div from Framer Motion to wrap the children. Animates the element&apos;s opacity and y-axis position (from a hidden state off the screen to visible).</p><h2 id="h-implementation" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Implementation</strong></h2><p>Developers can easily implement the <code>FadeIn</code> component by following these steps:</p><ol><li><p><strong>Import the Component:</strong> Import the <code>FadeIn</code> component into your React project where you wish to apply fade-in animations.</p></li><li><p><strong>Usage:</strong> Use the <code>FadeIn</code> component and pass the elements you want to animate as its children.</p></li></ol><pre data-type="codeBlock" text="import FadeIn from &apos;./FadeInComponentPath&apos;;

const MyComponent = () =&gt; {
  return (
    &lt;div&gt;
      &lt;FadeIn&gt;
        {/* Elements to be faded in */}
        &lt;h1&gt;Your Content Here&lt;/h1&gt;
        &lt;p&gt;Additional elements&lt;/p&gt;
      &lt;/FadeIn&gt;
    &lt;/div&gt;
  );
};
"><code><span class="hljs-keyword">import</span> <span class="hljs-title">FadeIn</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">'./FadeInComponentPath'</span>;

const MyComponent <span class="hljs-operator">=</span> () <span class="hljs-operator">=</span><span class="hljs-operator">></span> {
  <span class="hljs-keyword">return</span> (
    <span class="hljs-operator">&#x3C;</span>div<span class="hljs-operator">></span>
      <span class="hljs-operator">&#x3C;</span>FadeIn<span class="hljs-operator">></span>
        {<span class="hljs-comment">/* Elements to be faded in */</span>}
        <span class="hljs-operator">&#x3C;</span>h1<span class="hljs-operator">></span>Your Content Here<span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span>h1<span class="hljs-operator">></span>
        <span class="hljs-operator">&#x3C;</span>p<span class="hljs-operator">></span>Additional elements<span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span>p<span class="hljs-operator">></span>
      <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span>FadeIn<span class="hljs-operator">></span>
    <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span>div<span class="hljs-operator">></span>
  );
};
</code></pre><ol><li><p><strong>Customization:</strong> Customize the animation by adjusting the <code>transition</code> duration, variants, or additional styling via the <code>className</code> prop.</p></li></ol><h2 id="h-conclusion" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Conclusion</strong></h2><p>Implementing reusable components like the FadeIn component not only simplifies the integration of animations but also promotes maintainability and consistency within a React application. This approach empowers React UI developers to create engaging user experiences with minimal code repetition.</p><p>By leveraging the power of React, Framer Motion, and Intersection Observer, developers can effortlessly incorporate subtle yet impactful animations into their projects, enhancing the overall aesthetics and usability of their applications.</p><p>Feel free to integrate this FadeIn component into your React projects and explore its adaptability to different UI elements, bringing life to your user interfaces through elegant fade-in animations.</p><h2 id="h-codebase" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0"><strong>Codebase</strong></h2><pre data-type="codeBlock" text="import { motion, useAnimation } from &quot;framer-motion&quot;
import { useInView } from &quot;react-intersection-observer&quot;
import { FC, useEffect } from &quot;react&quot;

interface FadeInProps {
  children: any
  className?: string
  checkInview?: boolean
}

const FadeIn: FC&lt;FadeInProps&gt; = ({ children, className = &quot;&quot;, checkInview = true }) =&gt; {
  const controls = useAnimation()
  const [ref, inView] = useInView()

  useEffect(() =&gt; {
    if (inView || !checkInview) {
      controls.start(&quot;visible&quot;)
      return
    }

    controls.start(&quot;hidden&quot;)
  }, [controls, inView, checkInview])

  return (
    &lt;motion.div
      ref={ref}
      animate={controls}
      initial=&quot;hidden&quot;
      transition={{ duration: 0.5 }}
      variants={{
        visible: { opacity: 1, y: 0 },
        hidden: { opacity: 0, y: 100 },
      }}
      className={`w-full ${className}`}
    &gt;
      {children}
    &lt;/motion.div&gt;
  )
}

export default FadeIn
"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">motion</span>, <span class="hljs-title">useAnimation</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"framer-motion"</span>
<span class="hljs-title"><span class="hljs-keyword">import</span></span> { <span class="hljs-title">useInView</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"react-intersection-observer"</span>
<span class="hljs-title"><span class="hljs-keyword">import</span></span> { <span class="hljs-title">FC</span>, <span class="hljs-title">useEffect</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"react"</span>

<span class="hljs-title"><span class="hljs-keyword">interface</span></span> <span class="hljs-title">FadeInProps</span> {
  <span class="hljs-title">children</span>: <span class="hljs-title">any</span>
  <span class="hljs-title">className</span>?: <span class="hljs-title"><span class="hljs-keyword">string</span></span>
  <span class="hljs-title">checkInview</span>?: <span class="hljs-title">boolean</span>
}

<span class="hljs-title">const</span> <span class="hljs-title">FadeIn</span>: <span class="hljs-title">FC</span><span class="hljs-operator">&#x3C;</span><span class="hljs-title">FadeInProps</span><span class="hljs-operator">></span> <span class="hljs-operator">=</span> ({ <span class="hljs-title">children</span>, <span class="hljs-title">className</span> <span class="hljs-operator">=</span> <span class="hljs-string">""</span>, <span class="hljs-title">checkInview</span> <span class="hljs-operator">=</span> <span class="hljs-title"><span class="hljs-literal">true</span></span> }) <span class="hljs-operator">=</span><span class="hljs-operator">></span> {
  <span class="hljs-title">const</span> <span class="hljs-title">controls</span> <span class="hljs-operator">=</span> <span class="hljs-title">useAnimation</span>()
  <span class="hljs-title">const</span> [<span class="hljs-title">ref</span>, <span class="hljs-title">inView</span>] <span class="hljs-operator">=</span> <span class="hljs-title">useInView</span>()

  <span class="hljs-title">useEffect</span>(() <span class="hljs-operator">=</span><span class="hljs-operator">></span> {
    <span class="hljs-title"><span class="hljs-keyword">if</span></span> (<span class="hljs-title">inView</span> <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-operator">!</span><span class="hljs-title">checkInview</span>) {
      <span class="hljs-title">controls</span>.<span class="hljs-title">start</span>(<span class="hljs-string">"visible"</span>)
      <span class="hljs-title"><span class="hljs-keyword">return</span></span>
    }

    <span class="hljs-title">controls</span>.<span class="hljs-title">start</span>(<span class="hljs-string">"hidden"</span>)
  }, [<span class="hljs-title">controls</span>, <span class="hljs-title">inView</span>, <span class="hljs-title">checkInview</span>])

  <span class="hljs-title"><span class="hljs-keyword">return</span></span> (
    <span class="hljs-operator">&#x3C;</span><span class="hljs-title">motion</span>.<span class="hljs-title">div</span>
      <span class="hljs-title">ref</span><span class="hljs-operator">=</span>{<span class="hljs-title">ref</span>}
      <span class="hljs-title">animate</span><span class="hljs-operator">=</span>{<span class="hljs-title">controls</span>}
      <span class="hljs-title">initial</span><span class="hljs-operator">=</span><span class="hljs-string">"hidden"</span>
      <span class="hljs-title">transition</span><span class="hljs-operator">=</span>{{ <span class="hljs-title">duration</span>: 0.5 }}
      <span class="hljs-title">variants</span><span class="hljs-operator">=</span>{{
        <span class="hljs-title">visible</span>: { <span class="hljs-title">opacity</span>: 1, <span class="hljs-title">y</span>: 0 },
        <span class="hljs-title">hidden</span>: { <span class="hljs-title">opacity</span>: 0, <span class="hljs-title">y</span>: 100 },
      }}
      <span class="hljs-title">className</span><span class="hljs-operator">=</span>{`<span class="hljs-title">w</span><span class="hljs-operator">-</span><span class="hljs-title">full</span> <span class="hljs-title">$</span>{<span class="hljs-title">className</span>}`}
    <span class="hljs-operator">></span>
      {<span class="hljs-title">children</span>}
    <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span><span class="hljs-title">motion</span>.<span class="hljs-title">div</span><span class="hljs-operator">></span>
  )
}

<span class="hljs-title">export</span> <span class="hljs-title">default</span> <span class="hljs-title">FadeIn</span>
</code></pre>]]></content:encoded>
            <author>brittney-spalding-2@newsletter.paragraph.com (Brittney Spalding)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/f7beba6a153a7609f9867c16efb7508f1415f657216dc1956bae475d22b980bd.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Hook Pulse Effect (2)]]></title>
            <link>https://paragraph.com/@brittney-spalding-2/hook-pulse-effect-2</link>
            <guid>I2eJzfmlBj1w4USaqd9J</guid>
            <pubDate>Tue, 07 Nov 2023 16:45:12 GMT</pubDate>
            <description><![CDATA[This is second part for the pulse EffectButton CSS/* Pulse Effect */ .pulse__effect { animation: pulse-effect 1s ease-out; } @keyframes pulse-effect { 0% { opacity: 0.2; height: 0px; width: 0px; } 100% { opacity: 0; height: 400px; width: 400px; } } Usageimport { FC, LegacyRef, ReactNode, useRef } from "react" import usePulseEffect from "./usePulseEffect" interface ButtonProps { id: string refP?: Element children?: ReactNode className?: string type?: "button" | "submit" | "reset" | undefined p...]]></description>
            <content:encoded><![CDATA[<p><strong>This is second part for the pulse Effect</strong></p><ul><li><p><strong>Button CSS</strong></p></li></ul><pre data-type="codeBlock" text="/* Pulse Effect */
.pulse__effect {
  animation: pulse-effect 1s ease-out;
}

@keyframes pulse-effect {
  0% {
    opacity: 0.2;
    height: 0px;
    width: 0px;
  }
  100% {
    opacity: 0;
    height: 400px;
    width: 400px;
  }
}
"><code><span class="hljs-comment">/* Pulse Effect */</span>
<span class="hljs-selector-class">.pulse__effect</span> {
  <span class="hljs-attribute">animation</span>: pulse-effect <span class="hljs-number">1s</span> ease-out;
}

<span class="hljs-keyword">@keyframes</span> pulse-effect {
  <span class="hljs-number">0%</span> {
    <span class="hljs-attribute">opacity</span>: <span class="hljs-number">0.2</span>;
    <span class="hljs-attribute">height</span>: <span class="hljs-number">0px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">0px</span>;
  }
  <span class="hljs-number">100%</span> {
    <span class="hljs-attribute">opacity</span>: <span class="hljs-number">0</span>;
    <span class="hljs-attribute">height</span>: <span class="hljs-number">400px</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">400px</span>;
  }
}
</code></pre><ul><li><p><strong>Usage</strong></p></li></ul><pre data-type="codeBlock" text="import { FC, LegacyRef, ReactNode, useRef } from &quot;react&quot;
import usePulseEffect from &quot;./usePulseEffect&quot;

interface ButtonProps {
  id: string
  refP?: Element
  children?: ReactNode
  className?: string
  type?: &quot;button&quot; | &quot;submit&quot; | &quot;reset&quot; | undefined
  pulseColor?: string
  onClick?: (e: any) =&gt; void
  disabled?: boolean
}

const Button: FC&lt;ButtonProps&gt; = ({
  id,
  refP,
  children,
  pulseColor,
  className,
  onClick,
  ...rest
}) =&gt; {
  const elementRef = useRef()
  const ref = useRef()
  const pulseRef = useRef()

  usePulseEffect({
    ref,
    pulseRef,
    pulseColor,
  })

  return (
    &lt;button
      ref={ref}
      id={id}
      type=&quot;button&quot;
      className={`transition duration-[300ms] 
          rounded-[30px] text-[white]
          relative
          overflow-hidden
          ${className || &quot;&quot;}`}
      onClick={onClick}
      {...rest}
    &gt;
      &lt;div
        className={`absolute
        z-[0] left-[-5px] top-[-5px]
        rounded-[50%]
        translate-x-[-50%]
        translate-y-[-50%]
        w-[0px] h-[0px]`}
        ref={pulseRef}
      /&gt;
      &lt;div
        ref={(refP as unknown as LegacyRef&lt;HTMLDivElement&gt;) || elementRef}
        className=&quot;
      z-[3] w-full
      flex items-center justify-center
      gap-[10px]&quot;
      &gt;
        {children}
      &lt;/div&gt;
    &lt;/button&gt;
  )
}

export default Button
"><code><span class="hljs-keyword">import</span> { <span class="hljs-title">FC</span>, <span class="hljs-title">LegacyRef</span>, <span class="hljs-title">ReactNode</span>, <span class="hljs-title">useRef</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"react"</span>
<span class="hljs-title"><span class="hljs-keyword">import</span></span> <span class="hljs-title">usePulseEffect</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"./usePulseEffect"</span>

<span class="hljs-title"><span class="hljs-keyword">interface</span></span> <span class="hljs-title">ButtonProps</span> {
  <span class="hljs-title">id</span>: <span class="hljs-title"><span class="hljs-keyword">string</span></span>
  <span class="hljs-title">refP</span>?: <span class="hljs-title">Element</span>
  <span class="hljs-title">children</span>?: <span class="hljs-title">ReactNode</span>
  <span class="hljs-title">className</span>?: <span class="hljs-title"><span class="hljs-keyword">string</span></span>
  <span class="hljs-title"><span class="hljs-keyword">type</span></span>?: <span class="hljs-string">"button"</span> <span class="hljs-operator">|</span> <span class="hljs-string">"submit"</span> <span class="hljs-operator">|</span> <span class="hljs-string">"reset"</span> <span class="hljs-operator">|</span> <span class="hljs-title">undefined</span>
  <span class="hljs-title">pulseColor</span>?: <span class="hljs-title"><span class="hljs-keyword">string</span></span>
  <span class="hljs-title">onClick</span>?: (<span class="hljs-title">e</span>: <span class="hljs-title">any</span>) <span class="hljs-operator">=</span><span class="hljs-operator">></span> <span class="hljs-title">void</span>
  <span class="hljs-title">disabled</span>?: <span class="hljs-title">boolean</span>
}

<span class="hljs-title">const</span> <span class="hljs-title">Button</span>: <span class="hljs-title">FC</span><span class="hljs-operator">&#x3C;</span><span class="hljs-title">ButtonProps</span><span class="hljs-operator">></span> <span class="hljs-operator">=</span> ({
  <span class="hljs-title">id</span>,
  <span class="hljs-title">refP</span>,
  <span class="hljs-title">children</span>,
  <span class="hljs-title">pulseColor</span>,
  <span class="hljs-title">className</span>,
  <span class="hljs-title">onClick</span>,
  ...<span class="hljs-title">rest</span>
}) <span class="hljs-operator">=</span><span class="hljs-operator">></span> {
  <span class="hljs-title">const</span> <span class="hljs-title">elementRef</span> <span class="hljs-operator">=</span> <span class="hljs-title">useRef</span>()
  <span class="hljs-title">const</span> <span class="hljs-title">ref</span> <span class="hljs-operator">=</span> <span class="hljs-title">useRef</span>()
  <span class="hljs-title">const</span> <span class="hljs-title">pulseRef</span> <span class="hljs-operator">=</span> <span class="hljs-title">useRef</span>()

  <span class="hljs-title">usePulseEffect</span>({
    <span class="hljs-title">ref</span>,
    <span class="hljs-title">pulseRef</span>,
    <span class="hljs-title">pulseColor</span>,
  })

  <span class="hljs-title"><span class="hljs-keyword">return</span></span> (
    <span class="hljs-operator">&#x3C;</span><span class="hljs-title">button</span>
      <span class="hljs-title">ref</span><span class="hljs-operator">=</span>{<span class="hljs-title">ref</span>}
      <span class="hljs-title">id</span><span class="hljs-operator">=</span>{<span class="hljs-title">id</span>}
      <span class="hljs-title"><span class="hljs-keyword">type</span></span><span class="hljs-operator">=</span><span class="hljs-string">"button"</span>
      <span class="hljs-title">className</span><span class="hljs-operator">=</span>{`<span class="hljs-title">transition</span> <span class="hljs-title">duration</span><span class="hljs-operator">-</span>[300<span class="hljs-title">ms</span>] 
          <span class="hljs-title">rounded</span><span class="hljs-operator">-</span>[30<span class="hljs-title">px</span>] <span class="hljs-title">text</span><span class="hljs-operator">-</span>[<span class="hljs-title">white</span>]
          <span class="hljs-title">relative</span>
          <span class="hljs-title">overflow</span><span class="hljs-operator">-</span><span class="hljs-title">hidden</span>
          <span class="hljs-title">$</span>{<span class="hljs-title">className</span> <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-string">""</span>}`}
      <span class="hljs-title">onClick</span><span class="hljs-operator">=</span>{<span class="hljs-title">onClick</span>}
      {...<span class="hljs-title">rest</span>}
    <span class="hljs-operator">></span>
      <span class="hljs-operator">&#x3C;</span><span class="hljs-title">div</span>
        <span class="hljs-title">className</span><span class="hljs-operator">=</span>{`<span class="hljs-title">absolute</span>
        <span class="hljs-title">z</span><span class="hljs-operator">-</span>[0] <span class="hljs-title">left</span><span class="hljs-operator">-</span>[<span class="hljs-operator">-</span>5<span class="hljs-title">px</span>] <span class="hljs-title">top</span><span class="hljs-operator">-</span>[<span class="hljs-operator">-</span>5<span class="hljs-title">px</span>]
        <span class="hljs-title">rounded</span><span class="hljs-operator">-</span>[50<span class="hljs-operator">%</span>]
        <span class="hljs-title">translate</span><span class="hljs-operator">-</span><span class="hljs-title">x</span><span class="hljs-operator">-</span>[<span class="hljs-operator">-</span>50<span class="hljs-operator">%</span>]
        <span class="hljs-title">translate</span><span class="hljs-operator">-</span><span class="hljs-title">y</span><span class="hljs-operator">-</span>[<span class="hljs-operator">-</span>50<span class="hljs-operator">%</span>]
        <span class="hljs-title">w</span><span class="hljs-operator">-</span>[0<span class="hljs-title">px</span>] <span class="hljs-title">h</span><span class="hljs-operator">-</span>[0<span class="hljs-title">px</span>]`}
        <span class="hljs-title">ref</span><span class="hljs-operator">=</span>{<span class="hljs-title">pulseRef</span>}
      <span class="hljs-operator">/</span><span class="hljs-operator">></span>
      <span class="hljs-operator">&#x3C;</span><span class="hljs-title">div</span>
        <span class="hljs-title">ref</span><span class="hljs-operator">=</span>{(<span class="hljs-title">refP</span> <span class="hljs-title"><span class="hljs-keyword">as</span></span> <span class="hljs-title">unknown</span> <span class="hljs-title"><span class="hljs-keyword">as</span></span> <span class="hljs-title">LegacyRef</span><span class="hljs-operator">&#x3C;</span><span class="hljs-title">HTMLDivElement</span><span class="hljs-operator">></span>) <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-title">elementRef</span>}
        <span class="hljs-title">className</span><span class="hljs-operator">=</span><span class="hljs-string">"
      z-[3] w-full
      flex items-center justify-center
      gap-[10px]"</span>
      <span class="hljs-operator">></span>
        {<span class="hljs-title">children</span>}
      <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span><span class="hljs-title">div</span><span class="hljs-operator">></span>
    <span class="hljs-operator">&#x3C;</span><span class="hljs-operator">/</span><span class="hljs-title">button</span><span class="hljs-operator">></span>
  )
}

<span class="hljs-title">export</span> <span class="hljs-title">default</span> <span class="hljs-title">Button</span>
</code></pre>]]></content:encoded>
            <author>brittney-spalding-2@newsletter.paragraph.com (Brittney Spalding)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/62fe27090d9d9cf8f695518d9f05361adefdcb47bb9dda76535a6f58488ac383.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Hook Pulse Effect(1)]]></title>
            <link>https://paragraph.com/@brittney-spalding-2/hook-pulse-effect-1</link>
            <guid>kZnw2AWlhc4PgQl9oVKh</guid>
            <pubDate>Tue, 07 Nov 2023 16:43:56 GMT</pubDate>
            <description><![CDATA[/* eslint-disable-next-line no-param-reassign */ import React, { useEffect } from "react" import styles from "./Button.module.css" interface Props { ref?: React.RefObject&#x3C;HTMLButtonElement> pulseRef?: React.RefObject&#x3C;HTMLDivElement> pulseColor?: string } const usePulseEffect = ({ ref, pulseRef, pulseColor }: Props) => { useEffect(() => { const handleMouseClick = async (event: any) => { pulseRef.current.classList.remove(styles.pulse__effect) const posX = event?.clientX const posY = e...]]></description>
            <content:encoded><![CDATA[<pre data-type="codeBlock" text="/* eslint-disable-next-line no-param-reassign */
import React, { useEffect } from &quot;react&quot;
import styles from &quot;./Button.module.css&quot;

interface Props {
  ref?: React.RefObject&lt;HTMLButtonElement&gt;
  pulseRef?: React.RefObject&lt;HTMLDivElement&gt;
  pulseColor?: string
}

const usePulseEffect = ({ ref, pulseRef, pulseColor }: Props) =&gt; {
  useEffect(() =&gt; {
    const handleMouseClick = async (event: any) =&gt; {
      pulseRef.current.classList.remove(styles.pulse__effect)
      const posX = event?.clientX
      const posY = event?.clientY

      const topY = ref.current.getBoundingClientRect().top
      const leftX = ref.current.getBoundingClientRect().left

      const offsetX = posX - leftX
      const offsetY = posY - topY

      pulseRef.current.style.left = `${offsetX}px`
      pulseRef.current.style.top = `${offsetY}px`
      pulseRef.current.style.backgroundColor = pulseColor || &quot;white&quot;

      pulseRef.current.classList.add(styles.pulse__effect)
    }

    if (ref?.current &amp;&amp; pulseRef?.current) {
      ref.current.removeEventListener(&quot;click&quot;, handleMouseClick)
      ref.current.addEventListener(&quot;click&quot;, handleMouseClick)
    }
  }, [ref, pulseRef])
}

export default usePulseEffect
"><code><span class="hljs-comment">/* eslint-disable-next-line no-param-reassign */</span>
<span class="hljs-keyword">import</span> <span class="hljs-title">React</span>, { <span class="hljs-title">useEffect</span> } <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"react"</span>
<span class="hljs-title"><span class="hljs-keyword">import</span></span> <span class="hljs-title">styles</span> <span class="hljs-title"><span class="hljs-keyword">from</span></span> <span class="hljs-string">"./Button.module.css"</span>

<span class="hljs-title"><span class="hljs-keyword">interface</span></span> <span class="hljs-title">Props</span> {
  <span class="hljs-title">ref</span>?: <span class="hljs-title">React</span>.<span class="hljs-title">RefObject</span><span class="hljs-operator">&#x3C;</span><span class="hljs-title">HTMLButtonElement</span><span class="hljs-operator">></span>
  <span class="hljs-title">pulseRef</span>?: <span class="hljs-title">React</span>.<span class="hljs-title">RefObject</span><span class="hljs-operator">&#x3C;</span><span class="hljs-title">HTMLDivElement</span><span class="hljs-operator">></span>
  <span class="hljs-title">pulseColor</span>?: <span class="hljs-title"><span class="hljs-keyword">string</span></span>
}

<span class="hljs-title">const</span> <span class="hljs-title">usePulseEffect</span> <span class="hljs-operator">=</span> ({ <span class="hljs-title">ref</span>, <span class="hljs-title">pulseRef</span>, <span class="hljs-title">pulseColor</span> }: <span class="hljs-title">Props</span>) <span class="hljs-operator">=</span><span class="hljs-operator">></span> {
  <span class="hljs-title">useEffect</span>(() <span class="hljs-operator">=</span><span class="hljs-operator">></span> {
    <span class="hljs-title">const</span> <span class="hljs-title">handleMouseClick</span> <span class="hljs-operator">=</span> <span class="hljs-title">async</span> (<span class="hljs-title"><span class="hljs-keyword">event</span></span>: <span class="hljs-title">any</span>) <span class="hljs-operator">=</span><span class="hljs-operator">></span> {
      <span class="hljs-title">pulseRef</span>.<span class="hljs-title">current</span>.<span class="hljs-title">classList</span>.<span class="hljs-title">remove</span>(<span class="hljs-title">styles</span>.<span class="hljs-title">pulse__effect</span>)
      <span class="hljs-title">const</span> <span class="hljs-title">posX</span> <span class="hljs-operator">=</span> <span class="hljs-title"><span class="hljs-keyword">event</span></span>?.<span class="hljs-title">clientX</span>
      <span class="hljs-title">const</span> <span class="hljs-title">posY</span> <span class="hljs-operator">=</span> <span class="hljs-title"><span class="hljs-keyword">event</span></span>?.<span class="hljs-title">clientY</span>

      <span class="hljs-title">const</span> <span class="hljs-title">topY</span> <span class="hljs-operator">=</span> <span class="hljs-title">ref</span>.<span class="hljs-title">current</span>.<span class="hljs-title">getBoundingClientRect</span>().<span class="hljs-title">top</span>
      <span class="hljs-title">const</span> <span class="hljs-title">leftX</span> <span class="hljs-operator">=</span> <span class="hljs-title">ref</span>.<span class="hljs-title">current</span>.<span class="hljs-title">getBoundingClientRect</span>().<span class="hljs-title">left</span>

      <span class="hljs-title">const</span> <span class="hljs-title">offsetX</span> <span class="hljs-operator">=</span> <span class="hljs-title">posX</span> <span class="hljs-operator">-</span> <span class="hljs-title">leftX</span>
      <span class="hljs-title">const</span> <span class="hljs-title">offsetY</span> <span class="hljs-operator">=</span> <span class="hljs-title">posY</span> <span class="hljs-operator">-</span> <span class="hljs-title">topY</span>

      <span class="hljs-title">pulseRef</span>.<span class="hljs-title">current</span>.<span class="hljs-title">style</span>.<span class="hljs-title">left</span> <span class="hljs-operator">=</span> `<span class="hljs-title">$</span>{<span class="hljs-title">offsetX</span>}<span class="hljs-title">px</span>`
      <span class="hljs-title">pulseRef</span>.<span class="hljs-title">current</span>.<span class="hljs-title">style</span>.<span class="hljs-title">top</span> <span class="hljs-operator">=</span> `<span class="hljs-title">$</span>{<span class="hljs-title">offsetY</span>}<span class="hljs-title">px</span>`
      <span class="hljs-title">pulseRef</span>.<span class="hljs-title">current</span>.<span class="hljs-title">style</span>.<span class="hljs-title">backgroundColor</span> <span class="hljs-operator">=</span> <span class="hljs-title">pulseColor</span> <span class="hljs-operator">|</span><span class="hljs-operator">|</span> <span class="hljs-string">"white"</span>

      <span class="hljs-title">pulseRef</span>.<span class="hljs-title">current</span>.<span class="hljs-title">classList</span>.<span class="hljs-title">add</span>(<span class="hljs-title">styles</span>.<span class="hljs-title">pulse__effect</span>)
    }

    <span class="hljs-title"><span class="hljs-keyword">if</span></span> (<span class="hljs-title">ref</span>?.<span class="hljs-title">current</span> <span class="hljs-operator">&#x26;</span><span class="hljs-operator">&#x26;</span> <span class="hljs-title">pulseRef</span>?.<span class="hljs-title">current</span>) {
      <span class="hljs-title">ref</span>.<span class="hljs-title">current</span>.<span class="hljs-title">removeEventListener</span>(<span class="hljs-string">"click"</span>, <span class="hljs-title">handleMouseClick</span>)
      <span class="hljs-title">ref</span>.<span class="hljs-title">current</span>.<span class="hljs-title">addEventListener</span>(<span class="hljs-string">"click"</span>, <span class="hljs-title">handleMouseClick</span>)
    }
  }, [<span class="hljs-title">ref</span>, <span class="hljs-title">pulseRef</span>])
}

<span class="hljs-title">export</span> <span class="hljs-title">default</span> <span class="hljs-title">usePulseEffect</span>
</code></pre><p><strong>I shared this codebase to support core UI development of frontend engineers.I will continue to post in the next entry.</strong></p>]]></content:encoded>
            <author>brittney-spalding-2@newsletter.paragraph.com (Brittney Spalding)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/62fe27090d9d9cf8f695518d9f05361adefdcb47bb9dda76535a6f58488ac383.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[ERC721 Mint by Crossmint]]></title>
            <link>https://paragraph.com/@brittney-spalding-2/erc721-mint-by-crossmint</link>
            <guid>m6hjavtHNUG4PMYJBqbk</guid>
            <pubDate>Tue, 07 Nov 2023 16:40:13 GMT</pubDate>
            <description><![CDATA[React Componentimport { CrossmintPayButton } from "@crossmint/client-sdk-react-ui" import { FC } from "react" export const ERC6551_REGISTRY_ADDRESS = "0x02101dfB77FDE026414827Fdc604ddAF224F0921" export const ERC6551_IMPLEMENTATION_ADDRESS = "0x2d25602551487c3f3354dd80d76d54383a243358" export const ERC6551_INIT_DATA = "0x8129fc1c" interface CrossmintButtonProps { wallet: string quantity: number } const CrossmintButton: FC&#x3C;CrossmintButtonProps> = ({ wallet, quantity }) => { const { referra...]]></description>
            <content:encoded><![CDATA[<ul><li><p><strong>React Component</strong></p></li></ul><pre data-type="codeBlock" text="import { CrossmintPayButton } from &quot;@crossmint/client-sdk-react-ui&quot;
import { FC } from &quot;react&quot;

export const ERC6551_REGISTRY_ADDRESS = &quot;0x02101dfB77FDE026414827Fdc604ddAF224F0921&quot;
export const ERC6551_IMPLEMENTATION_ADDRESS = &quot;0x2d25602551487c3f3354dd80d76d54383a243358&quot;
export const ERC6551_INIT_DATA = &quot;0x8129fc1c&quot;

interface CrossmintButtonProps {
  wallet: string
  quantity: number
}

const CrossmintButton: FC&lt;CrossmintButtonProps&gt; = ({ wallet, quantity }) =&gt; {
  const { referral } = useInvest()
  const referralProjectId = &quot;425871f8........125f28bcd&quot;
  const referralCollectionId = &quot;6a032ac..........cc260&quot;
  const mintConfig = {
    type: &quot;erc-721&quot;,
    totalPrice: &quot;0.000001&quot;, // 0.000001 eth
    quantity,
    _target: process.env.NEXT_PUBLIC_DROP_CONTRACT,
    _quantity: quantity,
    _to: wallet,
    to: wallet,
    _registry: ERC6551_REGISTRY_ADDRESS,
    _implementation: ERC6551_IMPLEMENTATION_ADDRESS,
    _initData: ERC6551_INIT_DATA,
    referralId: referral,
  }

  return (
    &lt;CrossmintPayButton
      projectId={referral ? referralProjectId : process.env.NEXT_PUBLIC_CROSSMINT_PROJECT_ID}
      collectionId={
        referral ? referralCollectionId : process.env.NEXT_PUBLIC_CROSSMINT_COLLECTION_ID
      }
      environment=&quot;staging&quot;
      mintConfig={mintConfig}
      mintTo={wallet}
    /&gt;
  )
}

export default CrossmintButton
"><code><span class="hljs-keyword">import</span> { <span class="hljs-title class_">CrossmintPayButton</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">"@crossmint/client-sdk-react-ui"</span>
<span class="hljs-keyword">import</span> { <span class="hljs-variable constant_">FC</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> <span class="hljs-title class_">ERC6551</span>_REGISTRY_ADDRESS = <span class="hljs-string">"0x02101dfB77FDE026414827Fdc604ddAF224F0921"</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> <span class="hljs-title class_">ERC6551</span>_IMPLEMENTATION_ADDRESS = <span class="hljs-string">"0x2d25602551487c3f3354dd80d76d54383a243358"</span>
<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> <span class="hljs-title class_">ERC6551</span>_INIT_DATA = <span class="hljs-string">"0x8129fc1c"</span>

<span class="hljs-keyword">interface</span> <span class="hljs-title class_">CrossmintButtonProps</span> {
  <span class="hljs-attr">wallet</span>: <span class="hljs-built_in">string</span>
  <span class="hljs-attr">quantity</span>: <span class="hljs-built_in">number</span>
}

<span class="hljs-keyword">const</span> <span class="hljs-title class_">CrossmintButton</span>: <span class="hljs-variable constant_">FC</span>&#x3C;<span class="hljs-title class_">CrossmintButtonProps</span>> = <span class="hljs-function">(<span class="hljs-params">{ wallet, quantity }</span>) =></span> {
  <span class="hljs-keyword">const</span> { referral } = <span class="hljs-title function_">useInvest</span>()
  <span class="hljs-keyword">const</span> referralProjectId = <span class="hljs-string">"425871f8........125f28bcd"</span>
  <span class="hljs-keyword">const</span> referralCollectionId = <span class="hljs-string">"6a032ac..........cc260"</span>
  <span class="hljs-keyword">const</span> mintConfig = {
    <span class="hljs-attr">type</span>: <span class="hljs-string">"erc-721"</span>,
    <span class="hljs-attr">totalPrice</span>: <span class="hljs-string">"0.000001"</span>, <span class="hljs-comment">// 0.000001 eth</span>
    quantity,
    <span class="hljs-attr">_target</span>: process.<span class="hljs-property">env</span>.<span class="hljs-property">NEXT_PUBLIC_DROP_CONTRACT</span>,
    <span class="hljs-attr">_quantity</span>: quantity,
    <span class="hljs-attr">_to</span>: wallet,
    <span class="hljs-attr">to</span>: wallet,
    <span class="hljs-attr">_registry</span>: <span class="hljs-title class_">ERC6551</span>_REGISTRY_ADDRESS,
    <span class="hljs-attr">_implementation</span>: <span class="hljs-title class_">ERC6551</span>_IMPLEMENTATION_ADDRESS,
    <span class="hljs-attr">_initData</span>: <span class="hljs-title class_">ERC6551</span>_INIT_DATA,
    <span class="hljs-attr">referralId</span>: referral,
  }

  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&#x3C;<span class="hljs-name">CrossmintPayButton</span>
      <span class="hljs-attr">projectId</span>=<span class="hljs-string">{referral</span> ? <span class="hljs-attr">referralProjectId</span> <span class="hljs-attr">:</span> <span class="hljs-attr">process.env.NEXT_PUBLIC_CROSSMINT_PROJECT_ID</span>}
      <span class="hljs-attr">collectionId</span>=<span class="hljs-string">{</span>
        <span class="hljs-attr">referral</span> ? <span class="hljs-attr">referralCollectionId</span> <span class="hljs-attr">:</span> <span class="hljs-attr">process.env.NEXT_PUBLIC_CROSSMINT_COLLECTION_ID</span>
      }
      <span class="hljs-attr">environment</span>=<span class="hljs-string">"staging"</span>
      <span class="hljs-attr">mintConfig</span>=<span class="hljs-string">{mintConfig}</span>
      <span class="hljs-attr">mintTo</span>=<span class="hljs-string">{wallet}</span>
    /></span></span>
  )
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-title class_">CrossmintButton</span>
</code></pre><p>If we use <strong>crossmint</strong>, we can create, sell and store NFTs in minutes with APIs, fiat on-ramp &amp; user-friendly wallets - <strong>no cryptocurrency required</strong>.</p><p><strong>Payments</strong></p><h4 id="h-nft-checkout" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0"><strong>NFT checkout</strong></h4><p>Accept any payment method for your NFT sales: Debit &amp; credit cards, Apple Pay, cross-chain payments, and more.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.crossmint.com/products/payments">https://www.crossmint.com/products/payments</a></p><p><strong>Minting APIs</strong></p><h4 id="h-create-and-distribute-nfts" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0"><strong>Create and distribute NFTs</strong></h4><p>Mint, edit, and burn NFTs. Airdrop them into emails or wallets with a single API call. No crypto required.</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.crossmint.com/products/minting-api">https://www.crossmint.com/products/minting-api</a></p>]]></content:encoded>
            <author>brittney-spalding-2@newsletter.paragraph.com (Brittney Spalding)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/6fb071bdfceb26cf0f55b28f5e4d28c3c11fbe3fa764511276477a7718b19a97.png" length="0" type="image/png"/>
        </item>
    </channel>
</rss>