---
title: "Blur Rotate"
description: "Blur Rotate carousel animation for React Native, with a live demo and its full source."
canonical_url: "https://rn-carousel.dev/Examples/custom-animations/blur-rotate"
markdown_url: "https://rn-carousel.dev/Examples/custom-animations/blur-rotate.md"
version: "5"
---
# Blur Rotate

Check out the `blur-rotate` animation demo for the full source code [here](https://github.com/dohooo/react-native-reanimated-carousel/blob/main/example/app/app/demos/custom-animations/blur-rotate/index.tsx)

[Open the interactive blur-rotate demo](https://rn-carousel.dev/Examples/custom-animations/blur-rotate)

```tsx copy
import * as React from "react";
import { StyleSheet, View } from "react-native";
import Animated, {
	interpolate,
	useAnimatedStyle,
} from "react-native-reanimated";
import type { SharedValue } from "react-native-reanimated";
import { Carousel } from "react-native-reanimated-carousel";

import { BlurView as _BlurView } from "expo-blur";

import { parallaxLayout } from "@/features/custom-animations/blur-rotate/parallax";

import { SlideItem } from "@/components/SlideItem";
import { PURPLE_IMAGES } from "@/constants/purple-images";
import { window } from "@/constants/sizes";

const BlurView = Animated.createAnimatedComponent(_BlurView);

function Index() {
	const PAGE_WIDTH = window.width;
	const ITEM_WIDTH = PAGE_WIDTH * 0.8;

	return (
		<View
			id="carousel-component"
			dataSet={{ kind: "custom-animations", name: "blur-rotate" }}
			style={{ width: PAGE_WIDTH, height: ITEM_WIDTH, alignItems: "center" }}
		>
			<Carousel
				orientation="vertical"
				loop={false}
				style={{
					width: PAGE_WIDTH,
					height: ITEM_WIDTH,
				}}
				contentContainerStyle={{
					width: PAGE_WIDTH,
					height: ITEM_WIDTH,
				}}
				snapMode="none"
				data={PURPLE_IMAGES}
				renderItem={({ index, relativeProgress }) => (
					<CustomItem
						key={index}
						index={index}
						relativeProgress={relativeProgress}
					/>
				)}
				itemAnimation={parallaxLayout({
					size: ITEM_WIDTH,
				})}
				animation={{ type: "timing", duration: 1200 }}
			/>
		</View>
	);
}

interface ItemProps {
	index: number;
	relativeProgress: SharedValue<number>;
}
const CustomItem: React.FC<ItemProps> = ({ index, relativeProgress }) => {
	const maskStyle = useAnimatedStyle(() => {
		const opacity = interpolate(
			relativeProgress.value,
			[-0.5, 0, 1, 1.5],
			[1, 0, 0, 1],
		);

		return {
			opacity,
		};
	}, [relativeProgress]);

	return (
		<View
			style={{
				flex: 1,
				borderRadius: 30,
				overflow: "hidden",
				justifyContent: "center",
				alignItems: "center",
			}}
		>
			<View style={{ width: "100%", height: "100%", position: "absolute" }}>
				<SlideItem index={index} />
			</View>

			<BlurView
				intensity={50}
				pointerEvents="none"
				style={[StyleSheet.absoluteFill, maskStyle]}
			/>
		</View>
	);
};

export default Index;

```
