Skip to content

Add Spiral goo animation: separate file with customizable spinning spiral gradient#4

Open
curtisahuang wants to merge 4 commits intomasterfrom
cosine/feat/playground4-spiral-gradient-spin
Open

Add Spiral goo animation: separate file with customizable spinning spiral gradient#4
curtisahuang wants to merge 4 commits intomasterfrom
cosine/feat/playground4-spiral-gradient-spin

Conversation

@curtisahuang
Copy link
Collaborator

@curtisahuang curtisahuang commented Mar 12, 2026

Introduced a new spiral goo animation as a standalone file and wired it into the playground for modularization and reuse. The spiral gradient spins and unwinds into straight arms, leaving a liquid-like trail, with the base color and disturbance color controlled by the user.

What changed:

  • assets/animation-spiral-liquid.js (new): Added createSpiralLiquidProject which renders a rotating spiral that straightens out. It supports gradient coloring, a straight unwind path, and a trailing effect. Controls include primaryColor, secondaryColor, spinSpeed, spinDuration, shape (spokes, triangle, square), and thickness/softness for the liquid feel. When using spokes, you can adjust the number of spokes. The code uses offscreen rendering for performance and applies a gradient stroke to arms drawn around a rotation.
  • assets/main.js: Imported the new spiral module and added it to the list of available projects so it appears in the playground.
  • assets/style.css: Minor adjustments to control styling to accommodate new controls (select styling for consistent appearance).

How this solves the task:

  • The fourth animation is now modularized in its own file, making it easier to maintain and swap in. The spiral gradient can spin and unwind, with a trail that mimics liquid dynamics. Users can tune colors, spin speed, and unwind duration, and switch shapes or the number of spokes to alter the spinning form.

https://cosine.wtf/cosine-stg/animation-playground/task/vc01u7ggguh2
https://cosine.wtf/gh/CosineAI/animation-playground/pull/4
Author: Curtis Huang

curtisahuang and others added 4 commits March 12, 2026 10:06
…l styling for selects

Co-authored-by: Cosine <agent@cosine.sh>
…ort and UI controls; implement offscreen fluid grid and rod-forcing rendering

Co-authored-by: Cosine <agent@cosine.sh>
…al liquid simulation

Co-authored-by: Cosine <agent@cosine.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant