Siri Orb
NewInstallation
npx shadcn@latest add https://uibrik.com/r/siri-orb.jsonAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/siri-orb/siri-orb.tsx"use client"; // A glass orb for an assistant: black above, glossy clear glass below, with a // helix of coloured strands between that winds round and flares white where // strands cross. The sphere acts as a lens, so the helix stretches to the rim // and splits into colour there, spreading a little way along the edge. Idle, // it drifts; listening, it winds wider with a speech-like rhythm. Every part // of the look is a prop. Drawn in WebGL over a circular backdrop filter. // Sleeps off screen; holds still for reduced motion. import { useEffect, useRef } from "react"; import { cn } from "@/lib/utils"; const vertex = /* glsl */ ` attribute vec2 a_pos; void main() { gl_Position = vec4(a_pos, 0.0, 1.0); } `; const fragment = /* glsl */ ` precision highp float; uniform vec2 u_res; // canvas size in px uniform float u_time; // seconds uniform float u_energy; // 0 idle … 1 listening uniform float u_px; // one pixel in orb units, for anti-aliasing
Adds the files to
components/uibrik/siri-orb. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/siri-orb.Props
SiriOrb- size
- Type number
- 220
- Diameter.
- listening
- Type boolean
- false
- Swell and move as if hearing speech. Clicking the demo orb toggles it too.
- speed
- Type number
- 1.5
- Drift speed.
- colors
- Type string[]
- ["#ff2a1f","#ff8020","#fff8eb","#40e6cc","#3373ff","#9e61ff"]
- Strand colours, spaced evenly round the helix.
- twist
- Type number
- 1
- Turns of the helix across the orb.
- thickness
- Type number
- 1.25
- Strand thickness.
- spread
- Type number
- 1.05
- How far strands wind from the centre line.
- magnify
- Type number
- 1.3
- Lens magnification toward the rim. 0 is flat glass.
- dispersion
- Type number
- 3
- How far colours split apart at the rim.
- rimGlow
- Type number
- 1.5
- Light running along the rim where the helix meets it.
- fade
- Type number
- 0.85
- How far the black thins to translucent grey near the sides, above the helix's ends.
- fadeReach
- Type number
- 0.5
- How high the side fade reaches into the black.
- endSpread
- Type number
- 0
- 0: strands merge into one band at the ends. 1: they stay fanned out.
- topOpacity
- Type number
- 1
- Opacity of the black top half; lower lets the page show through.
- glass
- Type number
- 0.4
- Opacity of the lower glass; 0 is fully clear.
- shine
- Type number
- 0.65
- Reflections on the lower glass, including the glare along the bottom rim; 0 removes them.
- edge
- Type number
- 1.5
- Brightness of the thin edge line.
- label
- Type string
- –
- Read out to screen readers. Defaults to Assistant, or Assistant is listening.
- className
- Type string
- –
- Classes for the wrapper.