1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
---
title: animation-timing-function
slug: Web/CSS/animation-timing-function
translation_of: Web/CSS/animation-timing-function
---
<p>{{CSSRef}}</p>
<p><a href="/en-US/docs/CSS" title="CSS">CSS</a> свойство <code><strong>animation-timing-function</strong></code> задаёт как происходит анимация в течении длительности каждого цикла.</p>
<p>{{EmbedInteractiveExample("pages/css/animation-timing-function.html")}}</p>
<p>Достаточно удобно использовать сокращённое свойство {{cssxref("animation")}} для того, чтобы установить все свойства для анимации одновременно.</p>
<h2 id="Синтаксис">Синтаксис</h2>
<pre class="brush: css no-line-numbers language-css"><code class="language-css"><span class="comment token">/* Keyword values */</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> ease<span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> ease-in<span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> ease-out<span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> ease-in-out<span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> linear<span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> step-start<span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> step-end<span class="punctuation token">;</span>
<span class="comment token">/* Function values */</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> <span class="function token">cubic-bezier</span><span class="punctuation token">(</span><span class="number token">0.1</span><span class="punctuation token">,</span> <span class="number token">0.7</span><span class="punctuation token">,</span> <span class="number token">1.0</span><span class="punctuation token">,</span> <span class="number token">0.1</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> <span class="function token">steps</span><span class="punctuation token">(</span><span class="number token">4</span><span class="punctuation token">,</span> end<span class="punctuation token">)</span><span class="punctuation token">;</span>
<span class="comment token">/* Steps Function keywords */</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> <span class="function token">steps</span><span class="punctuation token">(</span><span class="number token">4</span><span class="punctuation token">,</span> jump-start<span class="punctuation token">)</span><span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> <span class="function token">steps</span><span class="punctuation token">(</span><span class="number token">10</span><span class="punctuation token">,</span> jump-end<span class="punctuation token">)</span><span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> <span class="function token">steps</span><span class="punctuation token">(</span><span class="number token">20</span><span class="punctuation token">,</span> jump-none<span class="punctuation token">)</span><span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> <span class="function token">steps</span><span class="punctuation token">(</span><span class="number token">5</span><span class="punctuation token">,</span> jump-both<span class="punctuation token">)</span><span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> <span class="function token">steps</span><span class="punctuation token">(</span><span class="number token">6</span><span class="punctuation token">,</span> start<span class="punctuation token">)</span><span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> <span class="function token">steps</span><span class="punctuation token">(</span><span class="number token">8</span><span class="punctuation token">,</span> end<span class="punctuation token">)</span><span class="punctuation token">;</span>
<span class="comment token">/* Multiple animations */</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> ease<span class="punctuation token">,</span> step-start<span class="punctuation token">,</span> <span class="function token">cubic-bezier</span><span class="punctuation token">(</span><span class="number token">0.1</span><span class="punctuation token">,</span> <span class="number token">0.7</span><span class="punctuation token">,</span> <span class="number token">1.0</span><span class="punctuation token">,</span> <span class="number token">0.1</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
<span class="comment token">/* Global values */</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> inherit<span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> initial<span class="punctuation token">;</span>
<span class="property token">animation-timing-function</span><span class="punctuation token">:</span> unset<span class="punctuation token">;</span></code></pre>
<p>Временные функции могут быть установлены в пользовательских ключевых кадрах в правилах <a href="/en-US/docs/Web/CSS/@keyframes">@keyframes</a>. Если в ключевом кадре значение <code><strong>animation-timing-function</strong></code> указано, соответствующее значение <code><strong>animation-timing-function</strong></code> от элемента к которому анимация применена используется для этого ключевого кадра.</p>
<h3 id="Значения">Значения</h3>
<dl>
<dt><code><timingfunction></code></dt>
<dd>Каждый {{cssxref("<timing-function>")}} представляет функцию расчёта времени для связи с соответствующим свойством animate, как определено в {{cssxref("animation-property")}}.</dd>
</dl>
<h3 id="Формальный_синтаксис">Формальный синтаксис</h3>
{{csssyntax}}
<h2 id="Примеры">Примеры</h2>
<p>См. <a href="/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations" title="en-US/docs/CSS/CSS_animations">CSS animations</a>.</p>
<h2 id="Specifications" name="Specifications">Спецификации</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Спецификация</th>
<th scope="col">Статус</th>
<th scope="col">Комментарий</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('CSS3 Animations', '#animation-timing-function', 'animation-timing-function')}}</td>
<td>{{Spec2('CSS3 Animations')}}</td>
<td>Начальное определение</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">Совместимость с браузерами</h2>
<p>{{Compat("css.properties.animation-timing-function")}}</p>
<p><span style='font-family: x-locale-heading-primary,zillaslab,Palatino,"Palatino Linotype",x-locale-heading-secondary,serif; font-size: 2.33333rem; letter-spacing: -0.00278rem;'>Смотрите также</span></p>
<ul>
<li><a href="/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations" title="CSS developer guide about CSS animations">Использование CSS-анимаций</a></li>
<li>{{domxref("AnimationEvent", "AnimationEvent")}}</li>
</ul>
|