Поставьте зависимости:
npm install @shopify/react-native-skia react-native-reanimatedpnpm add @shopify/react-native-skia react-native-reanimatedyarn add @shopify/react-native-skia react-native-reanimatedbun add @shopify/react-native-skia react-native-reanimatedСкопируйте эти файлы в src/shared/components/organisms/liquid-metal/:
Код доступен по подпискеPro
Исходник «Ртуть» открывается с подпиской Pro. Уже оформили? Войдите в аккаунт.
Проверьте алиас путей. Импорты в коде выше записаны так, как их пишет astra-rn add: @/shared/components, @/shared/utils и @/shared/hooks. Нужен алиас "@/*": ["./src/*"] в tsconfig.json — или поправьте импорты под свои пути.
Код доступен по подпискеPro
Исходник «Ртуть» открывается с подпиской Pro. Уже оформили? Войдите в аккаунт.
source?Тип DataSourceParam
width?Тип number
height?Тип number
lightColor?Тип string
darkColor?Тип string
patternScale?Controls the width/frequency of the liquid pattern.
Тип number
refraction?Controls RGB channel separation/refraction.
Тип number
edge?Controls edge influence.
Тип number
patternBlur?Softens the stripe transitions.
Тип number
liquid?Controls the liquid edge distortion.
Тип number
speed?Animation speed.
Тип number
edgeRadius?Radius used for edge detection.
Тип number
rotation?Rotates the liquid pattern in degrees.
Тип number
noiseStrength?Strength of animated noise distortion.
Тип number
noiseScale?Controls the frequency/scale of the noise.
Тип number
bulgeStrength?Controls how pronounced the liquid bulge is.
Тип number
stripeWarp?Controls RGB stripe distortion.
Тип number
edgeSoftness?Controls how strongly the detected edge affects the liquid effect.
Тип number
paused?Pauses the animation.
Тип boolean
style?Тип StyleProp<ViewStyle>