<?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: nipundinuranga</title>
    <description>The latest articles on DEV Community by nipundinuranga (@nipundinuranga).</description>
    <link>https://dev.to/nipundinuranga</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%2F920063%2F2d3a6c40-8e49-47de-b476-34bd333edfd1.jpg</url>
      <title>DEV Community: nipundinuranga</title>
      <link>https://dev.to/nipundinuranga</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nipundinuranga"/>
    <language>en</language>
    <item>
      <title>Random Module In Python</title>
      <dc:creator>nipundinuranga</dc:creator>
      <pubDate>Mon, 22 Dec 2025 15:37:05 +0000</pubDate>
      <link>https://dev.to/nipundinuranga/random-module-in-python-44o0</link>
      <guid>https://dev.to/nipundinuranga/random-module-in-python-44o0</guid>
      <description>&lt;h2&gt;
  
  
  What is the Random Module ?
&lt;/h2&gt;

&lt;p&gt;The random module in Python is like a magic toolbox that helps you work with randomness! It allows you to create random numbers, pick random items from a list, or even shuffle things around.&lt;/p&gt;

&lt;p&gt;Think of it like this: If you want to roll a virtual dice, pick a winner from a list of names, or create a surprise by mixing things up, the random  module is there to help! You just tell it what kind of random thing you need, and it does the job for you.&lt;/p&gt;

&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%2Fuploads%2Farticles%2F5gp636guv66laf3hdvdi.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%2Fuploads%2Farticles%2F5gp636guv66laf3hdvdi.png" alt=" " width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This will print a random number between 1 and 10 every time you run the code!&lt;/strong&gt;&lt;/p&gt;

&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%2Fuploads%2Farticles%2Fbkbya755tku8y1lh2lmn.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%2Fuploads%2Farticles%2Fbkbya755tku8y1lh2lmn.jpg" alt=" " width="626" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use the random Module?
&lt;/h2&gt;

&lt;p&gt;The random module is super handy whenever you need a little unpredictability in your code. It's like having a surprise button! You can use it for:&lt;/p&gt;

&lt;p&gt;✨ Games: Want to roll dice, shuffle cards, or make a character appear in a random spot? The random module makes it happen!&lt;/p&gt;

&lt;p&gt;✨ Choosing Random Items : Need to pick a random winner for a giveaway or choose a random question from a quiz? This module has you covered.&lt;/p&gt;

&lt;p&gt;✨ Simulations : Sometimes, we want to mimic real-world scenarios where things happen by chance, like flipping a coin or predicting weather patterns. The random module helps create that "real-life" randomness.&lt;/p&gt;

&lt;p&gt;✨ Generating Random Data : Whether it's a random password, a number for testing, or even random colors for an art project, this module does it all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Functions of the random Module
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. random.randint(a,b)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This gives you a random number between a and b (including both). It's like rolling a dice where you can choose the range of numbers.&lt;/p&gt;

&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%2Fuploads%2Farticles%2Fqmqu30m5jbu1a7on93ke.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%2Fuploads%2Farticles%2Fqmqu30m5jbu1a7on93ke.png" alt=" " width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. random.choice(list)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Want to randomly pick an item from a list? This function does exactly that! It's great for picking a random winner or choosing a random option. &lt;/p&gt;

&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%2Fuploads%2Farticles%2Fhcrpoaabooyr61ewskiu.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%2Fuploads%2Farticles%2Fhcrpoaabooyr61ewskiu.png" alt=" " width="800" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. random.random()&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This gives you a random float (decimal number) between 0 and 1. It's like rolling a super tiny dice where you always get a number between 0.0 and 1.0.&lt;/p&gt;

&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%2Fuploads%2Farticles%2Fqhz6vsrjegtakufqxlz5.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%2Fuploads%2Farticles%2Fqhz6vsrjegtakufqxlz5.png" alt=" " width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. random.shuffle(list)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Want to mix things up? This function shuffles the items in a list, changing the order around randomly. Perfect for shuffling a deck of cards or rearranging a list. &lt;/p&gt;

