Skip to content

Commit

Permalink
feat: use vueuse extra
Browse files Browse the repository at this point in the history
  • Loading branch information
tmg0 committed Nov 4, 2024
1 parent 65cbb48 commit 1e7b2a3
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 146 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"vue": ">=3.0.0"
},
"dependencies": {
"@tmg0/vueuse-extra": "0.0.2-alpha.2",
"@vueuse/core": "^11.2.0",
"defu": "^6.1.4",
"scule": "^1.3.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/composables/use-hero.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { HeroProps } from '../components/hero'
import { useStyle } from '@tmg0/vueuse-extra'
import { tryOnBeforeUnmount, tryOnMounted, useElementBounding } from '@vueuse/core'
import { useElementTransform, useMotion } from '@vueuse/motion'
import { defu } from 'defu'
import { computed, type MaybeRef, unref, watch } from 'vue'
import { type HeroContext, useHeroContext } from '../composables/use-hero-context'
import { useStyle } from './use-style'

export interface UseHeroProps extends Omit<HeroProps, 'as' | 'ignore'> {
ignore?: string[]
Expand Down Expand Up @@ -66,7 +66,7 @@ export function useHero(target: MaybeRef<HTMLElement | SVGElement | undefined>,

for (let i = 0; i < elt.children.length; i++) {
const child = elt.children[i] as HTMLElement
child.style.transform = `scaleX(${1 / x}) scaleY(${1 / y})`
child.style.transform = `scaleX(${1 / (x as number)}) scaleY(${1 / (y as number)})`
}
})

Expand Down
49 changes: 0 additions & 49 deletions packages/core/src/composables/use-style.ts

This file was deleted.

Loading

0 comments on commit 1e7b2a3

Please sign in to comment.