bg-animated-gradient-demo
cult-ui/bg-animated-gradient-demoFreeComponent
cult/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/nolly-studio/cult-ui/HEAD/apps/www/public/r/styles/default/bg-animated-gradient-demo.jsonSource
1"use client"23import React, { useState } from "react"4import { Check, Copy, Minus, Plus, Trash2 } from "lucide-react"56import {7 Accordion,8 AccordionContent,9 AccordionItem,10 AccordionTrigger,11} from "@/components/ui/accordion"12import { Button } from "@/components/ui/button"13import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"14import { Input } from "@/components/ui/input"15import { Label } from "@/components/ui/label"16import { Slider } from "@/components/ui/slider"17import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"18import { useToast } from "@/components/ui/use-toast"1920import { GradientAnimation } from "../ui/bg-animated-gradient"2122type GradientStop = {23 color: string24 position: number25}2627type Gradient = {28 stops: GradientStop[]29 centerX: number30 centerY: number31}3233const initialConfig = {34 animationDuration: 5,35 gradients: [36 {37 stops: [38 { color: "#3498DB", position: 0 },39 { color: "#2980B9", position: 25 },40 { color: "#1ABC9C", position: 50 },41 { color: "transparent", position: 75 },42 ],43 centerX: 30,44 centerY: 70,45 },46 {47 stops: [48 { color: "#16A085", position: 0 },49 { color: "#2980B9", position: 25 },50 { color: "#3498DB", position: 50 },51 { color: "transparent", position: 75 },52 ],53 centerX: 70,54 centerY: 30,55 },56 ],57}5859export function ConfigurableGradientAnimation() {60 const [config, setConfig] = useState(initialConfig)61 const [isCopied, setIsCopied] = useState(false)62 const { toast } = useToast()6364 const updateConfig = (key: string, value: any) => {65 setConfig((prev) => ({ ...prev, [key]: value }))66 }6768 const updateGradient = (index: number, updatedGradient: Gradient) => {69 const newGradients = [...config.gradients]70 newGradients[index] = updatedGradient71 updateConfig("gradients", newGradients)72 }7374 const addGradient = () => {75 const newGradient: Gradient = {76 stops: [77 { color: "#000000", position: 0 },78 { color: "#FFFFFF", position: 100 },79 ],80 centerX: 50,81 centerY: 50,82 }83 updateConfig("gradients", [...config.gradients, newGradient])84 }8586 const removeGradient = (index: number) => {87 const newGradients = config.gradients.filter((_, i) => i !== index)88 updateConfig("gradients", newGradients)89 }9091 const copyConfigToClipboard = () => {92 const configString = `93"use client"9495// … truncated
What it pulls in
Other registry items
Files it writes
More from cult/ui
All 157 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-instructionsai-instructions | cult/ui | Components | Free | 2 deps | |
| ai-instructions-demoai-instructions-demo | cult/ui | Components | Free | no deps | |
| animated-numberanimated-number | cult/ui | Components | Free | 1 dep | |
| animated-number-demoanimated-number-demo | cult/ui | Components | Free | no deps | |
| bg-animate-buttonbg-animate-button | cult/ui | Components | Free | no deps | |
| bg-animate-button-demobg-animate-button-demo | cult/ui | Components | Free | no deps | |
| bg-animated-fractal-dot-gridbg-animated-fractal-dot-grid | cult/ui | Components | Free | 1 dep | |
| bg-animated-fractal-dot-grid-demobg-animated-fractal-dot-grid-demo | cult/ui | Components | Free | no deps |
