Skip to content

Commit

Permalink
Merge pull request #68 from tmg0/fix/spring-motion
Browse files Browse the repository at this point in the history
fix: tansition back to small one
  • Loading branch information
tmg0 authored May 27, 2024
2 parents 98f037f + 97a133f commit 80d7501
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/composables/use-hero.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { useHeroContext } from '../composables/use-hero-context'
export type UseHeroProps = Omit<HeroProps, 'as'>

export const defaultTransition = {
type: 'spring',
duration: 800,
type: 'keyframes',
duration: 300,
}

export function useHero(domRef: Ref<any>, props: UseHeroProps) {
Expand Down Expand Up @@ -54,7 +54,7 @@ export function useHero(domRef: Ref<any>, props: UseHeroProps) {
await nextTick()

const initial = { ...unref(prev), x: `${_x}px`, y: `${_y}px`, width: prev.value.width, height: prev.value.height }
const enter = { ...style.value, x: 0, y: 0, width: bounding.width, height: bounding.height, transition: transition.value }
const enter = { ...style.value, x: 0, y: 0, width: bounding.width, height: bounding.height, transition: unref(transition) }

motionInstance = useMotion(domRef, {
initial: omit(initial, props.ignore),
Expand Down

0 comments on commit 80d7501

Please sign in to comment.