PHP 8.2.31
Preview: MovingGradients.jsx Size: 1.73 KB
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/extendify_old/src/AutoLaunch/components/MovingGradients.jsx

import { useMemo } from '@wordpress/element';
import { colord } from 'colord';
import { motion, useReducedMotion, useTime, useTransform } from 'framer-motion';

export const MovingGradient = () => {
	const time = useTime();
	const shouldReduceMotion = useReducedMotion();

	const bannerMain = useMemo(() => {
		return getComputedStyle(document.documentElement)
			.getPropertyValue('--ext-banner-main')
			.trim();
	}, []);

	const bannerMainWashed = useMemo(() => {
		return colord(bannerMain)
			.desaturate(0.3)
			.lighten(0.4)
			.alpha(0.25)
			.toRgbString();
	}, [bannerMain]);

	const isLight = useMemo(() => colord(bannerMain).isLight(), [bannerMain]);

	const designMain = useMemo(() => {
		return getComputedStyle(document.documentElement)
			.getPropertyValue('--ext-design-main')
			.trim();
	}, []);

	const mainColorLike = useMemo(() => {
		return colord(designMain).desaturate(0.3).alpha(0.25).toRgbString();
	}, [designMain]);

	// stable per-mount random start, 0..1
	const phase = useMemo(() => Math.random(), []);
	const t = useTransform(time, (ms) => (ms / 24000 + phase) % 1);

	const x = useTransform(t, (v) => Math.sin(v * Math.PI * 2) * 180);
	const y = useTransform(t, (v) => Math.cos(v * Math.PI * 2) * 180);

	if (shouldReduceMotion) return null;

	if (isLight) {
		return (
			<motion.div
				style={{
					background: `radial-gradient(circle at center, ${mainColorLike}, transparent 40%)`,
					x,
					y,
				}}
				className="pointer-events-none absolute inset-0 h-full w-full scale-200"
			/>
		);
	}

	return (
		<motion.div
			style={{
				background: `radial-gradient(circle at center, ${bannerMainWashed}, transparent 40%)`,
				x,
				y,
			}}
			className="pointer-events-none absolute inset-0 h-full w-full scale-200"
		/>
	);
};

Directory Contents

Dirs: 0 × Files: 8

Name Size Perms Modified Actions
4.45 KB lrw-r--r-- 2026-03-19 23:35:18
Edit Download
6.47 KB lrw-r--r-- 2026-04-16 23:02:08
Edit Download
731 B lrw-r--r-- 2026-04-09 23:45:00
Edit Download
552 B lrw-r--r-- 2026-03-19 23:35:18
Edit Download
1.73 KB lrw-r--r-- 2026-02-27 04:48:52
Edit Download
846 B lrw-r--r-- 2026-02-27 04:48:52
Edit Download
5.16 KB lrw-r--r-- 2026-03-19 23:35:18
Edit Download
1.28 KB lrw-r--r-- 2026-02-27 04:48:52
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).