Skip to content

Commit 8a3d9b6

Browse files
committed
docs: improve documentation pages config
1 parent f92a038 commit 8a3d9b6

File tree

13 files changed

+135
-74
lines changed

13 files changed

+135
-74
lines changed

docs/app/app.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default defineAppConfig({})

docs/app/assets/css/main.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@import "tailwindcss";
2+
@import "@nuxt/ui";
3+
4+
@theme static {
5+
--font-sans: 'Geom', 'Public Sans', sans-serif;
6+
7+
/* Colors gotten from the anime.js website root styles */
8+
--hex-black-1: #252423;
9+
--hex-red-1: #ff4b4b;
10+
--hex-corail-1: #ff7d36;
11+
--hex-orange-1: #ffa828;
12+
--hex-yellow-1: #ffcc2a;
13+
--hex-citrus-1: #f9f640;
14+
--hex-lime-1: #b7ff54;
15+
--hex-green-1: #8dff55;
16+
--hex-turquoise-1: #00ffaa;
17+
--hex-cyan-1: #26f2d5;
18+
--hex-sky-1: #05dbe9;
19+
--hex-sega-1: #33b3f1;
20+
--hex-king-1: #4d9cff;
21+
--hex-indigo-1: #7c85ff;
22+
--hex-lavender-1: #a369ff;
23+
--hex-purple-1: #c06ddf;
24+
--hex-magenta-1: #e962bf;
25+
--hex-pink-1: #ff718b;
26+
--hex-bg-1: #252423;
27+
--hex-fg-1: #f6f4f2;
28+
29+
--color-primary: var(--hex-red-1);
30+
--color-neutral: var(--hex-black-1);
31+
}
File renamed without changes.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<script setup lang="ts">
2+
import { stagger } from 'animejs/utils'
3+
4+
useAnimate('.boxes > .box', {
5+
scale: [
6+
{ to: [0, 1.25] },
7+
{ to: 0 },
8+
],
9+
boxShadow: [
10+
{ to: '0 0 1rem 0 currentColor' },
11+
{ to: '0 0 0rem 0 currentColor' },
12+
],
13+
delay: stagger(100, {
14+
grid: [10, 4],
15+
from: 'center',
16+
}),
17+
duration: 600,
18+
loop: true,
19+
})
20+
</script>
21+
22+
<template>
23+
<div class="p-8 flex items-center h-64 relative isolate bg-(--hex-bg-1) rounded-lg">
24+
<div class="grid-wrapper boxes">
25+
<div
26+
v-for="i in 40"
27+
:key="i"
28+
class="box"
29+
/>
30+
</div>
31+
<div class="grid-wrapper">
32+
<div
33+
v-for="i in 40"
34+
:key="i"
35+
class="box"
36+
/>
37+
</div>
38+
</div>
39+
</template>
40+
41+
<style scoped>
42+
@reference "~/assets/css/main.css";
43+
44+
.grid-wrapper {
45+
@apply grid grid-cols-10 place-items-center gap-0.5 absolute inset-0 p-5;
46+
}
47+
48+
.box {
49+
@apply size-9 rounded-sm bg-white/40 aspect-square;
50+
}
51+
</style>

docs/components/content/HeroAnimation.vue

Lines changed: 0 additions & 34 deletions
This file was deleted.

docs/content/index.md

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,48 @@ seo:
99
---
1010
orientation: horizontal
1111
---
12-
::code-group
13-
::hero-animation{label="Preview"}
14-
::
15-
```html [Template]
16-
<div class="boxes grid grid-cols-5 place-items-center gap-2.5">
17-
<div class="box size-8 rounded-md bg-white/40" v-for="i in 20" :key="i" />
12+
::tabs
13+
:::tabs-item{icon="i-lucide-eye" label="Preview"}
14+
::hero-animation
15+
::
16+
:::
17+
18+
:::tabs-item{icon="i-lucide-code" label="Template"}
19+
```html
20+
<div class="boxes grid grid-cols-10 place-items-center gap-0.5 absolute inset-0 p-5">
21+
<div v-for="i in 40" :key="i" class="box size-9 rounded-sm bg-white/40 aspect-square" />
1822
</div>
1923
```
20-
```ts [Script]
21-
import { useAnimate } from '#imports';
22-
import { stagger } from "#nanime/utils";
2324

24-
useAnimate(".boxes > .box", {
25-
y: {
26-
to: '-80%',
27-
ease: 'outBack',
28-
duration: 600,
29-
},
30-
rotate: {
31-
from: '-1turn',
32-
delay: 0
33-
},
34-
scale: [1, 1.1, 0.8, 1],
35-
delay: stagger(50),
36-
ease: 'inOutCirc',
37-
loopDelay: 1000,
38-
loop: true,
39-
alternate: true,
40-
});
25+
:::
26+
27+
:::tabs-item{icon="i-lucide-file-code" label="Script"}
28+
```ts
29+
import { stagger } from '#nanime/utils'
30+
31+
useAnimate('.boxes > .box', {
32+
scale: [
33+
{ to: [0, 1.25] },
34+
{ to: 0 }
35+
],
36+
boxShadow: [
37+
{ to: '0 0 1rem 0 currentColor' },
38+
{ to: '0 0 0rem 0 currentColor' }
39+
],
40+
delay: stagger(100, {
41+
grid: [10, 4],
42+
from: 'center',
43+
}),
44+
})
4145
```
46+
:::
4247
::
4348

4449
#title
4550
Effortless animations with [AnimeJS]{.text-primary}
4651

4752
#description
48-
Build SSR Safe animations for Nuxt without having to worry about targets, hooks and component lifecycle.
53+
Create SSR Safe animations for Nuxt without having to worry about targets and component lifecycle.
4954

5055
#links
5156
:::u-button
@@ -96,7 +101,7 @@ Shipped with many features
96101

97102
:::u-page-card
98103
---
99-
icon: i-simple-icons-nuxt
104+
icon: i-tabler-server-cog
100105
spotlight: true
101106
target: _blank
102107
to: https://nuxt.com
@@ -105,12 +110,12 @@ Shipped with many features
105110
[SSR]{.text-primary} safe
106111

107112
#description
108-
Using composables doesn't break ssr nor cause hydration issues
113+
Composables doesn't break ssr nor cause hydration issues
109114
:::
110115

111116
:::u-page-card
112117
---
113-
icon: i-simple-icons-nuxt
118+
icon: i-tabler-settings-bolt
114119
spotlight: true
115120
target: _blank
116121
to: https://nuxt.com/docs/guide/directory-structure/app-config

docs/nuxt.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export default defineNuxtConfig({
22
extends: ['docus'],
3-
modules: ['../src/module'],
3+
modules: ['nanime'],
4+
css: ['./app/assets/css/main.css'],
45
devServer: {
56
port: 3001,
67
},

docs/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "docs",
33
"scripts": {
4-
"dev": "nuxt dev --extends docus",
5-
"build": "nuxt build --extends docus"
4+
"dev": "nuxt dev",
5+
"build": "nuxt build"
66
},
77
"dependencies": {
8-
"docus": "latest",
98
"better-sqlite3": "^12.5.0",
10-
"nuxt": "^4.2.2"
9+
"docus": "latest",
10+
"nanime": "workspace:*",
11+
"nuxt": "^4.3.0"
1112
}
1213
}

docs/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./.nuxt/tsconfig.json",
3+
}

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default createConfigForNuxt({
1212
dirs: {
1313
src: [
1414
'./playground',
15+
'./docs',
1516
],
1617
},
1718
})

0 commit comments

Comments
 (0)