&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%2Fuploads%2Farticles%2Fzcceasatbch13ttkz9a6.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%2Fuploads%2Farticles%2Fzcceasatbch13ttkz9a6.png" alt=" " width="800" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips &amp;amp; Tricks for the random Module
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1.random.seed() for Repeatable Results&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you need the same "random" results every time (for testing), use random.seed().This makes the random output predictable.&lt;/p&gt;

&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%2Fuploads%2Farticles%2Fp96uy6ngjwsrj3vgb35i.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%2Fuploads%2Farticles%2Fp96uy6ngjwsrj3vgb35i.png" alt=" " width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.random.uniform() for Decimals&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Need a random decimal between two numbers? Use random.uniform()!&lt;/p&gt;

&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%2Fuploads%2Farticles%2Fmw41p1k4vzlgt3vaiv02.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%2Fuploads%2Farticles%2Fmw41p1k4vzlgt3vaiv02.png" alt=" " width="800" height="280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tips &amp;amp; Tricks for the random Module&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.random.sample() to Pick Multiple items&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Want to pick multiple random items without repeating?&lt;br&gt;
Use random.sample().&lt;/p&gt;

&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%2Fuploads%2Farticles%2Fcxqz3tyrcjpkxewldda1.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%2Fuploads%2Farticles%2Fcxqz3tyrcjpkxewldda1.png" alt=" " width="800" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>The Ultimate Guide to High-Performance Web Animations</title>
      <dc:creator>nipundinuranga</dc:creator>
      <pubDate>Mon, 17 Nov 2025 10:07:18 +0000</pubDate>
      <link>https://dev.to/nipundinuranga/the-ultimate-guide-to-high-performance-web-animations-36dp</link>
      <guid>https://dev.to/nipundinuranga/the-ultimate-guide-to-high-performance-web-animations-36dp</guid>
      <description>&lt;p&gt;If you’re looking to bring your website to life with smooth, high-performance animations, look no further than the GreenSock Animation Platform (GSAP) is a powerful JavaScript library for creating high-performance animations. It allows you to animate CSS properties, SVG, canvas, and more with ease. Below is a step-by-step guide to using GSAP:&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction to GSAP
&lt;/h2&gt;

&lt;p&gt;GSAP, or the GreenSock Animation Platform, is a powerful JavaScript library for creating high-performance animations. It is widely used by web developers and designers to animate HTML, CSS, SVG, and canvas elements. GSAP is known for its speed, flexibility, and ease of use, making it a popular choice for both simple and complex animations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use GSAP?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;    Performance: GSAP is optimized for performance, ensuring smooth animations even on low-powered devices.&lt;/li&gt;
&lt;li&gt;    Cross-Browser Compatibility: It works seamlessly across all major browsers, including mobile browsers.&lt;/li&gt;
&lt;li&gt;    Ease of Use: The API is intuitive and easy to learn, allowing developers to create animations quickly.&lt;/li&gt;
&lt;li&gt;    Rich Features: GSAP offers a wide range of features, including timelines, easing functions, and plugins for advanced animations.&lt;/li&gt;
&lt;li&gt;    Community and Support: With a large community and extensive documentation, finding help and resources is easy.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Getting Started with GSAP
&lt;/h2&gt;

&lt;p&gt;Step 1: Setting Up Your Environment&lt;/p&gt;

&lt;p&gt;To start  using GSAP, you need to include the library in your project. You can do this by either downloading it or linking to a CDN.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 1: Using a CDN&lt;/strong&gt;&lt;/p&gt;

&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%2Fuploads%2Farticles%2F0ajk9t89zkcs1lh8hkib.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%2Fuploads%2Farticles%2F0ajk9t89zkcs1lh8hkib.jpg" alt=" " width="800" height="850"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add the following script tag to your HTML file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Option 2: Using npm&lt;/strong&gt;&lt;/p&gt;

