When front-end developers and UX engineers are tasked with building a web interface that feels tactile, bouncy, or destructive, the industry instinct is almost always the same: reach for a physics engine. Frameworks like Matter.js, Cannon.js, or custom WebGL solutions have long stood as the gold standard for creating immersive, gamified websites that respond dynamically to user input.
However, a recent project from the Isadora Agency demonstrates that alternative architectural choices can sometimes better serve complex art direction. When the development and design teams set out to build Stress Release—a digital stress-relief squeeze toy designed to let burnt-out creatives smash, stretch, and distort animated UI characters—they initially explored traditional physics libraries. The primary goal was to construct a highly tactile experience where every user click yielded a satisfying, squishy reaction that felt physical and immediate.
Yet, as the engineering team began prototyping, they realized a fundamental divergence between physics simulations and artistic intent. Physics engines are built to produce plausible, generalized motion, but the studio’s animators had carefully crafted highly intentional motion. The team did not need their characters to act like random rubber balls bouncing uncontrollably across a canvas; they needed them to react in very specific, meticulously designed ways. Consequently, the agency scrapped the physics engine entirely, opting instead for an architecture driven by programmatic Lottie state controls, standard DOM manipulation, and precise distance-based mathematics.

The Design Requirements: Honoring Intentional Motion
The core requirement for the Stress Release project was absolute deterministic control. The agency’s animators had produced bespoke JSON Lottie files that required exact, frame-by-frame sequencing to convey the intended humor and tactile release.
For instance, the application’s "mega squeeze" reaction required a precise 181-frame build-up followed by a specific, carefully timed release sequence. To honor this design integrity, the development team needed an architecture that would not overwrite the animators’ crafted keyframes with algorithmic approximations generated by a physics simulation.
In interactive web development, the tighter the click-feedback loop—encompassing the sequence from the initial click to the visual squish and the resulting score—the greater the need for deterministic frame control. By choosing programmatic state control using Lottie’s native API, the developers ensured that the interaction layer acted as a flawless trigger for the animation layer, maintaining the exact artistic vision without deviation.

Creating Tactile Feedback: Mapping DOM Elements to Lottie States
Because the underlying architecture relied on Lottie and the standard DOM rather than WebGL canvases, rendering was handled directly by the Lottie runtime, which internally plays vector animations as scalable SVGs. The development team selected elements directly by their IDs and CSS classes, driving their behavior using a combination of Lottie animation segments, CSS transforms, and targeted click-event math.
To achieve a deeply satisfying tactile feel upon interacting with a character, the team employed radial input mapping. The initial step involved converting click coordinates from page space into the character’s local coordinate space. Every click was measured against the character’s center point and subsequently translated into a corresponding score, feedback intensity rating, and explosion placement coordinate.
By utilizing standard geometric calculations, the application determined the straight-line distance from the center of the click. This single mathematical value then drove multiple outcomes simultaneously: the assigned score, the intensity of the visual feedback, and the exact spatial positioning of the particle explosion animation.

The resulting system established a concentric zone structure—functioning similarly to a dartboard’s scoring rings centered around the character’s core. The visual complexity of the underlying Lottie SVG became entirely irrelevant to hit detection, as the hitbox remained a clean, predictable circle. Critically, the explosion animation was dynamically repositioned to match the exact vector used for scoring calculations, ensuring the visual effect always appeared precisely where the user clicked. This spatial accuracy successfully created the illusion of physically impacting the character entirely through mathematics and DOM positioning.
Interaction Handling and Controlling the Narrative
Because the entire experience was constructed using DOM-managed SVG elements, desktop clicks and mobile touch events could be handled directly through native event listeners. This approach successfully avoided the overhead of extra raycasting or coordinate remapping layers, keeping the interaction model closely aligned with how the vector animations were rendered on the screen.
Since the game demanded a visual reaction at a specific point, Lottie managed all the squish and bounce physics internally through its pre-defined animation curves. Each character featured a distinct set of animation sections—including looping idle states, reaction frames, and terminal end states—stored as discrete frame ranges. When a user click registered, the application jumped directly to the exact segment matching the current game state.

On every click, the system advanced through the designated play order and triggered the targeted segment. Once the animation segment completed, control automatically returned to the idle loop, unlocking further user input. For specialized mechanics like the mega squeeze build-up, elements looped on specific frame ranges until the player activated the final release sequence, after which the animation performed a hard reset.
The Responsive Benefit of DOM Elements
Another major factor influencing this architectural decision was responsive behavior across varying screen sizes. By building the application within the DOM, the developers entirely bypassed the complexities of scaling bounding boxes, viewports, and collision vectors across diverse desktop and mobile devices.
The team handled responsive resizing entirely through CSS custom properties. By recalculating these variables dynamically upon every browser resize event, the overall layout adapted fluidly to updated dimensions. As a result, the Lottie SVGs scaled naturally inside their respective containers without losing their active animation states or breaking the user interface layout.

Mobile Performance Optimization and the Cost of Lottie
While this DOM-and-Lottie architecture provided total control over the art direction and responsiveness, it introduced a distinct engineering challenge regarding file size and performance. Lottie JSON files can be notoriously heavy, particularly when scaling an application to feature 21 different character animations alongside multiple explosion variants that all require pre-loading.
To ensure the experience remained fluid and responsive, especially on mobile devices with constrained hardware resources, the team implemented several aggressive optimization strategies. For the character selection screen, where multiple complex animations played simultaneously, the developers initialized Lottie instances with reduced quality settings to minimize interpolation calculations, while also slightly slowing down animation speeds to decrease the number of frame calculations required per second. Conversely, on the primary gameplay screen where only a single character was active, the application loaded the asset at full quality to preserve visual fidelity during intense interactions.
Ultimately, the development team’s approach underscores a broader principle in web engineering: when determining the technical stack for a gamified or highly interactive web experience, the design requirements must dictate the technology. By opting for programmatic state control over emergent simulation, the team empowered their animators to dictate the exact emotional and visual feel of the product, leaving the underlying code to handle listening, calculating, and triggering with absolute precision.

