📋 محتويات الصفحة
📖 الوصف
Rive هي منصة لإنشاء وتشغيل animations التفاعلية في الوقت الحقيقي. تستخدم runtime صغير (~150KB) لعرض animations معقدة مع state machines وinteractivity. Rive تُقدم بديل لـ Lottie مع state machines مدمج وruntime أصغر. تُستخدم في applications, games, وinteractive experiences.
🎯 يستخدم في
مجالات استخدام هذه الأداة
Interactive animations
Game-like interactions
State machine animations
Loading states
Micro-interactions
✨ المميزات
أبرز مميزات هذه الأداة
State machines مدمج
Runtime صغير (~150KB)
Interactive animations
Vector-based
Works مع جميع المنصات
Rive editor (no code)
Performant rendering
⚠️ العيوب
نقاط يجب مراعاتها
يحتاج Rive editor
Learning curve للـ state machines
Community أصغر من Lottie
Paid features
🔄 البدائل
أدوات بديلة يمكنك استخدامها
💻 مثال على الاستخدام
كيفية استخدام هذه الأداة
import { useRive, useStateMachineInput } from '@rive-app/react-canvas';
function InteractiveAnimation() {
const { rive, RiveComponent } = useRive({
src: 'animation.riv',
stateMachines: 'State Machine 1',
autoplay: true
});
const hoverInput = useStateMachineInput(rive, 'State Machine 1', 'Hover');
const clickInput = useStateMachineInput(rive, 'State Machine 1', 'Click');
return (
<RiveComponent
onMouseEnter={() => hoverInput && (hoverInput.value = true)}
onMouseLeave={() => hoverInput && (hoverInput.value = false)}
onClick={() => clickInput && clickInput.fire()}
style={{ width: 400, height: 400 }}
/>
);
}
// React hooks
import { useRive } from '@rive-app/react-canvas';
function SimpleAnimation() {
const { RiveComponent } = useRive({
src: 'https://cdn.rive.app/animations/vehicles.riv',
stateMachines: 'Speed',
autoplay: true,
});
return <RiveComponent style={{ width: 500, height: 500 }} />;
}
// With controls
function ControlledRive() {
const { rive, RiveComponent } = useRive({
src: 'animation.riv',
animations: 'idle',
autoplay: false,
});
useEffect(() => {
if (rive) {
rive.play('idle');
}
}, [rive]);
return <RiveComponent style={{ width: 300, height: 300 }} />;
}
📚 أدوات أخرى في Animation
قد يعجبك أيضاً
Anime.js
⭐مكتبة رسوم متحركة JavaScript (JavaScript Animation Library)
AutoAnimate
مكتبة رسوميات تلقائية بدون إعداد مسبق
Framer Motion
⭐مكتبة رسوم متحركة لـ React (React Animation Library)
GSAP
⭐مكتبة رسوم متحركة قوية (Powerful Animation Library)
Lenis
⭐مكتبة Smooth Scroll (Smooth Scroll Library)
Lottie
⭐مكتبة رسوم متحركة JSON-based (JSON Animation Library)