You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In `transition-property`, we write a list of properties to animate, for instance: `left`, `margin-left`, `height`, `color`. Or we could write `all`, which means "animate all properties".
77
+
در «transition-property»، ما فهرستی از ویژگیها را برای متحرک کردن مینویسیم، بهعنوان مثال: `left`, `margin-left`, `height`, `color`. یا میتوانیم `all` را بنویسیم که به معنای «animate به همه ویژگیها» است.
78
78
79
-
Do note that, there are properties which can not be animated. However, [most of the generally used properties are animatable](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties).
79
+
توجه داشته باشید که ویژگی هایی وجود دارد که نمی توان آنها را متحرک کرد. با این حال، [بیشتر ویژگیهایی که معمولاً مورد استفاده قرار میگیرند متحرک هستند](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties).
80
80
81
-
## transition-duration
81
+
## مدت زمان انتقال
82
82
83
-
In `transition-duration` we can specify how long the animation should take. The time should be in [CSS time format](https://www.w3.org/TR/css3-values/#time): in seconds `s` or milliseconds `ms`.
83
+
در 'transition-duration' میتوانیم مشخص کنیم که انیمیشن چقدر طول میکشد. زمان باید در [قالب زمان CSS](https://www.w3.org/TR/css3-values/#time): بر حسب ثانیه یا میلی ثانیه «ms» باشد.
84
84
85
85
## transition-delay
86
86
87
-
In`transition-delay`we can specify the delay *before* the animation. For instance, if `transition-delay` is `1s` and `transition-duration` is `2s`, then the animation starts 1 second after the property change and the total duration will be 2 seconds.
87
+
در`transition-delay`میتوانیم تاخیر *قبل از* انیمیشن را مشخص کنیم. برای مثال، اگر `تاخیر انتقال``1 ثانیه` و `مدت انتقال``2 ثانیه` باشد، انیمیشن 1 ثانیه پس از تغییر ویژگی شروع میشود و مدت زمان کل 2 ثانیه خواهد بود.
88
88
89
-
Negative values are also possible. Then the animation is shown immediately, but the starting point of the animation will be after given value (time). For example, if `transition-delay` is `-1s` and `transition-duration` is `2s`, then animation starts from the halfway point and total duration will be 1 second.
90
-
91
-
Here the animation shifts numbers from `0` to `9` using CSS `translate` property:
89
+
مقادیر منفی نیز ممکن است. سپس انیمیشن بلافاصله نشان داده می شود، اما نقطه شروع انیمیشن پس از مقدار داده شده (زمان) خواهد بود. به عنوان مثال، اگر `تاخیر انتقال``-۱ ثانیه` و `مدت انتقال``۲ ثانیه` باشد، انیمیشن از نیمه شروع میشود و مدت زمان کل ۱ ثانیه خواهد بود.
92
90
91
+
در اینجا انیمیشن با استفاده از ویژگی `translate` CSS اعداد را از `0` به `9` تغییر میدهد:
93
92
[codetabs src="digits"]
94
93
95
-
The `transform` property is animated like this:
96
-
94
+
ویژگی `transform` به شکل زیر متحرک است:
97
95
```css
98
96
#stripe.animate {
99
97
transform: translate(-90%);
@@ -102,19 +100,18 @@ The `transform` property is animated like this:
102
100
}
103
101
```
104
102
105
-
In the example above JavaScript adds the class `.animate`to the element -- and the animation starts:
103
+
در مثال بالا جاوا اسکریپت کلاس `.animate`را به عنصر اضافه می کند -- و انیمیشن شروع می شود:
106
104
107
105
```js
108
106
stripe.classList.add('animate');
109
107
```
110
108
111
-
We could also start it from somewhere in the middle of the transition, from an exact number, e.g. corresponding to the current second, using a negative `transition-delay`.
112
-
113
-
Here if you click the digit -- it starts the animation from the current second:
109
+
ما همچنین میتوانیم آن را از جایی در میانه انتقال، از یک عدد دقیق شروع کنیم، به عنوان مثال. متناظر با ثانیه فعلی، با استفاده از `transition-delay` منفی.
114
110
111
+
در اینجا اگر روی رقم کلیک کنید -- انیمیشن را از ثانیه فعلی شروع می کند:
115
112
[codetabs src="digits-negative-delay"]
116
113
117
-
JavaScript does it with an extra line:
114
+
جاوا اسکریپت این کار را با یک خط اضافی انجام می دهد:
The timing function describes how the animation process is distributed along its timeline. Will it start slowly and then go fast, or vice versa.
127
+
## تابع انتقال-زمان
133
128
134
-
It appears to be the most complicated property at first. But it becomes very simple if we devote a bit time to it.
129
+
تابع زمان بندی نحوه توزیع فرآیند انیمیشن در طول جدول زمانی آن را توصیف می کند. آیا به آرامی شروع می شود و سپس سریع می رود یا برعکس.
135
130
136
-
That property accepts two kinds of values: a Bezier curve or steps. Let's start with the curve, as it's used more often.
131
+
به نظر می رسد در ابتدا پیچیده ترین ویژگی باشد. اما اگر کمی زمان را به آن اختصاص دهیم بسیار ساده می شود.
137
132
138
-
### Bezier curve
133
+
این ویژگی دو نوع مقدار را می پذیرد: منحنی Bezier یا مراحل. بیایید با منحنی شروع کنیم، زیرا بیشتر استفاده می شود.
139
134
140
-
The timing function can be set as a [Bezier curve](/bezier-curve) with 4 control points that satisfy the conditions:
135
+
### Bezier منحنی
141
136
142
-
1. First control point: `(0,0)`.
143
-
2. Last control point: `(1,1)`.
144
-
3. For intermediate points, the values of `x` must be in the interval `0..1`, `y` can be anything.
137
+
تابع زمان بندی را می توان به عنوان یک [منحنی Bezier](/bezier-curve) با 4 نقطه کنترل که شرایط را برآورده می کند تنظیم کرد:
138
+
1. اولین نقطه کنترل: `(0,0)`.
139
+
2. آخرین نقطه کنترل: `(1,1)`.
140
+
3. برای نقاط میانی، مقادیر `x` باید در بازه `0..1` باشد، `y` می تواند هر چیزی باشد.
145
141
146
-
The syntax for a Bezier curve in CSS: `cubic-bezier(x2, y2, x3, y3)`. Here we need to specify only 2nd and 3rd control points, because the 1st one is fixed to `(0,0)`and the 4th one is `(1,1)`.
142
+
نحو برای منحنی Bezier در `CSS: cubic-bezier(x2، y2، x3، y3)`. در اینجا باید فقط نقاط کنترل 2 و 3 را مشخص کنیم، زیرا اولین نقطه روی `(0,0)`ثابت شده است و نقطه چهارم `(1،1)` است.
147
143
148
-
The timing function describes how fast the animation process goes.
144
+
تابع زمان بندی سرعت فرآیند انیمیشن را توصیف می کند.
149
145
150
-
-The`x`axis is the time: `0` -- the start, `1` -- the end of`transition-duration`.
151
-
-The`y`axis specifies the completion of the process: `0` -- the starting value of the property, `1` -- the final value.
`*` -- by default, if there's no timing function, `ease`is used.
203
+
`*` -- بهطور پیشفرض، اگر تابع زمانبندی وجود نداشته باشد، `ease`استفاده میشود.
210
204
211
-
So we could use `ease-out`for our slowing down train:
205
+
بنابراین میتوانیم از `ease-out`برای کاهش سرعت قطار خود استفاده کنیم:
212
206
213
207
```css
214
208
.train {
@@ -218,13 +212,13 @@ So we could use `ease-out` for our slowing down train:
218
212
}
219
213
```
220
214
221
-
But it looks a bit differently.
215
+
اما کمی متفاوت به نظر می رسد.
222
216
223
-
**A Bezier curve can make the animation exceed its range.**
217
+
**یک منحنی Bezier می تواند باعث شود که انیمیشن از محدوده خود فراتر رود.**
224
218
225
-
The control points on the curve can have any `y`coordinates: even negative or huge ones. Then the Bezier curve would also extend very low or high, making the animation go beyond its normal range.
219
+
نقاط کنترل روی منحنی می توانند هر مختصات `y`داشته باشند: حتی منفی یا بزرگ. سپس منحنی Bezier نیز بسیار کم یا زیاد می شود و باعث می شود انیمیشن از محدوده طبیعی خود فراتر رود.
226
220
227
-
In the example below the animation code is:
221
+
در مثال زیر کد انیمیشن به شرح زیر است:
228
222
229
223
```css
230
224
.train {
@@ -234,37 +228,36 @@ In the example below the animation code is:
234
228
}
235
229
```
236
230
237
-
The property `left` should animate from `100px` to `400px`.
238
-
239
-
But if you click the train, you'll see that:
231
+
ویژگی "چپ" باید از `100px` تا `400px` متحرک شود.
240
232
241
-
- First, the train goes *back*: `left` becomes less than `100px`.
242
-
- Then it goes forward, a little bit farther than `400px`.
243
-
- And then back again -- to `400px`.
233
+
اما اگر روی قطار کلیک کنید، خواهید دید که:
244
234
235
+
- ابتدا، قطار *به عقب* می رود: «چپ» کمتر از `100px` می شود.
236
+
- سپس به جلو می رود، کمی دورتر از `400px`.
237
+
- و سپس دوباره -- به `400px`.
245
238
[codetabs src="train-over"]
246
239
247
-
Why it happens is pretty obvious if we look at the graph of the given Bezier curve:
240
+
اگر به نمودار منحنی Bezier داده شده نگاه کنیم، چرا این اتفاق می افتد کاملاً واضح است:
248
241
249
242

250
243
251
-
We moved the`y`coordinate of the 2nd point below zero, and for the 3rd point we made it over `1`, so the curve goes out of the "regular" quadrant. The `y`is out of the "standard" range `0..1`.
244
+
مختصات`y`نقطه دوم را به زیر صفر رساندیم و برای نقطه سوم آن را روی `1` قرار دادیم، بنابراین منحنی از ربع `منظم` خارج میشود. `y`خارج از محدوده `استاندارد``0..1` است.
252
245
253
-
As we know, `y`measures "the completion of the animation process". The value `y = 0` corresponds to the starting property value and `y = 1` -- the ending value. So values`y<0`move the property beyond the starting `left` and `y>1` -- past the final `left`.
246
+
همانطور که می دانیم، `y`"تکمیل فرآیند انیمیشن" را اندازه گیری می کند. مقدار "y = 0" مربوط به مقدار ویژگی شروع و `y = 1` - مقدار پایانی است. بنابراین مقادیر`y<0`ویژگی را فراتر از `چپ` شروع و `y>1` - از `چپ` نهایی عبور میکند.
254
247
255
-
That's a "soft" variant for sure. If we put `y`values like `-99`and `99` then the train would jump out of the range much more.
248
+
مطمئناً این یک نوع "نرم" است. اگر مقادیر `y`مانند `-99`و «99» را قرار دهیم، قطار بسیار بیشتر از محدوده خارج خواهد شد.
256
249
257
-
But how do we make a Bezier curve for a specific task? There are many tools.
250
+
اما چگونه یک منحنی Bezier برای یک کار خاص بسازیم؟ ابزارهای زیادی وجود دارد.
258
251
259
-
-For instance, we can do it on the site <https://cubic-bezier.com>.
260
-
-Browser developer tools also have special support for Bezier curves in CSS:
261
-
1.Open the developer tools with`key:F12`(Mac: `key:Cmd+Opt+I`).
262
-
2.Select the `Elements`tab, then pay attention to the `Styles`sub-panel at the right side.
263
-
3.CSS properties with a word`cubic-bezier`will have an icon before this word.
264
-
4.Click this icon to edit the curve.
252
+
-به عنوان مثال، ما می توانیم این کار را در سایت <https://cubic-bezier.com> انجام دهیم.
253
+
-ابزارهای توسعه دهنده مرورگر همچنین از منحنی های Bezier در CSS پشتیبانی می کنند:
254
+
1.ابزارهای توسعه دهنده را با`key:F12`باز کنید (`Mac: key:Cmd+Opt+I`).
255
+
2.برگه `Elements`را انتخاب کنید، سپس به پنل فرعی `Styles`در سمت راست توجه کنید.
256
+
3.ویژگی های CSS با کلمه`cubic-bezier`یک نماد قبل از این کلمه خواهد داشت.
257
+
4.برای ویرایش منحنی روی این نماد کلیک کنید.
265
258
266
259
267
-
### Steps
260
+
### مراحل
268
261
269
262
The timing function `steps(number of steps[, start/end])` allows splitting an transition into multiple steps.
0 commit comments