# Shine

Adds a diagonal shine sweep to any content.

Element page: [https://www.remotion.dev/elements/commerce/shine/](https://www.remotion.dev/elements/commerce/shine/)

## Installation

Install this Element into a composition of your Remotion project:

```sh
npx remotion elements use https://www.remotion.dev/elements/commerce/shine/ --composition <composition-id> --yes
```

Replace `<composition-id>` with the ID of the composition to add the Element to. The command installs the dependencies, downloads the assets, writes the source file and adds the Element to the composition. See [`npx remotion elements use`](https://www.remotion.dev/docs/cli/elements/use.md).

## Manual installation

To install the Element manually instead, save the source below as `shine.element.tsx` in your Remotion project and import its exported component.

## Source

```tsx
import {scale} from '@remotion/effects/scale';
import {shine} from '@remotion/effects/shine';
import React from 'react';
import {
	Interactive,
	CanvasImage,
	HtmlInCanvas,
	interpolate,
	useCurrentFrame,
	useVideoConfig,
} from 'remotion';

const ShineInner: React.FC = () => {
	const frame = useCurrentFrame();
	const {durationInFrames} = useVideoConfig();

	return (
		<HtmlInCanvas
			effects={[
				scale({scale: 0.75}),
				shine({
					progress: interpolate(frame, [0, durationInFrames - 1], [0, 1], {
						extrapolateLeft: 'clamp',
						extrapolateRight: 'clamp',
					}),
					angle: 30,
					haloSigma: 200,
					coreSigma: 65,
					haloIntensity: 0.3,
					coreIntensity: 0.4,
				}),
			]}
			height={720}
			name="Shine"
			width={1280}
		>
			<CanvasImage
				fit="cover"
				height={720}
				name="A graphic"
				src="https://remotion.media/elements/commerce-tear-a-graphic.png"
				width={1280}
			/>
		</HtmlInCanvas>
	);
};

export const Shine = Interactive.create({
	Component: ShineInner,
	layout: 'absolute-fill',
});
```

