Skip to content

Commit 37a361e

Browse files
committed
up
1 parent 55b0607 commit 37a361e

File tree

13 files changed

+496
-159
lines changed

13 files changed

+496
-159
lines changed

README.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Use this template to build your own documentation with [Nuxt UI](https://ui.nuxt.com) quickly.
66

77
- [Live demo](https://docs-template.nuxt.dev/)
8-
- [Documentation](https://ui.nuxt.com/getting-started/installation)
8+
- [Documentation](https://ui4.nuxt.com/docs/getting-started/installation)
99

1010
<a href="https://docs-template.nuxt.dev/" target="_blank">
1111
<picture>
@@ -53,28 +53,6 @@ pnpm preview
5353

5454
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
5555

56-
## Nuxt Studio integration
57-
58-
Studio is an intuitive CMS interface to edit your Nuxt Content websites.
59-
60-
It take advantage of the Preview API included in Nuxt Content to propose the best editing experience for your content files. Editors can benefit from a user-friendly interface to edit their Markdown, YAML or JSON files.
61-
62-
You can import your project on the platform without any extra setup.
63-
64-
However to enable the live preview on the platform, you just need to activate studio in the content configuration of your `nuxt.config.ts` file.
65-
66-
```ts [nuxt.config.ts]
67-
export default defineNuxtConfig({
68-
content: {
69-
preview: {
70-
api: 'https://api.nuxt.studio'
71-
}
72-
}
73-
})
74-
```
75-
76-
Read more on [Nuxt Studio docs](https://content.nuxt.com/studio/setup).
77-
7856
## Renovate integration
7957

8058
Install [Renovate GitHub app](https://github.com/apps/renovate/installations/select_target) on your repository and you are good to go.

app/app.config.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default defineAppConfig({
3232
}]
3333
},
3434
footer: {
35-
credits: `Copyright © ${new Date().getFullYear()}`,
35+
credits: `Built with Nuxt UI • © ${new Date().getFullYear()}`,
3636
colorMode: false,
3737
links: [{
3838
'icon': 'i-simple-icons-nuxtdotjs',
@@ -69,12 +69,7 @@ export default defineAppConfig({
6969
}, {
7070
icon: 'i-lucide-book-open',
7171
label: 'Nuxt UI docs',
72-
to: 'https://ui.nuxt.com/getting-started/installation',
73-
target: '_blank'
74-
}, {
75-
icon: 'i-lucide-arrow-right',
76-
label: 'Get started',
77-
to: 'https://ui.nuxt.com/getting-started/installation',
72+
to: 'https://ui4.nuxt.com/docs/getting-started/installation/nuxt',
7873
target: '_blank'
7974
}]
8075
}

app/assets/css/main.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@source "../../../content/**/*";
55

66
@theme static {
7+
--container-8xl: 90rem;
78
--font-sans: 'Public Sans', sans-serif;
89

910
--color-green-50: #EFFDF5;
@@ -17,4 +18,8 @@
1718
--color-green-800: #016538;
1819
--color-green-900: #0A5331;
1920
--color-green-950: #052E16;
20-
}
21+
}
22+
23+
:root {
24+
--ui-container: var(--container-8xl);
25+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<script setup lang="ts">
2+
const { isLoading } = useLoadingIndicator()
3+
4+
const appear = ref(false)
5+
const appeared = ref(false)
6+
7+
onMounted(() => {
8+
setTimeout(() => {
9+
appear.value = true
10+
setTimeout(() => {
11+
appeared.value = true
12+
}, 1000)
13+
}, 0)
14+
})
15+
</script>
16+
17+
<template>
18+
<div
19+
class="absolute w-full -top-px transition-all text-primary shrink-0"
20+
:class="[
21+
isLoading ? 'animate-pulse' : (appear ? '' : 'opacity-0'),
22+
appeared ? 'duration-[400ms]': 'duration-1000'
23+
]"
24+
>
25+
<svg
26+
viewBox="0 0 1440 181"
27+
fill="none"
28+
xmlns="http://www.w3.org/2000/svg"
29+
class="pointer-events-none"
30+
>
31+
<mask
32+
id="path-1-inside-1_414_5526"
33+
fill="white"
34+
>
35+
<path d="M0 0H1440V181H0V0Z" />
36+
</mask>
37+
<path
38+
d="M0 0H1440V181H0V0Z"
39+
fill="url(#paint0_linear_414_5526)"
40+
fill-opacity="0.22"
41+
/>
42+
<path
43+
d="M0 2H1440V-2H0V2Z"
44+
fill="url(#paint1_linear_414_5526)"
45+
mask="url(#path-1-inside-1_414_5526)"
46+
/>
47+
<defs>
48+
<linearGradient
49+
id="paint0_linear_414_5526"
50+
x1="720"
51+
y1="0"
52+
x2="720"
53+
y2="181"
54+
gradientUnits="userSpaceOnUse"
55+
>
56+
<stop stop-color="currentColor" />
57+
<stop
58+
offset="1"
59+
stop-color="currentColor"
60+
stop-opacity="0"
61+
/>
62+
</linearGradient>
63+
<linearGradient
64+
id="paint1_linear_414_5526"
65+
x1="0"
66+
y1="90.5"
67+
x2="1440"
68+
y2="90.5"
69+
gradientUnits="userSpaceOnUse"
70+
>
71+
<stop
72+
stop-color="currentColor"
73+
stop-opacity="0"
74+
/>
75+
<stop
76+
offset="0.395"
77+
stop-color="currentColor"
78+
/>
79+
<stop
80+
offset="1"
81+
stop-color="currentColor"
82+
stop-opacity="0"
83+
/>
84+
</linearGradient>
85+
</defs>
86+
</svg>
87+
</div>
88+
</template>

app/components/content/StarsBg.vue

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
<script setup lang="ts">
2+
interface Star {
3+
x: number
4+
y: number
5+
size: number
6+
}
7+
8+
const props = withDefaults(defineProps<{
9+
starCount?: number
10+
color?: string
11+
speed?: 'slow' | 'normal' | 'fast'
12+
size?: { min: number, max: number }
13+
}>(), {
14+
starCount: 300,
15+
color: 'var(--ui-primary)',
16+
speed: 'normal',
17+
size: () => ({
18+
min: 1,
19+
max: 2
20+
})
21+
})
22+
23+
// Generate random star positions and sizes
24+
const generateStars = (count: number): Star[] => {
25+
return Array.from({ length: count }, () => ({
26+
x: Math.floor(Math.random() * 2000),
27+
y: Math.floor(Math.random() * 2000),
28+
size: typeof props.size === 'number'
29+
? props.size
30+
: Math.random() * (props.size.max - props.size.min) + props.size.min
31+
}))
32+
}
33+
34+
// Define speed configurations once
35+
const speedMap = {
36+
slow: { duration: 200, opacity: 0.5, ratio: 0.3 },
37+
normal: { duration: 150, opacity: 0.75, ratio: 0.3 },
38+
fast: { duration: 100, opacity: 1, ratio: 0.4 }
39+
}
40+
41+
// Use a more efficient approach to generate and store stars
42+
const stars = useState<{ slow: Star[], normal: Star[], fast: Star[] }>('stars', () => {
43+
return {
44+
slow: generateStars(Math.floor(props.starCount * speedMap.slow.ratio)),
45+
normal: generateStars(Math.floor(props.starCount * speedMap.normal.ratio)),
46+
fast: generateStars(Math.floor(props.starCount * speedMap.fast.ratio))
47+
}
48+
})
49+
50+
// Compute star layers with different speeds and opacities
51+
const starLayers = computed(() => [
52+
{ stars: stars.value.fast, ...speedMap.fast },
53+
{ stars: stars.value.normal, ...speedMap.normal },
54+
{ stars: stars.value.slow, ...speedMap.slow }
55+
])
56+
</script>
57+
58+
<template>
59+
<div class="absolute pointer-events-none z-[-1] inset-y-0 inset-x-5 sm:inset-x-7 lg:inset-x-9 overflow-hidden">
60+
<svg
61+
class="absolute inset-0 pointer-events-none"
62+
viewBox="0 0 1017 181"
63+
fill="none"
64+
xmlns="http://www.w3.org/2000/svg"
65+
>
66+
<g opacity="0.5">
67+
<mask
68+
id="path-1-inside-1_846_160841"
69+
fill="white"
70+
>
71+
<path d="M0 0H1017V181H0V0Z" />
72+
</mask>
73+
<path
74+
d="M0 0H1017V181H0V0Z"
75+
fill="url(#paint0_radial_846_160841)"
76+
fill-opacity="0.22"
77+
/>
78+
</g>
79+
<defs>
80+
<radialGradient
81+
id="paint0_radial_846_160841"
82+
cx="0"
83+
cy="0"
84+
r="1"
85+
gradientUnits="userSpaceOnUse"
86+
gradientTransform="translate(508.999 19.5) rotate(90.177) scale(161.501 509.002)"
87+
>
88+
<stop stop-color="var(--ui-primary)" />
89+
<stop
90+
offset="1"
91+
stop-color="var(--ui-primary)"
92+
stop-opacity="0"
93+
/>
94+
</radialGradient>
95+
<linearGradient
96+
id="paint1_linear_846_160841"
97+
x1="10.9784"
98+
y1="91"
99+
x2="1017"
100+
y2="90.502"
101+
gradientUnits="userSpaceOnUse"
102+
>
103+
<stop
104+
stop-color="var(--ui-primary)"
105+
stop-opacity="0"
106+
/>
107+
<stop
108+
offset="0.395"
109+
stop-color="var(--ui-primary)"
110+
/>
111+
<stop
112+
offset="1"
113+
stop-color="var(--ui-primary)"
114+
stop-opacity="0"
115+
/>
116+
</linearGradient>
117+
</defs>
118+
</svg>
119+
120+
<div class="stars size-full absolute inset-x-0 top-0">
121+
<div
122+
v-for="(layer, index) in starLayers"
123+
:key="index"
124+
class="star-layer"
125+
:style="{
126+
'--star-duration': `${layer.duration}s`,
127+
'--star-opacity': layer.opacity,
128+
'--star-color': color
129+
}"
130+
>
131+
<div
132+
v-for="(star, starIndex) in layer.stars"
133+
:key="starIndex"
134+
class="star absolute rounded-full"
135+
:style="{
136+
left: `${star.x}px`,
137+
top: `${star.y}px`,
138+
width: `${star.size}px`,
139+
height: `${star.size}px`,
140+
backgroundColor: 'var(--star-color)',
141+
opacity: 'var(--star-opacity)'
142+
}"
143+
/>
144+
</div>
145+
</div>
146+
</div>
147+
</template>
148+
149+
<style scoped>
150+
.stars {
151+
left: 50%;
152+
transform: translate(-50%);
153+
-webkit-mask-image: linear-gradient(180deg,
154+
rgba(217, 217, 217, 0) 0%,
155+
rgba(217, 217, 217, 0.8) 25%,
156+
#d9d9d9 50%,
157+
rgba(217, 217, 217, 0.8) 75%,
158+
rgba(217, 217, 217, 0) 100%);
159+
mask-image: linear-gradient(180deg,
160+
rgba(217, 217, 217, 0) 0%,
161+
rgba(217, 217, 217, 0.8) 25%,
162+
#d9d9d9 50%,
163+
rgba(217, 217, 217, 0.8) 75%,
164+
rgba(217, 217, 217, 0) 100%);
165+
-webkit-mask-size: cover;
166+
mask-size: cover;
167+
}
168+
169+
.star-layer {
170+
animation: risingStarsAnimation linear infinite;
171+
animation-duration: var(--star-duration);
172+
will-change: transform;
173+
}
174+
175+
@keyframes risingStarsAnimation {
176+
0% {
177+
transform: translateY(0);
178+
}
179+
100% {
180+
transform: translateY(-2000px);
181+
}
182+
}
183+
</style>

app/pages/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ useSeoMeta({
1313
ogTitle: title,
1414
description,
1515
ogDescription: description,
16-
ogImage: 'https://assets.hub.nuxt.com/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RvY3MtdGVtcGxhdGUubnV4dC5kZXYiLCJpYXQiOjE3Mzk0NjM0MTd9.ltVAqPgKG38O01X1zl6MXfrJc55nf9OewXNFjpZ_2JY.jpg?theme=light',
17-
twitterImage: 'https://assets.hub.nuxt.com/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RvY3MtdGVtcGxhdGUubnV4dC5kZXYiLCJpYXQiOjE3Mzk0NjM0MTd9.ltVAqPgKG38O01X1zl6MXfrJc55nf9OewXNFjpZ_2JY.jpg?theme=light'
16+
ogImage: 'https://ui4.nuxt.com/assets/templates/nuxt/docs-light.png',
17+
twitterImage: 'https://ui4.nuxt.com/assets/templates/nuxt/docs-light.png'
1818
})
1919
</script>
2020

content/1.getting-started/1.index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,9 @@ There are already many websites based on this template:
7575

7676
This template includes a range of features designed to streamline documentation management:
7777

78-
- **Powered by** [**Nuxt 3**](https://nuxt.com): Utilizes the latest Nuxt framework for optimal performance.
78+
- **Powered by** [**Nuxt**](https://nuxt.com): Utilizes the latest Nuxt framework for optimal performance.
7979
- **Built with** [**Nuxt UI**](https://ui.nuxt.com): Integrates a comprehensive suite of UI components.
8080
- [**MDC Syntax**](https://content.nuxt.com/usage/markdown) **via** [**Nuxt Content**](https://content.nuxt.com): Supports Markdown with component integration for dynamic content.
81-
- [**Nuxt Studio**](https://content.nuxt.com/docs/studio) **Compatible**: Offers integration with Nuxt Studio for content editing.
8281
- **Auto-generated Sidebar Navigation**: Automatically generates navigation from content structure.
8382
- **Full-Text Search**: Includes built-in search functionality for content discovery.
8483
- **Optimized Typography**: Features refined typography for enhanced readability.

content/1.getting-started/2.installation.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ navigation:
55
icon: i-lucide-download
66
---
77

8-
::tip{target="_blank" to="https://content.nuxt.com/templates/docs"}
9-
Use this template on Nuxt Studio and start your documentation in seconds.
10-
::
11-
128
## Quick Start
139

1410
You can start a fresh new project with:

content/1.getting-started/3.usage.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,3 @@ export default defineAppConfig({
116116
}
117117
})
118118
```
119-
120-
::tip{target="_blank" to="https://content.nuxt.com/docs/studio/config"}
121-
This template integrates with Nuxt Studio, providing a visual interface for editing your documentation - perfect for non-technical contributors.
122-
::

0 commit comments

Comments
 (0)