Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f5a9238
adding stub
mattgperry Dec 13, 2023
39872a6
Latest
mattgperry Dec 14, 2023
92c01c6
Updating
mattgperry Dec 14, 2023
7ac9a87
Update
mattgperry Dec 14, 2023
084aff6
Fixing
mattgperry Dec 15, 2023
7672ee6
Latest
mattgperry Jan 12, 2024
37adbff
Fixing Motion 3D tests
mattgperry Jan 12, 2024
ea5b508
Latest
mattgperry Jan 12, 2024
b08c163
Latest
mattgperry Jan 13, 2024
c5883ff
Fixing
mattgperry Jan 24, 2024
aa24a14
Latest
mattgperry Jan 24, 2024
372f5a8
Reducing size
mattgperry Jan 24, 2024
0296ad2
Fixing test
mattgperry Jan 24, 2024
76e8f76
Updating
mattgperry Jan 25, 2024
ec2adcb
Latest
mattgperry Jan 25, 2024
bdd559c
Latest
mattgperry Jan 25, 2024
05af0a0
Latest
mattgperry Jan 25, 2024
9ba2544
Latest test fixes
mattgperry Jan 25, 2024
a91bd00
Becnhmark changes
mattgperry Jan 26, 2024
19f69bc
Latest
mattgperry Jan 26, 2024
45288f8
Latest
mattgperry Jan 26, 2024
16ac355
Latest
mattgperry Jan 30, 2024
d1fc1da
Latest
mattgperry Jan 30, 2024
57031dd
Fixing tests
mattgperry Jan 30, 2024
fa89b82
Latest
mattgperry Jan 30, 2024
cdbd5f2
Skipping more
mattgperry Jan 31, 2024
cb3789e
Fixing tests:
mattgperry Jan 31, 2024
7380ab8
Fixing
mattgperry Jan 31, 2024
f949a89
Fix/async animation 2 (#2528)
mattgperry Feb 27, 2024
9001d53
undoing benchmark changes
mattgperry Feb 27, 2024
0b8ab84
Clean
mattgperry Feb 27, 2024
e208f4f
Latest
mattgperry Feb 27, 2024
a6e7d87
Updating package
mattgperry Feb 27, 2024
a900c81
Updating test
mattgperry Feb 27, 2024
fc046d3
Latest
mattgperry Feb 27, 2024
b2a0bbd
Updating
mattgperry Feb 27, 2024
15532d0
Latest
mattgperry Feb 27, 2024
958bbbb
Adding comment
mattgperry Feb 27, 2024
3d8f06d
Fixing
mattgperry Feb 27, 2024
b55ab66
Fixing build
mattgperry Feb 27, 2024
85864c2
Change
mattgperry Feb 27, 2024
2a08624
v11.0.7-alpha.0
mattgperry Feb 28, 2024
8e72328
Updating size
mattgperry Feb 28, 2024
1175f07
comments
mattgperry Feb 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ Framer Motion adheres to [Semantic Versioning](http://semver.org/).

Undocumented APIs should be considered internal and may change without warning.

## [11.0.11] 2024-03-12

### Changed

- Keyframes now resolved asynchronously.
- External event handlers now fired synchronously.
- CSS variables and unit conversion now supported with >2 keyframe animations.
- Removed WAAPI animation of `background-color`.

## [11.0.10] 2024-03-12

### Fixed
Expand Down
38 changes: 28 additions & 10 deletions dev/benchmarks/cold-start-anime.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can ignore the /benchmarks


.box {
width: 10px;
width: 10%;
height: 100px;
background-color: #fff;
}
</style>
</head>
<body>
<div class="container"></div>
<script src="../../node_modules/animejs/lib/anime.min.js"></script>
<script src="../../node_modules/animejs/lib/anime.js"></script>
<script>
// Create boxes
const numBoxes = 100
Expand All @@ -45,16 +45,34 @@
html += `<div><div class="box"></div></div>`
}
document.querySelector(".container").innerHTML = html
const boxes = document.querySelectorAll(".box")

setTimeout(() => {
anime({
targets: ".box",
rotate: 360,
backgroundColor: "#f00",
width: "100%",
duration: 1000,
easing: "linear",
})
// Cold start (read from DOM)
boxes.forEach((box) =>
anime({
targets: box,
rotate: Math.random() * 360,
backgroundColor: "#f00",
width: Math.random() * 100 + "%",
translateX: 5,
duration: 1000,
easing: "linear",
})
)

setTimeout(() => {
// Unit conversion
boxes.forEach((box) =>
anime({
targets: box,
width: Math.random() * 100 + "px",
translateX: "50%",
duration: 1000,
easing: "linear",
})
)
}, 1500)
}, 1000)
</script>
</body>
Expand Down
4 changes: 2 additions & 2 deletions dev/benchmarks/cold-start-framer-motion.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
x: 5,
},
{
easing: "linear",
ease: "linear",
duration: 1,
}
)
Expand All @@ -78,7 +78,7 @@
x: "10%",
},
{
easing: "linear",
ease: "linear",
duration: 1,
}
)
Expand Down
55 changes: 43 additions & 12 deletions dev/benchmarks/cold-start-waapi.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,51 @@
html += `<div><div class="box"></div></div>`
}
document.querySelector(".container").innerHTML = html
const boxes = document.querySelectorAll(".box")

