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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
|
<!DOCTYPE html>
<style>
.not-animated {
display: inline-block;
width: 50px;
height: 50px;
border-radius: 50%;
background: #eee;
}
.simple-animation {
display: inline-block;
width: 64px;
height: 64px;
border-radius: 50%;
background: red;
animation: move 200s infinite;
}
.multiple-animations {
display: inline-block;
width: 50px;
height: 50px;
border-radius: 50%;
background: #eee;
animation: move 200s infinite , glow 100s 5;
animation-timing-function: ease-out;
animation-direction: reverse;
animation-fill-mode: both;
}
.transition {
display: inline-block;
width: 50px;
height: 50px;
border-radius: 50%;
background: #f06;
transition: width 500s ease-out;
}
.transition.get-round {
width: 200px;
}
.long-animation {
display: inline-block;
width: 50px;
height: 50px;
border-radius: 50%;
background: gold;
animation: move 100s;
}
.short-animation {
display: inline-block;
width: 50px;
height: 50px;
border-radius: 50%;
background: purple;
animation: move 1s;
}
.delayed-animation {
display: inline-block;
width: 50px;
height: 50px;
border-radius: 50%;
background: rebeccapurple;
animation: move 200s 5s infinite;
}
.delayed-transition {
display: inline-block;
width: 50px;
height: 50px;
border-radius: 50%;
background: black;
transition: width 500s 3s;
}
.delayed-transition.get-round {
width: 200px;
}
.delayed-multiple-animations {
display: inline-block;
width: 50px;
height: 50px;
border-radius: 50%;
background: green;
animation: move .5s 1s 10, glow 1s .75s 30;
}
.multiple-animations-2 {
display: inline-block;
width: 50px;
height: 50px;
border-radius: 50%;
background: blue;
animation: move .5s, glow 100s 2s infinite, grow 300s 1s 100;
}
.all-transitions {
position: absolute;
top: 0;
right: 0;
width: 50px;
height: 50px;
background: blue;
transition: all .2s;
}
.all-transitions.expand {
width: 200px;
height: 100px;
}
@keyframes move {
100% {
transform: translateY(100px);
}
}
@keyframes glow {
100% {
background: yellow;
}
}
@keyframes grow {
100% {
width: 100px;
}
}
</style>
<div class="not-animated"></div>
<div class="simple-animation"></div>
<div class="multiple-animations"></div>
<div class="transition"></div>
<div class="long-animation"></div>
<div class="short-animation"></div>
<div class="delayed-animation"></div>
<div class="delayed-transition"></div>
<div class="delayed-multiple-animations"></div>
<div class="multiple-animations-2"></div>
<div class="all-transitions"></div>
<script type="text/javascript">
"use strict";
// Get the transitions started when the page loads
addEventListener("load", function() {
document.querySelector(".transition").classList.add("get-round");
document.querySelector(".delayed-transition").classList.add("get-round");
});
</script>
|