&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%2Fuploads%2Farticles%2Fht7wuafwm2mz590v8roy.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%2Fuploads%2Farticles%2Fht7wuafwm2mz590v8roy.jpg" alt=" " width="800" height="844"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install gsap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, you can import it into your JavaScript files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { gsap } from "gsap";
&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;&amp;lt;!DOCTYPE html&amp;gt;

&amp;lt;html lang="en"&amp;gt;

&amp;lt;head&amp;gt;

    &amp;lt;meta charset="UTF-8"&amp;gt;

    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;

    &amp;lt;title&amp;gt;GSAP Animation Example&amp;lt;/title&amp;gt;

    &amp;lt;script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.5/gsap.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;

    &amp;lt;div class="box"&amp;gt;&amp;lt;/div&amp;gt;

    &amp;lt;script src="script.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Option 2: Downloading GSAP&lt;/strong&gt;&lt;br&gt;
    Go to the &lt;a href="https://gsap.com/" rel="noopener noreferrer"&gt;GreenSock website&lt;/a&gt;.&lt;br&gt;
    Download the latest version of GSAP.&lt;br&gt;
    Include the &lt;code&gt;gsap.min.js&lt;/code&gt; file in your project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


## **Log GSAP version in the console**

&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;console.log(gsap);               // to make sure it works
console.log(gsap.version);       // log version
&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;

&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;Document&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/ScrollTrigger.min.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;script&amp;gt;
    console.log(gsap);               // now it works
    console.log(gsap.version);       // log version
&amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Creating Your First Animation
&lt;/h2&gt;