boxes.forEach((box) =>
box.animate(
{
rotate: "360deg",
backgroundColor: "#f00",
width: "100%",
},
{
duration: 1000,
fill: "forwards",
setTimeout(() => {
boxes.forEach((box) => {
const animation = box.animate(
{
rotate: Math.random() * 360 + "deg",
backgroundColor: "#f00",
width: Math.random() * 100 + "%",
translate: "5px 0",
},
{
duration: 1000,
fill: "both",
}
)
animation.onfinish = () => {
requestAnimationFrame(() => {
animation.commitStyles()
animation.cancel()
})
}
)
)
})

setTimeout(() => {
boxes.forEach((box) => {
const animation = box.animate(
{
width: Math.random() * 100 + "px",
translate: "50% 0",
},
{
duration: 1000,
fill: "both",
}
)
animation.onfinish = () => {
requestAnimationFrame(() => {
animation.commitStyles()
animation.cancel()
})
}
})
}, 1500)
}, 1000)
</script>
</body>
</html>
73 changes: 73 additions & 0 deletions dev/benchmarks/warm-start-framer-motion.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<html>
<!--
Warm Start: Framer Motion

This benchmarks warm start - when an animation library already
knows the initial animating values.

Run in private browsing mode to avoid browser plugins interfering with
benchmark.
-->
<head>
<style>
body {
padding: 0;
margin: 0;
}

.container {
padding: 100px;
width: 100%;
display: flex;
flex-wrap: wrap;
}

.container > div {
width: 100px;
height: 100px;
}

.box {
width: 10%;
height: 100px;
background-color: #fff;
}
</style>
</head>
<body>
<div class="container"></div>

<script src="../../packages/framer-motion/dist/dom.js"></script>
<script>
// Create boxes
const numBoxes = 100
let html = ``
for (let i = 0; i < numBoxes; i++) {
html += `<div><div class="box"></div></div>`
}
document.querySelector(".container").innerHTML = html

const { animate } = Motion
const boxes = document.querySelectorAll(".box")

setTimeout(() => {
// Warm start
boxes.forEach((box) =>
animate(
box,
{
rotate: [0, Math.random() * 360],
backgroundColor: ["#fff", "#f00"],
width: ["0%", Math.random() * 100 + "%"],
x: [0, 5],
},
{
easing: "linear",
duration: 1,
}
)
)
}, 1000)
</script>
</body>
</html>
84 changes: 84 additions & 0 deletions dev/benchmarks/warm-start-gsap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<html>
<!--
Warm Start: GSAP

This benchmarks warm start - when an animation library already knows
the initial values to animate.

Run in private browsing mode to avoid browser plugins interfering with
benchmark.
-->
<head>
<style>
body {
padding: 0;
margin: 0;
}

.container {
padding: 100px;
width: 100%;
display: flex;
flex-wrap: wrap;
}

.container > div {
width: 100px;
height: 100px;
}

.box {
width: 10px;
height: 100px;
background-color: #fff;
}
</style>
</head>
<body>
<div class="container"></div>
<script src="../../node_modules/gsap/dist/gsap.min.js"></script>
<script>
// Create boxes
const numBoxes = 100
let html = ``
for (let i = 0; i < numBoxes; i++) {
html += `<div><div class="box"></div></div>`
}
document.querySelector(".container").innerHTML = html

const boxes = document.querySelectorAll(".box")

gsap.set(boxes, {
rotate: 0,
backgroundColor: "#fff",
width: "0%",
x: 0,
})

setTimeout(() => {
// Warm start
boxes.forEach((box) =>
gsap.to(box, {
rotate: Math.random() * 360,
backgroundColor: "#f00",
width: Math.random() * 100 + "%",
x: 5,
duration: 1,
})
)

// setTimeout(() => {
// // Unit conversion
// boxes.forEach((box) =>
// gsap.to(box, {
// width: Math.random() * 100 + "px",
// x: "50%",
// duration: 1,
// easing: "linear",
// })
// )
// }, 1500)
}, 1000)
</script>
</body>
</html>
17 changes: 15 additions & 2 deletions dev/tests/animate-presence-pop.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AnimatePresence, motion } from "framer-motion"
import { AnimatePresence, motion, animate } from "framer-motion"
import * as React from "react"
import { useState } from "react"
import { useState, useRef, useEffect } from "react"
import styled from "styled-components"

const Container = styled.section`
Expand All @@ -23,6 +23,15 @@ export const App = () => {
const itemStyle =
position === "relative" ? { position, top: 100, left: 100 } : {}

const ref = useRef<HTMLDivElement>(null)

useEffect(() => {
if (!ref.current) return

animate(ref.current, { opacity: [0, 1] }, { duration: 1 })
animate(ref.current, { opacity: [1, 0.5] }, { duration: 1 })
}, [])

return (
<Container onClick={() => setState(!state)}>
<AnimatePresence mode="popLayout">
Expand Down Expand Up @@ -54,6 +63,10 @@ export const App = () => {
style={{ ...itemStyle, backgroundColor: "blue" }}
/>
</AnimatePresence>
<div
ref={ref}
style={{ ...itemStyle, backgroundColor: "purple" }}
/>
</Container>
)
}
1 change: 1 addition & 0 deletions dev/tests/drag-ref-constraints.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const App = () => {
window.scrollTo(0, 100)
}, [])
const x = useMotionValue("100%")

return (
<div style={{ height: 2000, paddingTop: 100 }}>
<motion.div
Expand Down
2 changes: 1 addition & 1 deletion dev/tests/scroll-animate-window.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useEffect } from "react"
export const App = () => {
useEffect(() => {
/**
* Animate both background-color (WAAPI-driven) and color (sync)
* Animate both transform (WAAPI) and colors (JS)
*/
return scroll(
animate(
Expand Down
Loading