Animate on state changeHover
<script>
import { animate, hover } from "motion"
function scaleOnHover(element) {
return hover(element, () => {
animate(element, { scale: 1.3 })
return () => animate(element, { scale: 1 })
})
}
</script>
<div class="box" {@attach scaleOnHover}></div>
<style>
.box {
width: 100px;
height: 100px;
background-color: var(--hue-3);
border-radius: 10px;
}
</style>





