-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
127 lines (126 loc) · 5.77 KB
/
index.html
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<html>
<head>
<title>Keyframes</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="apple-touch-icon" sizes="180x180" href="./assets/images/favicon.png" />
<link rel="icon" type="image/png" sizes="192x192" href="./assets/images/favicon.png" />
<link rel="icon" type="image/png" sizes="96x96" href="./assets/images/favicon.png" />
<link rel="shortcut icon" type="image/png" href="./assets/images/favicon.png" />
<link href="css/main.css" rel="stylesheet"/>
<script src="./js/out.js" type="text/javascript"></script>
</head>
<body>
<section class="container">
<div class="row full-height">
<div class="col-6 centrified">
<h1 class="main">
Keyframes
</h1>
</div>
</div>
</section>
<section class="container">
<div class="row quarter-height">
<div class="col-6">
<h2>
@keyframes
</h2>
</div>
</div>
<div class="row quarter-height">
<div class="col-3 firstPage">
<h3>What are keyframes?</h3>
<p>This is the basis for creating animations.</p>
<p>Keyframes define how the animation looks at each stage.</p>
<img src="./assets/images/image9.jpeg" alt="image" class="responsive" align="right">
</div>
<div class="col-3">
<img src="assets/images/image8.gif" alt="gif" class="responsive">
</div>
</div>
</section>
<section class="container">
<div class="row quarter-height">
<div class="col-6">
<h2>
@keyframes
</h2>
</div>
</div>
<div class="row quarter-height">
<div class="col-3">
<h3>Keyframe properties</h3>
<p>
The <strong>@keyframes</strong> property is used for determining what should change at what point in
a given animation. For example, in 10% of the animation we will start to change the
background of a given element, in 25% of the animation duration we will change its padding
and in 50% we will rotate it.
</p>
<p>
In the example, the percentages do not have to be round numbers. We can determine the
moment of animation more precisely, e.g. as 10.001%.
</p>
</div>
<div class="col-3">
<h3>Example</h3>
<div class="code">
<code>@keyframes myAnimation {</code>
<em class="indent-1">10% {</em><br>
<em class="indent-2">background: red;</em><br>
<em class="indent-1">}</em><br>
<em class="indent-1">25% {</em><br>
<em class="indent-2">padding: 50px;</em><br>
<em class="indent-1">}</em><br>
<em class="indent-1">50% {</em>
<code class="indent-2">transform: rotate(45deg);</code>
<em class="indent-1">}</em><br>
<em>}</em>
</div>
</div>
</div>
</section>
<section class="container">
<div class="row quarter-height">
<div class="col-6">
<h2>
@keyframes
</h2>
</div>
</div>
<div class="row quarter-height">
<div class="col-3">
<p class="subtitle">Additionally, instead of 0% or 100%, keywords <strong>from</strong> , <strong>to</strong> can be used.</p>
<div class="code">
<code>@keyframes loading {</code>
<em class="indent-1">from {</em><br>
<code class="indent-2">transform: rotate(0deg);</code>
<em class="indent-1">}</em><br>
<em class="indent-1">to {</em><br>
<code class="indent-2">transform: rotate(360deg);</code><br>
<em class="indent-1">}</em><br>
<em>}</em>
</div>
</div>
<div class="col-3">
<p class="subtitle">Very often we will animate many properties of an element at once.</p>
<div class="code">
<code>@keyframes superAnimation {</code>
<em class="indent-1">50% {</em><br>
<code class="indent-2">border-radius: 10px;</code>
<code class="indent-2">padding: 20px;</code>
<em class="indent-1">}</em><br>
<em class="indent-1">60% {</em><br>
<code class="indent-2">width: 200px;</code>
<code class="indent-2">border-radius: 20px;</code>
<em class="indent-2">}</em><br>
<em class="indent-1">80% {</em><br>
<code class="indent-2">background: red;</code>
<em class="indent-1">}</em><br>
<em>}</em>
</div>
</div>
</div>
</section>
</body>
</html>