margin
padding
color
background
transform
opacity
will-change
* {
will-change: transform;
}
elements.forEach(el => {
el.querySelector('img').style.width
= `${el.offsetWidth}px`;
})
elements.forEach((el, i) => {
ws[i] = el.offsetWidth;
})
elements.forEach((el, i) => {
el.querySelector('img').style.width
= `${ws[i]}px`;
})
Response <100ms
Animation <16ms
Idle <50ms
Load <1000ms
const first =
el.getBoundingClientRect();
el.classList.toggle('end');
const last =
el.getBoundingClientRect();
const invert =
first.height / last.height;
el.animate([
{ transform: `scaleY(${invert})` },
{ transform: 'scaleY(1)' }
], 300);
First
Last
Invert
Play