&lt;p&gt;Now that you have GSAP set up, let’s create a simple animation. We will animate a box that moves across the screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML Structure&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Add a simple box to your HTML:&lt;br&gt;
&lt;code&gt;&amp;lt;div class="box"&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSS Styles&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Add some basic styles for the box:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.box {

    width: 100px;

    height: 100px;

    background-color: red;

    position: absolute;

    top: 50px;

    left: 50px;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;JavaScript Animation&lt;/strong&gt;&lt;br&gt;
Now, let’s animate the box using GSAP. Create a script.js file and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsap.to(".box", {

    duration: 2,

    x: 300,

    rotation: 360,

    scale: 1.5,

    ease: "power1.inOut"

});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Explanation of the Code
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;gsap.to()&lt;/code&gt;: This method animates the properties of the selected element(s) to the specified values.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.box&lt;/code&gt; : The target element we want to animate.&lt;br&gt;
    &lt;code&gt;duration&lt;/code&gt;: The duration of the animation in seconds.&lt;br&gt;
    &lt;code&gt;x&lt;/code&gt;: The horizontal position to move the box to (300 pixels to the right).&lt;br&gt;
    &lt;code&gt;rotation&lt;/code&gt;: The rotation of the box in degrees.&lt;br&gt;
    &lt;code&gt;scale&lt;/code&gt;: The scale factor to enlarge the box.&lt;br&gt;
    &lt;code&gt;ease&lt;/code&gt;: The easing function that controls the acceleration of the animation.&lt;/p&gt;
&lt;h2&gt;
  
  
  Core Methods
&lt;/h2&gt;

&lt;p&gt;Here are the three primary methods you'll use to create animations:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gsap.to() : Animates an element to  a specific state.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsap.to("#element", { duration: 1, opacity: 0 });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This fades out the element by reducing its opacity to 0 over 1 second.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gsap.from() : Animates an element from  a specific state to its current state.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsap.from("#element", { duration: 1, scale: 0 });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This scales the element from 0 (invisible) to its normal size.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gsap.fromTo() : Animates an element from  one state to  another. &lt;br&gt;
javascript&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsap.fromTo("#element", { opacity: 0 }, { duration: 1, opacity: 1 });

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

&lt;/div&gt;



&lt;p&gt;This fades in the element by transitioning its opacity from 0 to 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced Features of GSAP
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Easing Functions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;GSAP provides a variety of easing functions to control the speed of your animations. Some common easing functions include:&lt;br&gt;
    &lt;code&gt;power1.in&lt;/code&gt;&lt;br&gt;
    &lt;code&gt;power1.out&lt;/code&gt;&lt;br&gt;
    &lt;code&gt;bounce&lt;/code&gt;&lt;br&gt;
    &lt;code&gt;elastic&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can apply easing to your animations like this in your &lt;code&gt;gsap.js&lt;/code&gt; directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gsap.to(".box", {

    duration: 2,

    x: 300,

    ease: "bounce.out"

});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;ScrollTrigger Plugin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of GSAP's most popular plugins is ScrollTrigger , which enables scroll-based animations. To use it, you need to register the plugin first.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";

gsap.registerPlugin(ScrollTrigger);

gsap.to("#box", {
  scrollTrigger: {
    trigger: "#box",
    start: "top center", // When the top of the element hits the center of the viewport
    end: "bottom center", // When the bottom of the element hits the center of the viewport
    scrub: true, // Smoothly animates as you scroll
  },
  x: 300,
  rotation: 360,
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>javascriptlibraries</category>
      <category>webanimation</category>
      <category>gsap</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>nipundinuranga</dc:creator>
      <pubDate>Sun, 06 Apr 2025 01:38:51 +0000</pubDate>
      <link>https://dev.to/nipundinuranga/-1p67</link>
      <guid>https://dev.to/nipundinuranga/-1p67</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/madsstoumann/how-to-create-gauges-in-css-3581" class="crayons-story__hidden-navigation-link"&gt;How To Create Gauges in CSS&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/madsstoumann" class="crayons-avatar  crayons-avatar--l  "&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%2Fuploads%2Fuser%2Fprofile_image%2F515396%2Fbf9dcb06-ff90-4fb1-b507-c3dc21c82b85.png" alt="madsstoumann profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/madsstoumann" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Mads Stoumann
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Mads Stoumann
                
              
              &lt;div id="story-author-preview-content-2383490" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/madsstoumann" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&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%2Fuploads%2Fuser%2Fprofile_image%2F515396%2Fbf9dcb06-ff90-4fb1-b507-c3dc21c82b85.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Mads Stoumann&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/madsstoumann/how-to-create-gauges-in-css-3581" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Apr 5 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/madsstoumann/how-to-create-gauges-in-css-3581" id="article-link-2383490"&gt;
          How To Create Gauges in CSS
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag crayons-tag--filled  " href="/t/showdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;showdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/css"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;css&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/tutorial"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;tutorial&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/madsstoumann/how-to-create-gauges-in-css-3581" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;30&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/madsstoumann/how-to-create-gauges-in-css-3581#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              12&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            6 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>css</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Sphere Packing Visualization with Three.js</title>
      <dc:creator>nipundinuranga</dc:creator>
      <pubDate>Mon, 10 Mar 2025 19:31:09 +0000</pubDate>
      <link>https://dev.to/nipundinuranga/sphere-packing-visualization-with-threejs-273f</link>
      <guid>https://dev.to/nipundinuranga/sphere-packing-visualization-with-threejs-273f</guid>
      <description>&lt;p&gt;Overview &lt;/p&gt;

&lt;p&gt;This project is a visually stunning 3D visualization of sphere packing , built using Three.js , a powerful JavaScript library for WebGL-based 3D graphics. The scene features multiple spheres that dynamically interact with lighting and user input, creating an immersive experience. &lt;/p&gt;

&lt;p&gt;The "Sphere Packing" visualization demonstrates how spheres can be arranged in a 3D space while showcasing interactive features like random color generation and animation control. It's perfect for learning the basics of Three.js  or as a foundation for more advanced 3D projects. &lt;br&gt;
Features &lt;/p&gt;

&lt;p&gt;✨ *&lt;em&gt;Interactive Spheres *&lt;/em&gt;&lt;br&gt;
Hundreds of spheres are rendered in a 3D space, simulating a sphere-packing arrangement. Each sphere interacts with dynamic lighting for a realistic effect. &lt;/p&gt;

&lt;p&gt;🎨 *&lt;em&gt;Random Color Generation *&lt;/em&gt;&lt;br&gt;
Click the "Random colors" button to generate vibrant, randomized colors for the spheres and their lighting. This creates a dynamic and visually appealing effect. &lt;/p&gt;

&lt;p&gt;💡 *&lt;em&gt;Dynamic Lighting *&lt;/em&gt;&lt;br&gt;
A directional light source enhances the 3D appearance of the spheres, reacting to color changes and providing depth to the scene. &lt;/p&gt;

&lt;p&gt;🔄 *&lt;em&gt;Animation Control *&lt;/em&gt;&lt;br&gt;
Click anywhere outside the button to pause or resume the animation, giving users control over the visual experience. &lt;/p&gt;

&lt;p&gt;📱 *&lt;em&gt;Responsive Design *&lt;/em&gt;&lt;br&gt;
The canvas automatically adjusts to fit the browser window, ensuring a seamless experience across devices. &lt;br&gt;
Technologies Used &lt;/p&gt;

&lt;p&gt;🚀** Built With** : Three.js, HTML5 Canvas, CSS, JavaScript (ES6 Modules) &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Three.js : For rendering 3D graphics and animations.
HTML5 Canvas : As the rendering surface for the WebGL context.
CSS : For styling the UI and layout.
JavaScript (ES6 Modules) : For implementing interactivity and animations.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;🔗 &lt;strong&gt;Live Demo&lt;/strong&gt; : &lt;a href="https://github.com/nipunkahadawala/Sphere-Packing.git" rel="noopener noreferrer"&gt;Insert Live Demo Link Here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>threejs</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Let's Animate like a Magic</title>
      <dc:creator>nipundinuranga</dc:creator>
      <pubDate>Tue, 06 Aug 2024 08:49:12 +0000</pubDate>
      <link>https://dev.to/nipundinuranga/modern-animated-button-143n</link>
      <guid>https://dev.to/nipundinuranga/modern-animated-button-143n</guid>
      <description>&lt;p&gt;I Tried to Animate Netflix logo Without Motion Graphic software.&lt;/p&gt;

&lt;p&gt;Source Code - &lt;a href="https://github.com/nipunkahadawala/Netflix-Logo-Animation" rel="noopener noreferrer"&gt;github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>codepen</category>
    </item>
    <item>
      <title>Modern Clock Animation</title>
      <dc:creator>nipundinuranga</dc:creator>
      <pubDate>Sun, 04 Aug 2024 10:06:35 +0000</pubDate>
      <link>https://dev.to/nipundinuranga/modern-clock-animation-3j6d</link>
      <guid>https://dev.to/nipundinuranga/modern-clock-animation-3j6d</guid>
      <description>&lt;p&gt;I Tried to recreate &lt;strong&gt;Modern Clock Animation&lt;/strong&gt; .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/nipunkahadawala/Typographic-Clock.git" rel="noopener noreferrer"&gt;Source Code&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>design</category>
      <category>frontend</category>
    </item>
    <item>
      <title>CSS Button Animation</title>
      <dc:creator>nipundinuranga</dc:creator>
      <pubDate>Tue, 30 Jul 2024 02:40:57 +0000</pubDate>
      <link>https://dev.to/nipundinuranga/css-button-animation-4fgc</link>
      <guid>https://dev.to/nipundinuranga/css-button-animation-4fgc</guid>
      <description>&lt;p&gt;I Tried to recreate CSS Modern Button animation.                           &lt;a href="https://codepen.io/nipun-dinuranga/pen/RwzWgja" rel="noopener noreferrer"&gt;click here to explore source code&lt;/a&gt;&lt;/p&gt;

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