Animated Loop

Pulsing concentric rings in one of four hand-tuned styles (Shape / Diamond / Neon / Warp) with three RGB-channel colors and per-channel phase offset — Shape style adds a geometric sub-picker (circle / square / diamond / hexagon / star)

Free
Free with a ShipSwift account.

Copies a short instruction with your private download link. Paste it into your agent: it downloads the whole skill (the source code, the setup steps and the mistakes we already made for you) and builds the screen.

Works with

+70

What it does

Family of full-screen pulsing concentric-ring animations rendered through SwiftUI's colorEffect Metal pipeline. Four hand-tuned styles share the same per-line phase ramp, RGB-channel split, and additive composite logic; they only differ in the distance metric d and the pattern term m. The Shape style additionally exposes a 5-way geometric selector (circle / square / diamond pip / hexagon / star with petal count); the Neon style adds three angular-wobble parameters.

Requires iOS 18+ / macOS 15+.

What you get

  • ✓834 lines of source code, ready to paste
  • ✓File Layout
  • ✓Source Code
  • ✓Usage
  • ✓Parameters
  • ✓Integration Checklist
  • ✓Notes / Gotchas
animationmetalshaderringsloopsplashbackgroundSwiftUI

Usage

// Default — Shape style, circle, red/green/blue rings on black
ZStack {
    SWAnimatedLoop()
        .ignoresSafeArea()
}

// Switch styles — each style auto-loads its hand-tuned numeric defaults
SWAnimatedLoop(style: .diamond)
SWAnimatedLoop(style: .neon)
SWAnimatedLoop(style: .warp)

// Within Shape style, pick a geometric shape
SWAnimatedLoop(style: .shape, shape: .hexagon)
SWAnimatedLoop(style: .shape, shape: .star, petals: 7)

// As a section background
myContent
    .background { SWAnimatedLoop(style: .neon) }

// Brand-recolored — replace the RGB channels
SWAnimatedLoop(
    style: .warp,
    color1: .pink,
    color2: .cyan,
    color3: .yellow,
    background: .black
)

Parameters

ParameterTypeDefaultNotes
styleSWAnimatedLoopStyle.shapeshape / diamond / neon / warp
shapeSWAnimatedLoopShape.circleStyle-specific — only honored when style == .shape; one of circle / square / diamond / hexagon / star
petalsInt5Style-specific — only honored when style == .shape && shape == .star; range 3…12
color1, color2, color3Color.red, .green, .blueThree RGB channel colors, additively composited per-pixel
backgroundColor.blackColor rendered behind the rings
speedFloat?nil → style.numericDefaults.speedTime multiplier on the ring sweep (style-specific default)
lineWidthFloat?nil → 0.002Per-ring line thickness
linesInt?nil → style.numericDefaults.linesNumber of concentric rings (1…20)
spacingFloat?nil → style.numericDefaults.spacingDistance multiplier between rings (0.5…20)
channelOffsetFloat?nil → style.numericDefaults.channelOffsetPhase offset between RGB channels (-0.5…0.5)
patternModFloat?nil → style.numericDefaults.patternModPeriod of the pattern term overlaid on the rings (0.01…2)
rotationFloat0.0Rotation in radians (-π…π)
scaleFloat1.0Spatial scale (0.2…5)
centerX, centerYFloat0.0, 0.0Ring origin offset (-1…1 each)
angularLobesFloat3.0Style-specific — only used by Neon; integer lobe count for per-channel angular wobble (1…12)
angularAmountFloat0.08Style-specific — only used by Neon; wobble amplitude (0…0.5)
angularSpeedFloat0.5Style-specific — only used by Neon; wobble angular frequency (0…3)
showsControlsBoolfalseDemo-only gear ToolbarItem; requires NavigationStack

Style numeric defaults (loaded automatically):

StylespeedlineWidthlinesspacingchannelOffsetpatternMod
shape0.050.00255.00.010.20
diamond0.050.00265.00.010.15
neon0.060.00255.00.010.20
warp0.070.00264.00.0080.30

Integration Checklist

  1. Copy SWAnimatedLoop.swift and SWAnimatedLoop.metal into your Xcode target.
  2. Confirm the deployment target is iOS 18+ / macOS 15+.
  3. Pick a style — SWAnimatedLoop(style: .warp) is a single line; each style ships with its author-tuned numeric defaults.
  4. For the Shape style, additionally pick a geometric shape:; for .star, optionally set petals:.
  5. For Neon, optionally tune angularLobes / angularAmount / angularSpeed to control the per-channel wobble.
  6. Replace color1 / color2 / color3 (and optionally background) for brand-aligned palettes.

Notes / Gotchas

  • All four entry points take the same 18-parameter signature so the Swift renderer can use a single argument list and dispatch by name. Parameters that don't apply to a given style are explicitly cast away with (void)x; to make "unused on purpose" decisions explicit in the shader source.
  • When showsControls is true, the sheet's Style picker resets the numeric ring parameters (speed, lines, spacing, channelOffset, patternMod) to the new style's hand-tuned defaults — intentional, so each style ships with the look its author designed.
  • The Shape selector and Star petals slider are hidden in the sheet unless style == .shape. The Angular section appears only for style == .neon. Parameters that don't apply to the current style are still passed to the shader but ignored there.
  • The Neon style applies a baked-in RGB boost (1.1, 0.8, 1.2) after the additive composite — part of its style identity, do not parameterize.
  • scale and patternMod are both clamped internally to >= 0.0001 so zero / negative input is safe.
  • The gear button is a native ToolbarItem — the call site must be inside a NavigationStack.

More in Effects and animation

Metal shaders: fields of dots that roll like waves and flow into living patterns, all drawn on the GPU.
Metal dot fields
Free
Metal shaders: fields of dots that roll like waves and flow into living patterns, all drawn on the GPU.
A deep-space starfield in Metal: glowing nebulae drift past twinkling stars.
Deep-space starfield
Free
A deep-space starfield in Metal: glowing nebulae drift past twinkling stars.
Neon outlines that bloom from the center with prism-colored edges, rendered live in Metal.
Neon outlines
Free
Neon outlines that bloom from the center with prism-colored edges, rendered live in Metal.
Colored blobs that drift, melt into one another like liquid, and blend their colors as they merge.
Liquid metaballs
Free
Colored blobs that drift, melt into one another like liquid, and blend their colors as they merge.
A 3D network graph you can spin. Tap any node and its links light up, with the details below.
3D network graph
Free
A 3D network graph you can spin. Tap any node and its links light up, with the details below.
Items orbit into a dotted ring, and payment cards fan out of a wallet as the balance rolls in.
Orbit ring and wallet
Free
Items orbit into a dotted ring, and payment cards fan out of a wallet as the balance rolls in.
A field of bright colored dots that float and shimmer across the whole screen.
Floating color dots
Free
A field of bright colored dots that float and shimmer across the whole screen.
Stacked glass panels in mirrored layers, with neon gradients flowing through them.
Glass color panels
Free
Stacked glass panels in mirrored layers, with neon gradients flowing through them.
Drag the slider and scattered points of light pull together into a perfect 3D sphere.
Dot sphere
Free
Drag the slider and scattered points of light pull together into a perfect 3D sphere.
Living patterns: a mosaic of cells that keeps reshaping, then a hypnotic color swirl.
Cells and swirl
Free
Living patterns: a mosaic of cells that keeps reshaping, then a hypnotic color swirl.
Organic noise shaders: glowing veins that pulse through the dark, then bold color blobs in constant flow.
Noise veins and blobs
Free
Organic noise shaders: glowing veins that pulse through the dark, then bold color blobs in constant flow.