الفرق بين المراجعتين ل"ReactNative/easing"

من موسوعة حسوب
اذهب إلى التنقل اذهب إلى البحث
(إضافة الصّفحة)
 
ط
 
(5 مراجعات متوسطة بواسطة مستخدمين اثنين آخرين غير معروضة)
سطر 1: سطر 1:
<noinclude>{{DISPLAYTITLE: Easing في React Native}}</noinclude>
+
<noinclude>{{DISPLAYTITLE:الواجهة Easing في React Native}}</noinclude>
 +
تُطبِّق وحدة التسارع ‎‎<code>Easing</code>‎‎ دوال التسارع الشائعة  (easing functions). تُستخدم هذه الوحدة من طرف [[ReactNative/animated|‎‎<code>Animated.timing()</code>‎‎]] لعرض حركة معقولة فيزيائيًّا في التحريكات.
  
تُطبِّق وحدة التخفيف ‎‎<code>Easing</code>‎‎ دوال التخفيف (easing functions) الشائعة. تُستخدم هذه الوحدة من طرف [https://wiki.hsoub.com/ReactNative/animated  ‎‎<code>Animated.timing()</code>‎‎] لعرض حركة معقولة فيزيائيًّا في التحريكات.
+
يمكنك العثور على تجسيد مرئيّ لبعض دوال التسارع الشائعة على [http://easings.net/ easings.net].
 
 
 
 
يمكنك العثور على تجسيد مرئيّ لبعض دوال التخفيف الشائعة على [http://easings.net/ easings.net].
 
  
 
==التحريكات المعرفة مسبقا (Predefined animations)==
 
==التحريكات المعرفة مسبقا (Predefined animations)==
  
توفر وحدة Easing العديد من التحريكات المُعرَّفة مسبقًا من خلال التوابع التالية:
+
توفر وحدة <code>Easing</code> العديد من التحريكات المُعرَّفة مسبقًا من خلال التوابع التالية:
  
 
* ‎‎<code>back</code>‎‎: يوفر تحريكًا بسيطًا يعود فيه الكائن للوراء قليلاً قبل التحرك للأمام.
 
* ‎‎<code>back</code>‎‎: يوفر تحريكًا بسيطًا يعود فيه الكائن للوراء قليلاً قبل التحرك للأمام.
سطر 16: سطر 14:
  
 
==الدوال قياسية==
 
==الدوال قياسية==
تتوفّر ثلاث دوال تخفيف قياسية:
+
تتوفّر ثلاث دوال تسارع قياسية:
 
* ‎‎<code>linear</code>‎‎
 
* ‎‎<code>linear</code>‎‎
 
* ‎‎<code>quad</code>‎‎
 
* ‎‎<code>quad</code>‎‎
 
* ‎‎<code>cubic</code>‎‎
 
* ‎‎<code>cubic</code>‎‎
  
يمكن استخدام الدالة poly لتنفيذ دوال ذات قوة جبرية (power function) أعلى مثل الرباعيّة (quartic) والخماسيّة (quintic) وغيرها.
+
يمكن استخدام الدالة <code>poly</code> لتنفيذ دوال ذات قوة جبرية (power function) أعلى مثل الرباعيّة (quartic) والخماسيّة (quintic) وغيرها.
  
 
==دوال إضافيّة==
 
==دوال إضافيّة==
سطر 27: سطر 25:
 
تتوفّر دوال رياضية إضافية عبر التوابع التالية:
 
تتوفّر دوال رياضية إضافية عبر التوابع التالية:
  
*‎‎<code>bezier</code> ‎‎: يوفر منحنى bezier مكعب.
+
*‎‎<code>bezier</code> ‎‎: يوفر منحنى بيزيه مكعب.
 
*‎‎<code>circle</code> ‎‎: يوفر دالة دائرية.
 
*‎‎<code>circle</code> ‎‎: يوفر دالة دائرية.
 
*‎‎<code>sin</code> ‎‎: يوفر دالة جيبية (sinusoidal function).
 
*‎‎<code>sin</code> ‎‎: يوفر دالة جيبية (sinusoidal function).
 
*‎‎<code>exp</code> ‎‎: يوفر دالة أسية (exponential function).
 
*‎‎<code>exp</code> ‎‎: يوفر دالة أسية (exponential function).
  
تُستخدم التوابع المساعدة التالية لتعديل دوال تخفيفٍ أخرى.
+
تُستخدم التوابع المساعدة التالية لتعديل دوال تسارعٍ أخرى.
 +
 
 +
*‎‎<code>in</code> ‎‎: يُنفِّذ دالة تسارع إلى الأمام.
 +
*‎‎<code>inOut</code> ‎‎: يجعل أي دالة تسارع متناظرة (symmetrical).
 +
*‎‎<code>out</code> ‎‎:  يُنفِّذ دالة تسارع إلى الخلف.
 +
 
 +
== مثال ==
 +
إليك المثال التالي ([https://snack.expo.dev/@hsoubwiki/easing-demo تجربة حية]):<syntaxhighlight lang="js">
 +
import React from "react";
 +
import { Animated, Easing, SectionList, StatusBar, StyleSheet, Text, TouchableOpacity, View } from "react-native";
 +
 
 +
const App = () => {
 +
  let opacity = new Animated.Value(0);
 +
 
 +
  const animate = easing => {
 +
    opacity.setValue(0);
 +
    Animated.timing(opacity, {
 +
      toValue: 1,
 +
      duration: 1200,
 +
      easing
 +
    }).start();
 +
  };
 +
 
 +
  const size = opacity.interpolate({
 +
    inputRange: [0, 1],
 +
    outputRange: [0, 80]
 +
  });
 +
 
 +
  const animatedStyles = [
 +
    styles.box,
 +
    {
 +
      opacity,
 +
      width: size,
 +
      height: size
 +
    }
 +
  ];
 +
 
 +
  return (
 +
    <View style={styles.container}>
 +
      <StatusBar hidden={true} />
 +
      <Text style={styles.title}>
 +
        Press rows below to preview the Easing!
 +
      </Text>
 +
      <View style={styles.boxContainer}>
 +
        <Animated.View style={animatedStyles} />
 +
      </View>
 +
      <SectionList
 +
        style={styles.list}
 +
        sections={SECTIONS}
 +
        keyExtractor={(item) => item.title}
 +
        renderItem={({ item }) => (
 +
          <TouchableOpacity
 +
            onPress={() => animate(item.easing)}
 +
            style={styles.listRow}
 +
          >
 +
            <Text>{item.title}</Text>
 +
          </TouchableOpacity>
 +
        )}
 +
        renderSectionHeader={({ section: { title } }) => (
 +
          <Text style={styles.listHeader}>{title}</Text>
 +
        )}
 +
      />
 +
    </View>
 +
  );
 +
};
 +
 
 +
const SECTIONS = [
 +
  {
 +
    title: "Predefined animations",
 +
    data: [
 +
      { title: "Bounce", easing: Easing.bounce },
 +
      { title: "Ease", easing: Easing.ease },
 +
      { title: "Elastic", easing: Easing.elastic(4) }
 +
    ]
 +
  },
 +
  {
 +
    title: "Standard functions",
 +
    data: [
 +
      { title: "Linear", easing: Easing.linear },
 +
      { title: "Quad", easing: Easing.quad },
 +
      { title: "Cubic", easing: Easing.cubic }
 +
    ]
 +
  },
 +
  {
 +
    title: "Additional functions",
 +
    data: [
 +
      {
 +
        title: "Bezier",
 +
        easing: Easing.bezier(0, 2, 1, -1)
 +
      },
 +
      { title: "Circle", easing: Easing.circle },
 +
      { title: "Sin", easing: Easing.sin },
 +
      { title: "Exp", easing: Easing.exp }
 +
    ]
 +
  },
 +
  {
 +
    title: "Combinations",
 +
    data: [
 +
      {
 +
        title: "In + Bounce",
 +
        easing: Easing.in(Easing.bounce)
 +
      },
 +
      {
 +
        title: "Out + Exp",
 +
        easing: Easing.out(Easing.exp)
 +
      },
 +
      {
 +
        title: "InOut + Elastic",
 +
        easing: Easing.inOut(Easing.elastic(1))
 +
      }
 +
    ]
 +
  }
 +
];
 +
 
 +
const styles = StyleSheet.create({
 +
  container: {
 +
    flex: 1,
 +
    backgroundColor: "#20232a"
 +
  },
 +
  title: {
 +
    marginTop: 10,
 +
    textAlign: "center",
 +
    color: "#61dafb"
 +
  },
 +
  boxContainer: {
 +
    height: 160,
 +
    alignItems: "center"
 +
  },
 +
  box: {
 +
    marginTop: 32,
 +
    borderRadius: 4,
 +
    backgroundColor: "#61dafb"
 +
  },
 +
  list: {
 +
    backgroundColor: "#fff"
 +
  },
 +
  listHeader: {
 +
    paddingHorizontal: 8,
 +
    paddingVertical: 4,
 +
    backgroundColor: "#f4f4f4",
 +
    color: "#999",
 +
    fontSize: 12,
 +
    textTransform: "uppercase"
 +
  },
 +
  listRow: {
 +
    padding: 8
 +
  }
 +
});
  
*‎‎<code>in</code> ‎‎: يُنفِّذ دالة تخفيف إلى الأمام.
+
export default App;
*‎‎<code>inOut</code> ‎‎: يجعل أي دالة تخفيف متناظرة (symmetrical).
+
</syntaxhighlight>
*‎‎<code>out</code> ‎‎:  يُنفِّذ دالة تخفيف إلى الخلف.
 
  
 
==التوابع==
 
==التوابع==
سطر 47: سطر 191:
 
===‎‎<code>step1()</code>‎‎===
 
===‎‎<code>step1()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
step1()
+
static step1(n)
 
</syntaxhighlight>
 
</syntaxhighlight>
 
دالة زحزحة، تُعيد القيمة ‎‎<code>1</code>‎‎ إذا كانت ‎‎<code>n</code>‎‎ أكبر من أو تساوي ‎<code>1</code>‎‎.
 
دالة زحزحة، تُعيد القيمة ‎‎<code>1</code>‎‎ إذا كانت ‎‎<code>n</code>‎‎ أكبر من أو تساوي ‎<code>1</code>‎‎.
 +
 
===‎‎<code>linear()</code>‎‎===
 
===‎‎<code>linear()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
سطر 60: سطر 205:
 
static ease(t)
 
static ease(t)
 
</syntaxhighlight>
 
</syntaxhighlight>
تفاعل قصور ذاتي أساسيّ، على غرار كائنٍ يتسارع ببطء إلى الإسراع.
+
تفاعل قصور ذاتي أساسيّ، على غرار كائنٍ يتسارع ببطء إلى الإسراع. انظر [http://cubic-bezier.com/#.42،0،1،1 هذا المثال].
 
 
[http://cubic-bezier.com/#.42،0،1،1 مثال]
 
 
===‎‎<code>quad()</code>‎‎===
 
===‎‎<code>quad()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
سطر 68: سطر 211:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
دالة تربيعية، ‎‎<code>f(t) = t * t</code>‎‎. يساوي الموقع مربع الوقت المنقضي.
+
دالة تربيعية، ‎‎<code>f(t) = t * t</code>‎‎. يساوي الموقع مربع الوقت المنقضي. انظر [http://easings.net/#easeInQuad هذا المثال].
 
 
[http://easings.net/#easeInQuad مثال]
 
 
===‎‎<code>cubic()</code>‎‎===
 
===‎‎<code>cubic()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
static cubic(t)
 
static cubic(t)
 
</syntaxhighlight>
 
</syntaxhighlight>
دالة تكعيبية، ‎‎<code>f(t) = t * t * t</code>‎‎. يساوي الموقع مكعب الوقت المنقضي.
+
دالة تكعيبية، ‎‎<code>f(t) = t * t * t</code>‎‎. يساوي الموقع مكعب الوقت المنقضي. انظر [http://easings.net/#easeInCubic هذا المثال].
 
 
[http://easings.net/#easeInCubic مثال]
 
 
===‎‎<code>poly()</code>‎‎===
 
===‎‎<code>poly()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
+
static poly(n)
 
</syntaxhighlight>
 
</syntaxhighlight>
دالة قوة جبريّة (power function). يساوي الموقعُ الوقتَ المنقضي أُس ‎‎<code>n</code>‎‎.
+
دالة قوة جبريّة (power function). يساوي الموقعُ الوقتَ المنقضي أُس ‎‎<code>n</code>‎‎. انظر [http://easings.net/#easeInQuart مثال n = 4] وأيضًا [http://easings.net/#easeInQuint مثال n = 5].
[http://easings.net/#easeInQuart مثال n = 4]
 
 
 
[http://easings.net/#easeInQuint مثال n = 5]
 
 
===‎‎<code>sin()</code>‎‎===
 
===‎‎<code>sin()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
سطر 91: سطر 227:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
دالة جيبية.
+
دالة جيبية. انظر [http://easings.net/#easeInSine هذا المثال].
 
 
[http://easings.net/#easeInSine مثال ]
 
 
===‎‎<code>circle()</code>‎‎===
 
===‎‎<code>circle()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
static circle(t)
 
static circle(t)
 
</syntaxhighlight>
 
</syntaxhighlight>
دالة دائرية.
+
دالة دائرية. انظر [http://easings.net/#easeInCirc هذا المثال].
[http://easings.net/#easeInCirc مثال ]
 
 
===‎‎<code>exp()</code>‎‎===
 
===‎‎<code>exp()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
static exp(t)
 
static exp(t)
 
</syntaxhighlight>
 
</syntaxhighlight>
دالة أسية.
+
دالة أسية. انظر [http://easings.net/#easeInExpo هذا المثال].
 
 
[http://easings.net/#easeInExpo مثال ]
 
 
===‎‎<code>elastic()</code>‎‎===
 
===‎‎<code>elastic()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
سطر 114: سطر 245:
  
 
قيمة ‎‎<code>bounciness</code>‎‎ الافتراضية هي ‎‎<code>1</code>‎‎، والتي تتجاوز الحد (overshoot) قليلًا مرة واحدة. القيمة ‎‎<code>0</code>‎‎ لا تتجاوز الحد إطلاقًا، وقيمة ‎‎<code>N > 1</code>‎‎ ستتجاوز الحد عدد N مرات تقريبًا.
 
قيمة ‎‎<code>bounciness</code>‎‎ الافتراضية هي ‎‎<code>1</code>‎‎، والتي تتجاوز الحد (overshoot) قليلًا مرة واحدة. القيمة ‎‎<code>0</code>‎‎ لا تتجاوز الحد إطلاقًا، وقيمة ‎‎<code>N > 1</code>‎‎ ستتجاوز الحد عدد N مرات تقريبًا.
[http://easings.net/#easeInElastic مثال ]
+
 
 +
انظر [http://easings.net/#easeInElastic هذا المثال].
 
===‎‎<code>back()</code>‎‎===
 
===‎‎<code>back()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
سطر 126: سطر 258:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
يوفر تأثير ارتداد أساسي.
+
يوفر تأثير ارتداد أساسي. انظر [http://easings.net/#easeInBounce هذا المثال].
 
 
[http://easings.net/#easeInBounce مثال ]
 
 
===‎‎<code>bezier()</code>‎‎===
 
===‎‎<code>bezier()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
سطر 141: سطر 271:
 
static in(easing);
 
static in(easing);
 
</syntaxhighlight>
 
</syntaxhighlight>
يُنفِّذ دالة تخفيف إلى الأمام.
+
يُنفِّذ دالة تسارع إلى الأمام.
 
===‎‎<code>out()</code>‎‎===
 
===‎‎<code>out()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
static out(easing)
 
static out(easing)
 
</syntaxhighlight>
 
</syntaxhighlight>
يُنفِّذ دالة تخفيف إلى الخلف.
+
يُنفِّذ دالة تسارع إلى الخلف.
 
===‎‎<code>inOut()</code>‎‎===
 
===‎‎<code>inOut()</code>‎‎===
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
static inOut(easing)
 
static inOut(easing)
 
</syntaxhighlight>
 
</syntaxhighlight>
يجعل أي دالة تخفيف متناظرة (symmetrical). ستُنفَّذ دالة التخفيف للأمام لنصف المدة، ثم للخلف لبقية المدة.
+
يجعل أي دالة تسارع متناظرة (symmetrical). ستُنفَّذ دالة التسارع للأمام لنصف المدة، ثم للخلف لبقية المدة.
 
== مصادر ==
 
== مصادر ==
 
* [https://facebook.github.io/react-native/docs/easingZ صفحة Easing في توثيق React Native الرسمي.]
 
* [https://facebook.github.io/react-native/docs/easingZ صفحة Easing في توثيق React Native الرسمي.]
 
[[تصنيف:ReactNative]]
 
[[تصنيف:ReactNative]]
 +
[[تصنيف:React Native API]]

المراجعة الحالية بتاريخ 14:12، 9 أكتوبر 2021

تُطبِّق وحدة التسارع ‎‎Easing‎‎ دوال التسارع الشائعة (easing functions). تُستخدم هذه الوحدة من طرف ‎‎Animated.timing()‎‎ لعرض حركة معقولة فيزيائيًّا في التحريكات.

يمكنك العثور على تجسيد مرئيّ لبعض دوال التسارع الشائعة على easings.net.

التحريكات المعرفة مسبقا (Predefined animations)

توفر وحدة Easing العديد من التحريكات المُعرَّفة مسبقًا من خلال التوابع التالية:

  • ‎‎back‎‎: يوفر تحريكًا بسيطًا يعود فيه الكائن للوراء قليلاً قبل التحرك للأمام.
  • ‎‎bounce‎‎: يُوفِّر تحريك ارتدادٍ.
  • ‎‎ease‎‎: يوفر تحريك قصور ذاتي أساسي (basic inertial animation).
  • ‎‎elastic‎‎: يوفر تفاعل وثبٍ أساسي (basic spring interaction).

الدوال قياسية

تتوفّر ثلاث دوال تسارع قياسية:

  • ‎‎linear‎‎
  • ‎‎quad‎‎
  • ‎‎cubic‎‎

يمكن استخدام الدالة poly لتنفيذ دوال ذات قوة جبرية (power function) أعلى مثل الرباعيّة (quartic) والخماسيّة (quintic) وغيرها.

دوال إضافيّة

تتوفّر دوال رياضية إضافية عبر التوابع التالية:

  • ‎‎bezier ‎‎: يوفر منحنى بيزيه مكعب.
  • ‎‎circle ‎‎: يوفر دالة دائرية.
  • ‎‎sin ‎‎: يوفر دالة جيبية (sinusoidal function).
  • ‎‎exp ‎‎: يوفر دالة أسية (exponential function).

تُستخدم التوابع المساعدة التالية لتعديل دوال تسارعٍ أخرى.

  • ‎‎in ‎‎: يُنفِّذ دالة تسارع إلى الأمام.
  • ‎‎inOut ‎‎: يجعل أي دالة تسارع متناظرة (symmetrical).
  • ‎‎out ‎‎: يُنفِّذ دالة تسارع إلى الخلف.

مثال

إليك المثال التالي (تجربة حية):

import React from "react";
import { Animated, Easing, SectionList, StatusBar, StyleSheet, Text, TouchableOpacity, View } from "react-native";

const App = () => {
  let opacity = new Animated.Value(0);

  const animate = easing => {
    opacity.setValue(0);
    Animated.timing(opacity, {
      toValue: 1,
      duration: 1200,
      easing
    }).start();
  };

  const size = opacity.interpolate({
    inputRange: [0, 1],
    outputRange: [0, 80]
  });

  const animatedStyles = [
    styles.box,
    {
      opacity,
      width: size,
      height: size
    }
  ];

  return (
    <View style={styles.container}>
      <StatusBar hidden={true} />
      <Text style={styles.title}>
        Press rows below to preview the Easing!
      </Text>
      <View style={styles.boxContainer}>
        <Animated.View style={animatedStyles} />
      </View>
      <SectionList
        style={styles.list}
        sections={SECTIONS}
        keyExtractor={(item) => item.title}
        renderItem={({ item }) => (
          <TouchableOpacity
            onPress={() => animate(item.easing)}
            style={styles.listRow}
          >
            <Text>{item.title}</Text>
          </TouchableOpacity>
        )}
        renderSectionHeader={({ section: { title } }) => (
          <Text style={styles.listHeader}>{title}</Text>
        )}
      />
    </View>
  );
};

const SECTIONS = [
  {
    title: "Predefined animations",
    data: [
      { title: "Bounce", easing: Easing.bounce },
      { title: "Ease", easing: Easing.ease },
      { title: "Elastic", easing: Easing.elastic(4) }
    ]
  },
  {
    title: "Standard functions",
    data: [
      { title: "Linear", easing: Easing.linear },
      { title: "Quad", easing: Easing.quad },
      { title: "Cubic", easing: Easing.cubic }
    ]
  },
  {
    title: "Additional functions",
    data: [
      {
        title: "Bezier",
        easing: Easing.bezier(0, 2, 1, -1)
      },
      { title: "Circle", easing: Easing.circle },
      { title: "Sin", easing: Easing.sin },
      { title: "Exp", easing: Easing.exp }
    ]
  },
  {
    title: "Combinations",
    data: [
      {
        title: "In + Bounce",
        easing: Easing.in(Easing.bounce)
      },
      {
        title: "Out + Exp",
        easing: Easing.out(Easing.exp)
      },
      {
        title: "InOut + Elastic",
        easing: Easing.inOut(Easing.elastic(1))
      }
    ]
  }
];

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#20232a"
  },
  title: {
    marginTop: 10,
    textAlign: "center",
    color: "#61dafb"
  },
  boxContainer: {
    height: 160,
    alignItems: "center"
  },
  box: {
    marginTop: 32,
    borderRadius: 4,
    backgroundColor: "#61dafb"
  },
  list: {
    backgroundColor: "#fff"
  },
  listHeader: {
    paddingHorizontal: 8,
    paddingVertical: 4,
    backgroundColor: "#f4f4f4",
    color: "#999",
    fontSize: 12,
    textTransform: "uppercase"
  },
  listRow: {
    padding: 8
  }
});

export default App;

التوابع

‎‎step0()‎‎

static step0(n)

دالة زحزحة (stepping function)، تُعيد القيمة ‎‎1‎‎ لأي قيمة ‎‎n‎‎ موجبة.

‎‎step1()‎‎

static step1(n)

دالة زحزحة، تُعيد القيمة ‎‎1‎‎ إذا كانت ‎‎n‎‎ أكبر من أو تساوي ‎1‎‎.

‎‎linear()‎‎

static linear(t)

دالة خطية،‎‎f(t) = t ‎‎. الموقع يرتبط بالوقت المنقضي واحد لواحد (one to one). مثال

‎‎ease()‎‎

static ease(t)

تفاعل قصور ذاتي أساسيّ، على غرار كائنٍ يتسارع ببطء إلى الإسراع. انظر هذا المثال.

‎‎quad()‎‎

static quad(t)

دالة تربيعية، ‎‎f(t) = t * t‎‎. يساوي الموقع مربع الوقت المنقضي. انظر هذا المثال.

‎‎cubic()‎‎

static cubic(t)

دالة تكعيبية، ‎‎f(t) = t * t * t‎‎. يساوي الموقع مكعب الوقت المنقضي. انظر هذا المثال.

‎‎poly()‎‎

static poly(n)

دالة قوة جبريّة (power function). يساوي الموقعُ الوقتَ المنقضي أُس ‎‎n‎‎. انظر مثال n = 4 وأيضًا مثال n = 5.

‎‎sin()‎‎

static sin(t)

دالة جيبية. انظر هذا المثال.

‎‎circle()‎‎

static circle(t)

دالة دائرية. انظر هذا المثال.

‎‎exp()‎‎

static exp(t)

دالة أسية. انظر هذا المثال.

‎‎elastic()‎‎

static elastic(bounciness)

تفاعل مرن أساسي (basic elastic interaction)، يشبه واثبًا (spring) يتأرجح ذهابًا وإيابًا.

قيمة ‎‎bounciness‎‎ الافتراضية هي ‎‎1‎‎، والتي تتجاوز الحد (overshoot) قليلًا مرة واحدة. القيمة ‎‎0‎‎ لا تتجاوز الحد إطلاقًا، وقيمة ‎‎N > 1‎‎ ستتجاوز الحد عدد N مرات تقريبًا.

انظر هذا المثال.

‎‎back()‎‎

static back(s)

استخدمه مع ‎‎Animated.parallel()‎‎ لإنشاء تأثير أساسي يُحرَّك فيه الكائن للوراء قليلاً مع بدء الحركة.

‎‎bounce()‎‎

static bounce(t)

يوفر تأثير ارتداد أساسي. انظر هذا المثال.

‎‎bezier()‎‎

static bezier(x1, y1, x2, y2)

يوفر منحنى بيزيه مكعب (cubic bezier curve)، أي ما يعادل الانتقال ‎‎transition-timing-function‎‎ الخاص بلغة CSS.

الموقع cubic-bezier.com أداةٌ مفيدة لتجسيد منحنيات بيزيه المكعبة.

‎‎in()‎‎

static in(easing);

يُنفِّذ دالة تسارع إلى الأمام.

‎‎out()‎‎

static out(easing)

يُنفِّذ دالة تسارع إلى الخلف.

‎‎inOut()‎‎

static inOut(easing)

يجعل أي دالة تسارع متناظرة (symmetrical). ستُنفَّذ دالة التسارع للأمام لنصف المدة، ثم للخلف لبقية المدة.

مصادر