This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
generated from productdevbookcom/vue-ts-bundle-template
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: change the motion file * feat: add useId
- Loading branch information
Showing
11 changed files
with
113 additions
and
109 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 |
---|---|---|
@@ -1,60 +1,10 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
import { Motion } from '@oku-ui/motion' | ||
const rotate = ref(10) | ||
import Animation from './components/Animation.vue' | ||
</script> | ||
|
||
<template> | ||
<Motion | ||
:animate="{ | ||
rotate: `${rotate}deg`, | ||
backgroundColor: 'var(--yellow)', | ||
}" :transition="{ | ||
duration: 1, | ||
rotate: { duration: 2 }, | ||
}" | ||
/> | ||
|
||
<div | ||
:style="{ | ||
marginTop: '50px', | ||
}" | ||
> | ||
<button @click="rotate += 20"> | ||
Rotate | ||
</button> | ||
</div> | ||
|
||
<Motion | ||
:initial="{ opacity: 0, x: -50 }" :in-view="{ | ||
opacity: 1, | ||
x: 0, | ||
transition: { | ||
delay: 0.5, | ||
easing: [0.17, 0.55, 0.55, 1], | ||
duration: 0.9, | ||
}, | ||
}" | ||
> | ||
<p> | ||
Lorem Ipsum | ||
</p> | ||
</Motion> | ||
<Animation /> | ||
</template> | ||
|
||
<style> | ||
body { | ||
padding: 100px; | ||
} | ||
:root { | ||
--yellow: #000 | ||
} | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
border-radius: 10px; | ||
} | ||
</style> |
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,23 @@ | ||
<script setup lang="ts"> | ||
import { Motion } from '@oku-ui/motion' | ||
</script> | ||
|
||
<template> | ||
<Motion | ||
class="box" | ||
:animate="{ | ||
x: 10, | ||
backgroundColor: '#000', | ||
boxShadow: '10px 10px 0 rgba(0, 2, 0, 0.2)', | ||
position: 'fixed', | ||
// transitionEnd: { display: 'none' }, | ||
}" | ||
/> | ||
</template> | ||
|
||
<style scoped> | ||
.box{ | ||
width: 300px; | ||
height: 300px; | ||
} | ||
</style> |
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,60 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
import { Motion } from '@oku-ui/motion' | ||
const rotate = ref(10) | ||
</script> | ||
|
||
<template> | ||
<Motion | ||
:animate="{ | ||
rotate: `${rotate}deg`, | ||
backgroundColor: 'var(--yellow)', | ||
}" :transition="{ | ||
duration: 1, | ||
rotate: { duration: 2 }, | ||
}" | ||
/> | ||
|
||
<div | ||
:style="{ | ||
marginTop: '50px', | ||
}" | ||
> | ||
<button @click="rotate += 20"> | ||
Rotate | ||
</button> | ||
</div> | ||
|
||
<Motion | ||
:initial="{ opacity: 0, x: -50 }" :in-view="{ | ||
opacity: 1, | ||
x: 0, | ||
transition: { | ||
delay: 0.5, | ||
easing: [0.17, 0.55, 0.55, 1], | ||
duration: 0.9, | ||
}, | ||
}" | ||
> | ||
<p> | ||
Lorem Ipsum | ||
</p> | ||
</Motion> | ||
</template> | ||
|
||
<style> | ||
body { | ||
padding: 100px; | ||
} | ||
:root { | ||
--yellow: #000 | ||
} | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
border-radius: 10px; | ||
} | ||
</style> |
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ref } from 'vue' | ||
import { prefix } from '../context' | ||
|
||
let count = 0 | ||
|
||
function useId(deterministicId?: string): string { | ||
const id = ref<string | undefined>() | ||
|
||
if (!deterministicId) | ||
id.value = id.value ?? String(count++) | ||
|
||
return deterministicId || (id.value ? `${prefix}-${id.value}` : '') | ||
} | ||
|
||
export { useId } |
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 @@ | ||
export function useMotion() {} |
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,5 +1,5 @@ | ||
export { default as Motion } from './component/Motion.vue' | ||
export { default as Presence } from './component/Presence.vue' | ||
export { default as PresenceGroup } from './component/PresenceGroup.vue' | ||
export { default as Motion } from './components/Motion.vue' | ||
export { default as Presence } from './components/Presence.vue' | ||
export { default as PresenceGroup } from './components/PresenceGroup.vue' | ||
|
||
export * from '@motionone/dom' |