Skip to content

Commit 7a55c55

Browse files
committed
docs: change structure
1 parent 6c34f14 commit 7a55c55

37 files changed

+363
-143
lines changed

docs/app.config.ts

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export default defineAppConfig({
88
colorMode: true,
99
links: [
1010
{
11-
'icon': 'i-simple-icons-github',
12-
'to': 'https://github.com/vueuse/motion',
13-
'target': '_blank',
11+
icon: 'i-simple-icons-github',
12+
to: 'https://github.com/vueuse/motion',
13+
target: '_blank',
1414
'aria-label': 'VueUse Motion',
1515
},
1616
],
@@ -21,17 +21,17 @@ export default defineAppConfig({
2121
colorMode: false,
2222
links: [
2323
{
24-
'icon': 'i-simple-icons-github',
25-
'to': 'https://github.com/vueuse/motion',
26-
'target': '_blank',
24+
icon: 'i-simple-icons-github',
25+
to: 'https://github.com/vueuse/motion',
26+
target: '_blank',
2727
'aria-label': 'VueUse Motion',
2828
},
2929
],
3030
},
3131
toc: {
3232
title: 'Table of Contents',
3333
bottom: {
34-
edit: 'https://github.com/vueuse/motion/docs/edit/main/content',
34+
edit: 'https://github.com/vueuse/motion/edit/main/content',
3535
},
3636
},
3737

@@ -52,51 +52,62 @@ export default defineAppConfig({
5252
initial: {
5353
y: '0em',
5454
opacity: 1,
55-
scaleY: 1.15,
56-
scaleX: 0.95,
57-
transition: { damping: 5, mass: 1 },
55+
scale: 1,
56+
transition: { stiffness: 250, mass: 0.5, damping: 5 },
5857
},
5958
visibleOnce: {
6059
y: '0em',
6160
opacity: 1,
6261
rotate: 0,
63-
scaleY: 1,
64-
scaleX: 1,
65-
transition: { damping: 5, mass: 1 },
62+
scale: 1,
63+
transition: { stiffness: 250, mass: 0.5, damping: 5 },
6664
},
65+
// hovered: {
66+
// scale: 1.05,
67+
// rotate: -0.25,
68+
// transition: { damping: 5, mass: 1 },
69+
// },
70+
// tapped: {
71+
// scale: 0.95,
72+
// rotate: 0.25,
73+
// transition: { damping: 5, mass: 1 },
74+
// },
75+
// initial: { scale: 1, transition: { stiffness: 250, mass: .5, damping: 5 }, },
6776
hovered: {
68-
scaleY: 1.05,
69-
scaleX: 1.05,
70-
rotate: -0.25,
71-
transition: { damping: 5, mass: 1 },
77+
scale: 1.1,
78+
transition: { stiffness: 250, mass: 0.5, damping: 5 },
7279
},
7380
tapped: {
74-
scaleY: 0.95,
75-
scaleX: 0.95,
76-
rotate: 0.25,
77-
transition: { damping: 5, mass: 1 },
81+
scale: 0.95,
82+
transition: { stiffness: 250, mass: 0.5, damping: 5 },
7883
},
7984
},
8085
codeGroupButton: {
8186
initial: { scaleY: 1, scaleX: 1, transition: { damping: 5, mass: 0.25 } },
8287
hovered: {
83-
scaleY: 1.15,
84-
scaleX: 0.9,
85-
transition: { damping: 5, mass: 0.25 },
88+
scale: 1.1,
89+
transition: { stiffness: 250, mass: 0.5, damping: 5 },
8690
},
8791
tapped: {
88-
scaleY: 0.5,
89-
scaleX: 1.15,
90-
transition: { damping: 5, mass: 0.25 },
92+
scale: 0.9,
93+
transition: { stiffness: 250, mass: 0.5, damping: 5 },
9194
},
9295
},
9396
pre: {
9497
initial: { y: 100, opacity: 0, transition: { mass: 0.1, damping: 10 } },
9598
visibleOnce: { y: 0, opacity: 1, transition: { mass: 0.1, damping: 10 } },
9699
},
97100
code: {
98-
initial: { y: 100, opacity: 0, transition: { mass: 0.1, damping: 10 } },
99-
visibleOnce: { y: 0, opacity: 1, transition: { mass: 0.1, damping: 10 } },
101+
initial: {
102+
scaleY: 0.5,
103+
opacity: 0,
104+
transition: { stiffness: 250, mass: 0.5, damping: 10 },
105+
},
106+
visibleOnce: {
107+
scaleY: 1,
108+
opacity: 1,
109+
transition: { stiffness: 250, mass: 0.5, damping: 10 },
110+
},
100111
},
101112
ul: {
102113
initial: { x: 100, opacity: 0 },

docs/app.vue

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,26 @@ const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {
2727
2828
// Header
2929
const route = useRoute()
30-
const links: PageLink[] = [
30+
const links: PageLink[] = computed(() => [
3131
{
32-
label: 'Docs',
33-
to: `/docs/getting-started`,
32+
label: 'Getting started',
33+
to: `/getting-started`,
3434
icon: 'i-heroicons-rocket-launch',
35-
active: route.path.startsWith('/docs'),
35+
active: route.path.startsWith('/getting-started'),
3636
},
37-
]
37+
{
38+
label: 'Features',
39+
to: `/features/presets`,
40+
icon: 'i-heroicons-rocket-launch',
41+
active: route.path.startsWith('/features'),
42+
},
43+
{
44+
label: 'Api',
45+
to: `/api/use-motion`,
46+
icon: 'i-heroicons-rocket-launch',
47+
active: route.path.startsWith('/api'),
48+
},
49+
])
3850
</script>
3951

4052
<template>

docs/components/content/PresetSection.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,16 @@ const { data } = await useAsyncData(`preset-${props.name}`, () =>
9191
`::code-group`,
9292
...[
9393
'```vue [<Motion />]',
94-
'<template>',
95-
` <Motion preset="${props.name}" :duration="600" />`,
96-
'</template>',
94+
// '<template>',
95+
`<Motion preset="${props.name}" :duration="600" />`,
96+
// '</template>',
9797
'```',
9898
],
9999
...[
100100
'```vue [v-motion]',
101-
'<template>',
102-
` <div v-motion-${slugify(props.name)} :duration="600" />`,
103-
'</template>',
101+
// '<template>',
102+
`<div v-motion-${slugify(props.name)} :duration="600" />`,
103+
// '</template>',
104104
'```',
105105
],
106106
...[
@@ -149,6 +149,7 @@ const { data } = await useAsyncData(`preset-${props.name}`, () =>
149149
flex-direction: column;
150150
}
151151
152+
152153
.content {
153154
display: flex;
154155
gap: 1em;

docs/components/content/ProseCode.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const { ui } = useUI('content.prose.code', undefined, config, undefined, true)
5050
<template>
5151
<Motion
5252
v-bind="$nuxt._appConfig.motions.code"
53+
style="transform-origin: top;"
5354
class="relative prose-code" :class="!!filename && ui.wrapper"
5455
>
5556
<div v-if="filename && !hideHeader" :class="ui.header">

docs/components/global/CodeGroup.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,21 @@ const selectedTab = computed(() => tabs.value.find((_, index) => index === selec
5252

5353
<template>
5454
<div :class="ui.wrapper" v-bind="attrs">
55+
<!-- v-bind="$nuxt._appConfig.motions.codeGroupButton" -->
5556
<div :class="ui.header">
5657
<Motion
5758
is="button"
5859
v-for="(tab, index) in tabs"
5960
:key="index"
60-
v-bind="$nuxt._appConfig.motions.codeGroupButton"
61+
:initial="{ scale: 1, transition: { stiffness: 250, mass: .5, damping: 5 }, }"
62+
:hovered="{
63+
scale: 1.1,
64+
transition: { stiffness: 250, mass: .5, damping: 5 },
65+
}"
66+
:tapped="{
67+
scale: .95,
68+
transition: { stiffness: 250, mass: .5, damping: 5 },
69+
}"
6170
tabindex="-1"
6271
:class="[ui.tab.base, selectedIndex === index ? ui.tab.active : ui.tab.inactive]"
6372
@click="selectedIndex = index"

docs/content/docs/1.getting-started/1.index.md renamed to docs/content/1.getting-started/1.index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ export default {
5959

6060
## Usage
6161

62-
- How to use directives? Check out [Directive Usage](/docs/features/directive-usage).
62+
- How to use directives? Check out [Directive Usage](/features/directive-usage).
6363

64-
- What properties you can animate? Check out [Motion Properties](/docs/features/motion-properties).
64+
- What properties you can animate? Check out [Motion Properties](/features/motion-properties).
6565

66-
- How to create your own animations styles? Check out [Transition Properties](/docs/features/transition-properties).
66+
- How to create your own animations styles? Check out [Transition Properties](/features/transition-properties).
6767

68-
- What are variants and how you can use them? Check out [Variants](/docs/features/variants).
68+
- What are variants and how you can use them? Check out [Variants](/features/variants).
6969

70-
- How to control your declared variants? Check out [Motion Instance](/docs/features/motion-instance).
70+
- How to control your declared variants? Check out [Motion Instance](/features/motion-instance).
File renamed without changes.

docs/content/docs/2.features/0.presets.md renamed to docs/content/2.features/0.presets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ toc: false
66

77
It allows you to start implementing animations straight after installing the plugin in your Vue app.
88

9-
You can add your own presets to your app using [Custom Directives](/docs/features/directive-usage#custom-directives).
9+
You can add your own presets to your app using [Custom Directives](/features/directive-usage#custom-directives).
1010

1111
If you have any ideas for new presets add an issue on [GitHub](https://github.com/vueuse/motion#issues), or reach me on [Twitter](https://twitter.com/yaeeelglx).
1212

docs/content/docs/2.features/7.components.md renamed to docs/content/2.features/1.component-usage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Components
1+
# Component usage
22

33
vueuse/motion allows you to implement your animations directly within the template of your components without the need to wrap target elements in any additional components.
44

@@ -47,7 +47,7 @@ The `<MotionGroup>` can be used to apply motion configuration to all of its chil
4747
The `<Motion>` and `<MotionGroup>` components allow you to define animation properties (variants) as props.
4848

4949
- **`is`**: What element should rendered (`div` by default for `<Motion>`).
50-
- **`preset`**: Motion preset to use (expects camel-case string), see [Presets](/docs/features/presets).
50+
- **`preset`**: Motion preset to use (expects camel-case string), see [Presets](/features/presets).
5151

5252
### Variant props
5353

@@ -63,7 +63,7 @@ Variants can be passed as an object using the `:variants` prop.
6363

6464
The `:variants` prop combines with other variant properties, allowing for the definition of custom variants from this object.
6565

66-
Additional variant properties can be explored on the [Variants](/docs/features/variants) page.
66+
Additional variant properties can be explored on the [Variants](/features/variants) page.
6767

6868
### Shorthand Props
6969

0 commit comments

Comments
 (0)