-
-
Notifications
You must be signed in to change notification settings - Fork 901
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding view() Adding view functions Refactor Latest Latest Latest Removing unused files Latest Latest Adding snapshot test * Latest * Updating sizes * removing logs * Latest * Fixing config * Latest
- Loading branch information
1 parent
8ca78c0
commit d221138
Showing
103 changed files
with
1,767 additions
and
967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<html> | ||
<head> | ||
<style> | ||
body { | ||
margin: 0; | ||
display: flex; | ||
} | ||
|
||
.box { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
position: relative; | ||
left: 0px; | ||
view-transition-name: box; | ||
} | ||
|
||
main { | ||
width: 600px; | ||
padding: 100px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<main> | ||
<div class="box">test</div> | ||
</main> | ||
<script type="module" src="/src/inc.js"></script> | ||
<script type="module"> | ||
const { press, view } = window.MotionDOM | ||
const { scroll, spring } = window.Motion | ||
|
||
const update = () => { | ||
const box = document.querySelector(".box") | ||
box.style.left = "100px" | ||
box.style.top = "100px" | ||
box.style.width = "200px" | ||
box.style.height = "200px" | ||
box.style.backgroundColor = "blue" | ||
document.body.style.backgroundColor = "#eee" | ||
} | ||
|
||
async function runAnimation() { | ||
const animation = await view(update, { | ||
type: spring, | ||
visualDuration: 2, | ||
bounce: 0.4, | ||
opacity: { | ||
bounce: 0, | ||
}, | ||
}).new( | ||
{ | ||
opacity: 1, | ||
transform: ["translateX(100px)", "none"], | ||
}, | ||
{ delay: 1 } | ||
) | ||
|
||
animation.pause() | ||
animation.time = 0.2 | ||
} | ||
|
||
runAnimation() | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import * as Motion from "motion" | ||
import * as MotionDOM from "motion-dom" | ||
|
||
window.MotionDOM = MotionDOM | ||
window.Motion = Motion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
packages/framer-motion/src/animation/animate/resolve-subjects.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 13 additions & 13 deletions
26
packages/framer-motion/src/animation/animators/AcceleratedAnimation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
packages/framer-motion/src/animation/animators/BaseAnimation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 17 additions & 17 deletions
34
packages/framer-motion/src/animation/animators/MainThreadAnimation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
packages/framer-motion/src/animation/animators/__tests__/MainThreadAnimation.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
packages/framer-motion/src/animation/animators/utils/can-animate.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.