Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      CodeSOD: A Unique Way to Primary Key

      July 22, 2025

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 22, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 22, 2025

      I’m a wearables editor and here are the 7 Pixel Watch 4 rumors I’m most curious about

      July 22, 2025

      8 ways I quickly leveled up my Linux skills – and you can too

      July 22, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025
      Recent

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 22, 2025

      Execute Ping Commands and Get Back Structured Data in PHP

      July 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025
      Recent

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025

      “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

      July 22, 2025

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Tech & Work»Using Manim For Making UI Animations

    Using Manim For Making UI Animations

    April 8, 2025
    Using Manim For Making UI Animations

    Say you are learning to code for the first time, in Python, for example, which is a great starting point for getting into development. You are likely to come across some information like “a variable stores a value.” That sounds straightforward, but if you are a beginner just starting, then it can also be a bit confusing. How does a variable store or hold something? What happens when we assign a new value to it?

    To figure things out, you could read a bunch and watch tutorials, but sometimes, resources like these don’t help the concept fully click. That’s where animation helps. It has the power to take complex programming concepts and turn them into something visual, dynamic, and easy to grasp.

    Let’s break it down with an example: Say we have a box labeled X, first empty, then fill with a value 5, for this example, then update to 12, then 8, then 20, then 3.

    2. Click “Create App”

    You’ll see three options:

    1. “Create With Replit Agent”,
    2. “Choose a Template”,
    3. “Import from GitHub”.

    3. Select “Choose a Template”

    Then, search for Manim and create your app. At this point, you don’t have to do anything else because this sets up everything for you (including the main.py file, a media folder, and all of the required dependencies).

    Voilà! Now you can start coding your animations right away!

    Using Manim For Math, Code, And UI/UX Visuals

    Okay, you know Manim. Whether it’s for math, programming, physics, or even prototyping UI concepts, it’s all about making complex concepts easier to grasp through animation. But how does that work in practice? Let’s go through some ways Manim makes things clearer and more engaging.

    1. Math & Geometry Visuals

    Sometimes, math can feel a bit like a puzzle with missing pieces. But with Manim, numbers, shapes, and graphs move, making patterns and relationships easier to grasp. Take graphs, for example. When you tweak a parameter, Manim instantly updates the visualization so you can watch how a function changes over time. And that’s a game-changer for understanding concepts like derivatives or transformations.

    (Large preview)

    Geometry concepts also come easier and become even more fun when you can see those shapes move, giving you a clear understanding of rotation or reflection. If you’re drawing a triangle with a compass and straightedge, for example, Manim can animate each step, making it easier to follow along and understand the idea.

    2. Coding & Algorithms

    As you may already know, coding is a process that runs step by step, and Manim makes that easy to see. Whether you are working on the front end or the back end, logic flows in a way that’s not always clear from just reading or writing code. With Manim, you can, for example, watch how a sorting algorithm moves numbers around or simply how a loop runs.

    The same goes for data structures like linked lists, trees, and more. A binary tree makes more sense when you can see it grow and balance itself. Even complex algorithms like Dijkstra’s shortest path become clearer when you watch the path being calculated in real time, even if you may not have a background in math.

    3. UI/UX Concepts & Motion Design

    Although Manim is not a UI/UX design tool, it can be useful for demonstrating designs. Static images can’t always show the full picture, but with Manim, before-and-after comparisons become more dynamic, and of course, it makes it easier to highlight why a new navigation menu, for example, is more intuitive or how a checkout flow reduces friction.

    Animated heatmaps can show click patterns over time, helping to spot trends more easily. Conversion funnels become clearer when each stage is animated, revealing exactly where users drop off.

    Let’s Manim!

    Well, that’s a lot we covered! By now, you should have Manim installed in whatever way works best for you. But before we jump into the coding part, let’s quickly go over Manim’s core building blocks. Manim’s animations are made of three main concepts:

    • Mobjects,
    • Animations,
    • Scenes.

    1. Mobjects (Mathematical Objects)

    Everything you display in Manim is a Mobject (short for “mathematical object”). There are different types:

    • Basic shapes like Circle(), Rectangle(), and Arrow(),
    • Text elements for adding labels, and
    • Advanced structures like graphs, axes, and bar charts.

    A mobject is more like a blueprint, and it won’t show up unless you add it to a scene. Here’s a brief example:

    from manim import *
    
    class MobjectExample(Scene):
      def construct(self):
        circle = Circle()  # Create a circle
        circle.set_fill(BLUE, opacity=0.5)  # Set color and transparency
        self.add(circle)  # Add to the scene
        self.wait(2)
    

    A blue circle will appear for about two seconds when you run this:

    2. Animations

    Animations in Manim, on the other hand, are all about changing these objects over time. Rather than just displaying a sharp edge, we can make it move, rotate, fade, or transform into something else. Really, we do have this much control through the Animation class.

    If we use the same circle example from earlier, we can add animations to see how it works and compare the visual differences:

    from manim import *
    
    class AnimationExample(Scene):
      def construct(self):
        circle = Circle()
        circle.set_fill(BLUE, opacity=0.5) 
    
        self.play(FadeIn(circle))
        self.play(circle.animate.shift(RIGHT * 2))
        self.play(circle.animate.scale(1.5)) 
        self.play(Rotate(circle, angle=PI/4))  
        self.wait(2)
    

    Here, we are making a move, scaling up, and rotating. The play() method is what makes animations run. For example, FadeIn(circle) makes the circle gradually appear, and circle.animate.shift(RIGHT * 2) moves it two units to the right. If you want to slow things down, you can add run_time to control the duration, like the following:

    self.play(circle.animate.scale(2), run_time=3),
    

    This makes the scaling take three more seconds instead of the default amount of time:

    3. Scenes

    Scenes are what hold everything together. A scene defines what appears, how it animates, and in what order. Every Manim script has a class that is inherited from a Scene, and it contains a construct() method. This is where we write our animation logic. For example,

    class SimpleScene(Scene):
      def construct(self):
        text = Text("Hello, Manim!")
        self.play(Write(text))
        self.wait(2)
    

    This creates a simple text animation where the words appear as if being written.

    Bringing Manim To Design

    As we discussed earlier, Manim is a great tool for UI/UX designers and front-end developers to visualize user interactions or to explain UI concepts. Think about how users navigate through a website or an app: they click buttons, move between pages, and interact with elements. With Manim, we can animate these interactions and see them play out step by step.

    With this in mind, let’s create a simple flow where a user clicks a button, leading to a new page:

    from manim import *
    
    class UIInteraction(Scene):
      def construct(self):
        # Create a homepage screen
        homepage = Rectangle(width=6, height=3, color=BLUE)
        homepage_label = Text("Home Page").scale(0.8)
        homepage_group = VGroup(homepage, homepage_label)
    
        # Create a button
        button = RoundedRectangle(width=1.5, height=0.6, color=RED).shift(DOWN * 1)
        button_label = Text("Click Me").scale(0.5).move_to(button)
        button_group = VGroup(button, button_label)
    
        # Add homepage and button
        self.add(homepage_group, button_group)
    
        # Simulating a button click
        self.play(button.animate.set_fill(RED, opacity=0.5))  # Button press effect
        self.wait(0.5)  # Pause to simulate user interaction
    
        # Create a new page (simulating navigation)
        new_page = Rectangle(width=6, height=3, color=GREEN)
        new_page_label = Text("New Page").scale(0.8)
        new_page_group = VGroup(new_page, new_page_label)
    
        # Animate transition to new page
        self.play(FadeOut(homepage_group, shift=UP),  # Move old page up
          FadeOut(button_group, shift=UP),  # Move button up
          FadeIn(new_page_group, shift=DOWN))  # Bring new page from top
        self.wait(2)
    

    The code creates a simple UI animation for a homepage displaying a button. When the button is clicked, it fades slightly to simulate pressing, and then the homepage and button fade out while a new page fades in, creating a transition effect.

    If you think of it, scrolling is one of the most natural interactions in modern web and app design. Whether moving between sections on a landing page or smoothly revealing content, well-designed scroll animations make the experience feel fluid. Let me show you:

    from manim import *
    
    class ScrollEffect(Scene):
      def construct(self):
        # Create three sections to simulate a webpage
        section1 = Rectangle(width=6, height=3, color=BLUE).shift(UP*3)
        section2 = Rectangle(width=6, height=3, color=GREEN)
        section3 = Rectangle(width=6, height=3, color=RED).shift(DOWN*3)
    
        # Add text to each section
        text1 = Text("Welcome", font_size=32).move_to(section1)
        text2 = Text("About Us", font_size=32).move_to(section2)
        text3 = Text("Contact", font_size=32).move_to(section3)
    
        self.add(section1, section2, section3, text1, text2, text3)
        self.wait(1)
    
        # Simulate scrolling down
        self.play(
          section1.animate.shift(DOWN*6),
          section2.animate.shift(DOWN*6),
          section3.animate.shift(DOWN*6),
          text1.animate.shift(DOWN*6),
          text2.animate.shift(DOWN*6),
          text3.animate.shift(DOWN*6),
          run_time=3
        )
        self.wait(1)
    

    This animation shows a scrolling effect by moving sections of a webpage upward, simulating how content shifts as a user scrolls. It is a simple way to visualize transitions that make the UI feel smooth and engaging.

    Wrapping Up

    Manim makes it easier to show how users interact with a design. You can animate navigations, interactions, and user behaviors to understand better how design works in action. Is there more to explore? Definitely! You can take these simple examples and build on them by adding more complex features.

    But what I hope you take away from all of this is that subtle animations can help communicate and clarify concepts and that Manim is a library for making those sorts of animations. Traditionally, it’s used to help explain mathematical and scientific concepts, but you can see just how useful it can be to working in front-end development, particularly when it comes to highlighting and visualizing UI changes.

    Source: Read More 

    news
    Facebook Twitter Reddit Email Copy Link
    Previous ArticleCryptocurrency Miner and Clipper Malware Spread via SourceForge Cracked Software Listings
    Next Article Windows 10 KB5055518 remove seconds from the clock, following Windows 11

    Related Posts

    Tech & Work

    CodeSOD: A Unique Way to Primary Key

    July 22, 2025
    Tech & Work

    BrowserStack launches Figma plugin for detecting accessibility issues in design phase

    July 22, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-53313 – Twitch TV Embed Suite CSRF Stored XSS

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-48070 – Plane UserSerializer Account Takeover Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Synthwave Mountains Scroll Animation Header Using Trig.js

    Development

    Three ways Figma explored horizontal scrolling

    Web Development

    Highlights

    CVE-2025-36630 – Nessus Windows Local Privilege Escalation Vulnerability

    July 2, 2025

    CVE ID : CVE-2025-36630

    Published : July 2, 2025, 12:15 a.m. | 9 hours, 59 minutes ago

    Description : In Tenable Nessus versions prior to 10.8.5 on a Windows host, it was found that a non-administrative user could overwrite arbitrary local system files with log content at SYSTEM privilege.

    Severity: 8.4 | HIGH

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    Taskade Autopilot is now live

    May 30, 2025

    U.S. Charges Yemeni Hacker Behind Black Kingdom Ransomware Targeting 1,500 Systems

    May 13, 2025

    Why design is for everyone

    April 3, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.