Carmen Ansio PRO
Design Engineer at LottieFiles
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
transform
transition
animation
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@media (prefers-reduced-motion: no-preference) {
/* your fancy motion */
}
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
button {
background: white;
transition: background 0.5s linear;
}
button:hover {
background: green;
}
@carmenansio
@carmenansio
button {
transition: background 0.5s linear;
/*long-hand*/
transition-property: all;
transition-duration: 0.4s;
transition-timing-function: ease-out;
transition-delay: 0;
}
@carmenansio
button {
transition: background 0.5s linear;
/*long-hand*/
transition-property: all;
transition-duration: 0.4s;
/*transition-timing-function: ease-out;*/
transition-timing-function: cubic-bezier(.59,-0.26,.33,1.42)
}
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@keyframes grow {
from {
transform: scale(1);
}
to {
transform: scale(2);
}
}
@carmenansio
@keyframes grow {
0% {
transform: scale(1);
}
50% {
transform: scale(1.5);
}
100% {
transform: scale(2);
}
}
@carmenansio
.class {
animation: grow 5s linear 1s;
}
@keyframes grow {
from {
transform: scale(1);
}
to {
transform: scale(2);
}
}
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
"Actualmente, no es posible animar directamente display: none; en CSS"
@carmenansio
.item {
animation: fade-out 0.5s forwards;
}
@keyframes fade-out {
100% {
opacity: 0;
display: none;
}
}
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
.class {
animation:
move-left 2s linear,
change-color 4s linear;
}
@carmenansio
@carmenansio
.class {
animation:
move-left 5s linear 0s, /* Comienza a los 0s */
look-down 2.5s linear 5s, /* Comienza a los 5s (5 de la anterior) */
move-right 5s linear 7.5s, /* Comienza a los 7.5s (5 + 2.5 de la anterior) */
dissapear 2s linear 9.5s; /* Comienza a los 9.5s (5 + 2.5 + 2 de la anterior) */
}
@carmenansio
.item {
width: 100px;
height: 100px;
background: grey;
animation:
move 3s infinite 0s,
rotate 3s infinite 3s;
animation-composition: replace;
}
@keyframes move {
to {
transform: translateX(500px);
background: red;
}
}
@keyframes rotate {
to {
transform: rotate(360deg) scale(0.5);
background: indigo;
}
}
@carmenansio
@carmenansio
@carmenansio
<div class="scene">
<div class="cube">
<div class="face front"></div>
<div class="face back"></div>
<div class="face right"></div>
<div class="face left"></div>
<div class="face top"></div>
<div class="face bottom"></div>
</div>
</div>
@carmenansio
.scene {
width: 200px;
height: 200px;
transform-style: preserve-3d;
animation: rotate 20s infinite linear;
}
@carmenansio
.cube {
width: 100%;
height: 100%;
position: relative;
transform-style: preserve-3d;
}
@carmenansio
.face {
position: absolute;
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
opacity: 0.8;
border: 2px solid rgba(255, 255, 255, 0.5);
}
@carmenansio
.front {
transform: rotateY(0deg) translateZ(100px);
background-image: url("https://picsum.photos/200/200?random=1");
}
@carmenansio
@keyframes rotate {
0% {
transform: rotateX(0) rotateY(0);
}
100% {
transform: rotateX(360deg) rotateY(360deg);
}
}
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
.fill {
animation: progress linear forwards;
animation-timeline: scroll();
}
@keyframes progress {
from {
stroke-dasharray: 0px 1px;
}
to {
stroke-dasharray: 1px 1px;
}
}
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
img {
animation: 2s infinite alternate zoomin;
}
@keyframes zoomin {
from {
margin-left: 100%;
width: 300%;
}
to {
margin-left: 0%;
width: 100%;
}
}
@carmenansio
.element {
animation-name: slidein;
animation-duration: 2s;
animation-timing-function: ease-in-out;
}
@keyframes slidein {
from {
transform: translateX(100%);
}
to {
transform: translateX(0);
}
}
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@keyframes zoomin {
from {
margin-left: 100%;
width: 0%;
}
to {
margin-left: 0%;
width: 50%;
}
}
@carmenansio
img {
animation: zoomin 2s infinite alternate;
}
@carmenansio
img {
animation: zoomin linear both;
animation-timeline: scroll();
}
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
animation-timeline: view();
animation-timeline: scroll();
@carmenansio
@carmenansio
@carmenansio
:root {
animation: scroll 1s linear;
animation-timeline: scroll();
}
body {
min-height: 300vh;
}
@carmenansio
@carmenansio
@property --s {
syntax: "<integer>";
inherits: true;
initial-value: 0;
}
@keyframes scroll {
to {
--s: 100;
}
}
@carmenansio
body::before {
content: "Scroll Progress\A "counter(s) "%";
counter-reset: s var(--s);
font-size: 50px;
font-family: system-ui, sans-serif;
font-weight: 900;
white-space: pre;
text-align: center;
position: fixed;
inset: 0;
width: fit-content;
height: fit-content;
margin: auto;
}
@carmenansio
@carmenansio
@carmenansio
<div class="scroll-container">
<div class="section">Sección 1</div>
<div class="section">Sección 2</div>
<div class="section">Sección 3</div>
<div class="section">Sección 4</div>
</div>
@carmenansio
.scroll-container {
height: 400vh;
display: grid;
grid-template-rows: 100vh 100vh 100vh 100vh;
}
@carmenansio
.cube {
width: 100%;
height: 100%;
position: relative;
transform-style: preserve-3d;
animation: rotate linear;
animation-timeline: scroll();
animation-range: 0 400vh;
}
@carmenansio
animation-timeline: scroll();
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
animation-timeline: scroll(root);
@carmenansio
@supports (animation-timeline: scroll()) {
/* your cool scrolly motion */
}
@carmenansio
@carmenansio
@carmenansio
.content {
animation: appear linear;
animation-range: entry 0% entry 100%;
animation-timeline: view();
}
@carmenansio
@carmenansio
@carmenansio
@carmenansio
<section class="wrap">
<div class="move">
<figure><img src="https://picsum.photos/400/400?random=1" /></figure>
<figure><img src="https://picsum.photos/400/400?random=2" /></figure>
...
</div>
</section>
@carmenansio
img {
width: var(--d);
aspect-ratio: 1;
-webkit-box-reflect: below 0.5em linear-gradient(#0000, #0004);
animation: ry 1s cubic-bezier(0.32, 0, 0.68, 0) both, tz 1s ease-in both;
animation-timeline: view(inline);
}
@carmenansio
@keyframes ry {
0% {
rotate: y -90deg;
}
50% {
rotate: y 0deg;
animation-timing-function: cubic-bezier(0.32, 1, 0.68, 1);
}
100% {
rotate: y 90deg;
}
}
@carmenansio
@keyframes tz {
0% {
translate: -50% 0;
}
50% {
translate: 0 0 calc(1.5 * var(--d));
animation-timing-function: ease-out;
}
100% {
translate: 50% 0;
}
}
@carmenansio
@carmenansio
.content {
animation: appear linear;
animation-range: entry 0% entry 100%;
animation-timeline: view();
}
@carmenansio
@carmenansio
img {
width: 100%;
aspect-ratio: 16/9;
object-fit: cover;
/*timeline*/
view-timeline-name: --image;
view-timeline-axis: block;
/*animation*/
animation-timeline: --image;
animation-name: scroll;
/*range*/
animation-range: entry 25% cover 30%;
animation-fill-mode: both;
}
@carmenansio
@carmenansio
@carmenansio
@supports (animation-timeline: view()) {
/* your fancy scroll motion */
}
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
@carmenansio
By Carmen Ansio