scaff-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +15 -0
- package/bin/scf.js +22 -0
- package/package.json +36 -0
- package/src/commands/add.js +99 -0
- package/src/commands/list.js +30 -0
- package/src/generators/component.js +65 -0
- package/src/templates/html/footer/copyright-navigation.html +11 -0
- package/src/templates/html/footer/copyright-social.html +11 -0
- package/src/templates/html/footer/copyright.html +5 -0
- package/src/templates/html/header/logo-navigation-cta.html +15 -0
- package/src/templates/html/header/logo-navigation.html +12 -0
- package/src/templates/html/header/navigation-only.html +8 -0
- package/src/templates/html/hero/heading-description-button-image.html +17 -0
- package/src/templates/html/hero/heading-description-button.html +13 -0
- package/src/templates/html/hero/heading-description.html +9 -0
- package/src/templates/react/footer/copyright-navigation.jsx +15 -0
- package/src/templates/react/footer/copyright-social.jsx +15 -0
- package/src/templates/react/footer/copyright.jsx +9 -0
- package/src/templates/react/header/logo-navigation-cta.jsx +19 -0
- package/src/templates/react/header/logo-navigation.jsx +16 -0
- package/src/templates/react/header/navigation-only.jsx +12 -0
- package/src/templates/react/hero/heading-description-button-image.jsx +21 -0
- package/src/templates/react/hero/heading-description-button.jsx +17 -0
- package/src/templates/react/hero/heading-description.jsx +13 -0
- package/src/utils/spinner.js +30 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CARL JIMROE MACASPAC PAÑO
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# scaff-js
|
|
2
|
+
|
|
3
|
+
A lightweight CLI for generating simple, ready-made frontend components.
|
|
4
|
+
|
|
5
|
+
Scaff provides common web structure patterns such as headers, heroes, and footers using Tailwind CSS. Generated code is intentionally simple, editable, and easy to adapt.
|
|
6
|
+
|
|
7
|
+
Scaff does not create projects or manage project configuration.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
Install Scaff in your existing frontend project:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install scaff-js
|
|
15
|
+
```
|
package/bin/scf.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const command = process.argv[2];
|
|
4
|
+
|
|
5
|
+
switch (command) {
|
|
6
|
+
case "add":
|
|
7
|
+
await import("../src/commands/add.js");
|
|
8
|
+
break;
|
|
9
|
+
|
|
10
|
+
case "list":
|
|
11
|
+
await import("../src/commands/list.js");
|
|
12
|
+
break;
|
|
13
|
+
|
|
14
|
+
default:
|
|
15
|
+
console.log("Scaff.js");
|
|
16
|
+
console.log("Ready-made Tailwind frontend components.");
|
|
17
|
+
console.log("");
|
|
18
|
+
console.log("Usage:");
|
|
19
|
+
console.log(" scf add");
|
|
20
|
+
console.log(" scf add header");
|
|
21
|
+
console.log(" scf list");
|
|
22
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "scaff-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A lightweight CLI for generating simple, ready-made frontend components.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"scf": "./bin/scf.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "node --test"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"cli",
|
|
13
|
+
"frontend",
|
|
14
|
+
"ui",
|
|
15
|
+
"components",
|
|
16
|
+
"tailwind",
|
|
17
|
+
"html",
|
|
18
|
+
"react"
|
|
19
|
+
],
|
|
20
|
+
"author": "Carl Eoj",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/carleoj/scaff-js.git"
|
|
25
|
+
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/carleoj/scaff-js/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/carleoj/scaff-js#readme",
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=20"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@inquirer/prompts": "^8.7.1"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { access } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { select } from "@inquirer/prompts";
|
|
4
|
+
import { generateComponent } from "../generators/component.js";
|
|
5
|
+
|
|
6
|
+
const FRAMEWORKS = [
|
|
7
|
+
{ name: "HTML", value: "html" },
|
|
8
|
+
{ name: "React", value: "react" },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const COMPONENTS = [
|
|
12
|
+
{ name: "Header", value: "header" },
|
|
13
|
+
{ name: "Hero", value: "hero" },
|
|
14
|
+
{ name: "Footer", value: "footer" },
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
const VARIANTS = {
|
|
18
|
+
header: [
|
|
19
|
+
{ name: "Logo + Navigation Links", value: "logo-navigation" },
|
|
20
|
+
{
|
|
21
|
+
name: "Logo + Navigation Links + CTA Button",
|
|
22
|
+
value: "logo-navigation-cta",
|
|
23
|
+
},
|
|
24
|
+
{ name: "Navigation Links Only", value: "navigation-only" },
|
|
25
|
+
],
|
|
26
|
+
|
|
27
|
+
hero: [
|
|
28
|
+
{
|
|
29
|
+
name: "Heading + Description + Button",
|
|
30
|
+
value: "heading-description-button",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "Heading + Description + Button + Image",
|
|
34
|
+
value: "heading-description-button-image",
|
|
35
|
+
},
|
|
36
|
+
{ name: "Heading + Description Only", value: "heading-description" },
|
|
37
|
+
],
|
|
38
|
+
|
|
39
|
+
footer: [
|
|
40
|
+
{ name: "Copyright Only", value: "copyright" },
|
|
41
|
+
{
|
|
42
|
+
name: "Copyright + Navigation Links",
|
|
43
|
+
value: "copyright-navigation",
|
|
44
|
+
},
|
|
45
|
+
{ name: "Copyright + Social Links", value: "copyright-social" },
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const requestedComponent = process.argv[3];
|
|
50
|
+
|
|
51
|
+
async function isProjectRoot() {
|
|
52
|
+
const packagePath = path.join(process.cwd(), "package.json");
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
await access(packagePath);
|
|
56
|
+
return true;
|
|
57
|
+
} catch {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function addComponent() {
|
|
63
|
+
if (!(await isProjectRoot())) {
|
|
64
|
+
console.error(
|
|
65
|
+
"\nPlease run scf from the root directory of your project.\n",
|
|
66
|
+
);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const framework = await select({
|
|
71
|
+
message: "Select Framework",
|
|
72
|
+
choices: FRAMEWORKS,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const type =
|
|
76
|
+
requestedComponent ??
|
|
77
|
+
(await select({
|
|
78
|
+
message: "Select Component",
|
|
79
|
+
choices: COMPONENTS,
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
if (!VARIANTS[type]) {
|
|
83
|
+
throw new Error(`Unknown component: ${type}`);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const variant = await select({
|
|
87
|
+
message: "Select Variant",
|
|
88
|
+
choices: VARIANTS[type],
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
await generateComponent({
|
|
92
|
+
framework,
|
|
93
|
+
type,
|
|
94
|
+
variant,
|
|
95
|
+
target: process.cwd(),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
await addComponent();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const components = {
|
|
2
|
+
Header: [
|
|
3
|
+
"Logo + Navigation Links",
|
|
4
|
+
"Logo + Navigation Links + CTA Button",
|
|
5
|
+
"Navigation Links Only",
|
|
6
|
+
],
|
|
7
|
+
Hero: [
|
|
8
|
+
"Heading + Description + Button",
|
|
9
|
+
"Heading + Description + Button + Image",
|
|
10
|
+
"Heading + Description Only",
|
|
11
|
+
],
|
|
12
|
+
Footer: [
|
|
13
|
+
"Copyright Only",
|
|
14
|
+
"Copyright + Navigation Links",
|
|
15
|
+
"Copyright + Social Links",
|
|
16
|
+
],
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
console.log("Available components:");
|
|
20
|
+
console.log("");
|
|
21
|
+
|
|
22
|
+
for (const [name, variants] of Object.entries(components)) {
|
|
23
|
+
console.log(name);
|
|
24
|
+
|
|
25
|
+
for (const variant of variants) {
|
|
26
|
+
console.log(` - ${variant}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log("");
|
|
30
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { startSpinner } from "../utils/spinner.js";
|
|
5
|
+
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
const FILE_NAMES = {
|
|
9
|
+
html: {
|
|
10
|
+
header: "header.html",
|
|
11
|
+
hero: "hero.html",
|
|
12
|
+
footer: "footer.html",
|
|
13
|
+
},
|
|
14
|
+
react: {
|
|
15
|
+
header: "Header.jsx",
|
|
16
|
+
hero: "Hero.jsx",
|
|
17
|
+
footer: "Footer.jsx",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function getTemplatePath(framework, type, variant) {
|
|
22
|
+
return path.join(
|
|
23
|
+
__dirname,
|
|
24
|
+
"..",
|
|
25
|
+
"templates",
|
|
26
|
+
framework,
|
|
27
|
+
type,
|
|
28
|
+
`${variant}.${framework === "react" ? "jsx" : "html"}`,
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function getOutputPath(framework, type, target) {
|
|
33
|
+
return path.join(
|
|
34
|
+
target,
|
|
35
|
+
"src",
|
|
36
|
+
"components",
|
|
37
|
+
FILE_NAMES[framework][type],
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function generateComponent({
|
|
42
|
+
framework,
|
|
43
|
+
type,
|
|
44
|
+
variant,
|
|
45
|
+
target,
|
|
46
|
+
}) {
|
|
47
|
+
const templatePath = getTemplatePath(framework, type, variant);
|
|
48
|
+
const outputPath = getOutputPath(framework, type, target);
|
|
49
|
+
|
|
50
|
+
const spinner = startSpinner(`Adding ${type}...`);
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
const template = await fs.readFile(templatePath, "utf8");
|
|
54
|
+
|
|
55
|
+
await fs.mkdir(path.dirname(outputPath), {
|
|
56
|
+
recursive: true,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
await fs.writeFile(outputPath, template, "utf8");
|
|
60
|
+
} finally {
|
|
61
|
+
spinner();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
console.log(`✓ Created ${path.relative(target, outputPath)}`);
|
|
65
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<footer class="border-t border-gray-200 px-6 py-6">
|
|
2
|
+
<div class="mx-auto flex max-w-7xl items-center justify-between">
|
|
3
|
+
<p class="text-sm text-gray-500">© 2026 Your Company. All rights reserved.</p>
|
|
4
|
+
|
|
5
|
+
<nav class="flex gap-6">
|
|
6
|
+
<a href="#" class="text-sm text-gray-500 hover:text-black">About</a>
|
|
7
|
+
<a href="#" class="text-sm text-gray-500 hover:text-black">Projects</a>
|
|
8
|
+
<a href="#" class="text-sm text-gray-500 hover:text-black">Contact</a>
|
|
9
|
+
</nav>
|
|
10
|
+
</div>
|
|
11
|
+
</footer>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<footer class="border-t border-gray-200 px-6 py-6">
|
|
2
|
+
<div class="mx-auto flex max-w-7xl items-center justify-between">
|
|
3
|
+
<p class="text-sm text-gray-500">© 2026 Your Company. All rights reserved.</p>
|
|
4
|
+
|
|
5
|
+
<div class="flex gap-4">
|
|
6
|
+
<a href="#" class="text-sm text-gray-500 hover:text-black">GitHub</a>
|
|
7
|
+
<a href="#" class="text-sm text-gray-500 hover:text-black">LinkedIn</a>
|
|
8
|
+
<a href="#" class="text-sm text-gray-500 hover:text-black">X</a>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</footer>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<header class="border-b border-gray-200">
|
|
2
|
+
<nav class="mx-auto flex max-w-7xl items-center justify-between px-6 py-4">
|
|
3
|
+
<a href="/" class="text-xl font-semibold">Logo</a>
|
|
4
|
+
|
|
5
|
+
<div class="flex items-center gap-6">
|
|
6
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">Home</a>
|
|
7
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">About</a>
|
|
8
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">Projects</a>
|
|
9
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">Contact</a>
|
|
10
|
+
<a href="#" class="rounded-lg bg-black px-4 py-2 text-sm font-medium text-white">
|
|
11
|
+
Get Started
|
|
12
|
+
</a>
|
|
13
|
+
</div>
|
|
14
|
+
</nav>
|
|
15
|
+
</header>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<header class="border-b border-gray-200">
|
|
2
|
+
<nav class="mx-auto flex max-w-7xl items-center justify-between px-6 py-4">
|
|
3
|
+
<a href="/" class="text-xl font-semibold">Logo</a>
|
|
4
|
+
|
|
5
|
+
<div class="flex items-center gap-6">
|
|
6
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">Home</a>
|
|
7
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">About</a>
|
|
8
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">Projects</a>
|
|
9
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">Contact</a>
|
|
10
|
+
</div>
|
|
11
|
+
</nav>
|
|
12
|
+
</header>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<header class="border-b border-gray-200">
|
|
2
|
+
<nav class="mx-auto flex max-w-7xl items-center justify-center gap-6 px-6 py-4">
|
|
3
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">Home</a>
|
|
4
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">About</a>
|
|
5
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">Projects</a>
|
|
6
|
+
<a href="#" class="text-sm text-gray-700 hover:text-black">Contact</a>
|
|
7
|
+
</nav>
|
|
8
|
+
</header>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<section class="px-6 py-24">
|
|
2
|
+
<div class="mx-auto grid max-w-6xl items-center gap-12 lg:grid-cols-2">
|
|
3
|
+
<div>
|
|
4
|
+
<h1 class="text-5xl font-bold tracking-tight">Build something great.</h1>
|
|
5
|
+
|
|
6
|
+
<p class="mt-6 max-w-xl text-lg text-gray-600">
|
|
7
|
+
A simple description for your project goes here.
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<a href="#" class="mt-8 inline-block rounded-lg bg-black px-6 py-3 font-medium text-white">
|
|
11
|
+
Get Started
|
|
12
|
+
</a>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div class="aspect-video rounded-2xl bg-gray-100"></div>
|
|
16
|
+
</div>
|
|
17
|
+
</section>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<section class="px-6 py-24">
|
|
2
|
+
<div class="mx-auto max-w-4xl text-center">
|
|
3
|
+
<h1 class="text-5xl font-bold tracking-tight">Build something great.</h1>
|
|
4
|
+
|
|
5
|
+
<p class="mx-auto mt-6 max-w-2xl text-lg text-gray-600">
|
|
6
|
+
A simple description for your project goes here.
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<a href="#" class="mt-8 inline-block rounded-lg bg-black px-6 py-3 font-medium text-white">
|
|
10
|
+
Get Started
|
|
11
|
+
</a>
|
|
12
|
+
</div>
|
|
13
|
+
</section>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<section class="px-6 py-24">
|
|
2
|
+
<div class="mx-auto max-w-4xl text-center">
|
|
3
|
+
<h1 class="text-5xl font-bold tracking-tight">Build something great.</h1>
|
|
4
|
+
|
|
5
|
+
<p class="mx-auto mt-6 max-w-2xl text-lg text-gray-600">
|
|
6
|
+
A simple description for your project goes here.
|
|
7
|
+
</p>
|
|
8
|
+
</div>
|
|
9
|
+
</section>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function Footer() {
|
|
2
|
+
return (
|
|
3
|
+
<footer className="border-t border-gray-200 px-6 py-6">
|
|
4
|
+
<div className="mx-auto flex max-w-7xl items-center justify-between">
|
|
5
|
+
<p className="text-sm text-gray-500">© 2026 Your Company. All rights reserved.</p>
|
|
6
|
+
|
|
7
|
+
<nav className="flex gap-6">
|
|
8
|
+
<a href="#" className="text-sm text-gray-500 hover:text-black">About</a>
|
|
9
|
+
<a href="#" className="text-sm text-gray-500 hover:text-black">Projects</a>
|
|
10
|
+
<a href="#" className="text-sm text-gray-500 hover:text-black">Contact</a>
|
|
11
|
+
</nav>
|
|
12
|
+
</div>
|
|
13
|
+
</footer>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function Footer() {
|
|
2
|
+
return (
|
|
3
|
+
<footer className="border-t border-gray-200 px-6 py-6">
|
|
4
|
+
<div className="mx-auto flex max-w-7xl items-center justify-between">
|
|
5
|
+
<p className="text-sm text-gray-500">© 2026 Your Company. All rights reserved.</p>
|
|
6
|
+
|
|
7
|
+
<div className="flex gap-4">
|
|
8
|
+
<a href="#" className="text-sm text-gray-500 hover:text-black">GitHub</a>
|
|
9
|
+
<a href="#" className="text-sm text-gray-500 hover:text-black">LinkedIn</a>
|
|
10
|
+
<a href="#" className="text-sm text-gray-500 hover:text-black">X</a>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</footer>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default function Header() {
|
|
2
|
+
return (
|
|
3
|
+
<header className="border-b border-gray-200">
|
|
4
|
+
<nav className="mx-auto flex max-w-7xl items-center justify-between px-6 py-4">
|
|
5
|
+
<a href="/" className="text-xl font-semibold">Logo</a>
|
|
6
|
+
|
|
7
|
+
<div className="flex items-center gap-6">
|
|
8
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">Home</a>
|
|
9
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">About</a>
|
|
10
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">Projects</a>
|
|
11
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">Contact</a>
|
|
12
|
+
<a href="#" className="rounded-lg bg-black px-4 py-2 text-sm font-medium text-white">
|
|
13
|
+
Get Started
|
|
14
|
+
</a>
|
|
15
|
+
</div>
|
|
16
|
+
</nav>
|
|
17
|
+
</header>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default function Header() {
|
|
2
|
+
return (
|
|
3
|
+
<header className="border-b border-gray-200">
|
|
4
|
+
<nav className="mx-auto flex max-w-7xl items-center justify-between px-6 py-4">
|
|
5
|
+
<a href="/" className="text-xl font-semibold">Logo</a>
|
|
6
|
+
|
|
7
|
+
<div className="flex items-center gap-6">
|
|
8
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">Home</a>
|
|
9
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">About</a>
|
|
10
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">Projects</a>
|
|
11
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">Contact</a>
|
|
12
|
+
</div>
|
|
13
|
+
</nav>
|
|
14
|
+
</header>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default function Header() {
|
|
2
|
+
return (
|
|
3
|
+
<header className="border-b border-gray-200">
|
|
4
|
+
<nav className="mx-auto flex max-w-7xl items-center justify-center gap-6 px-6 py-4">
|
|
5
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">Home</a>
|
|
6
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">About</a>
|
|
7
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">Projects</a>
|
|
8
|
+
<a href="#" className="text-sm text-gray-700 hover:text-black">Contact</a>
|
|
9
|
+
</nav>
|
|
10
|
+
</header>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export default function Hero() {
|
|
2
|
+
return (
|
|
3
|
+
<section className="px-6 py-24">
|
|
4
|
+
<div className="mx-auto grid max-w-6xl items-center gap-12 lg:grid-cols-2">
|
|
5
|
+
<div>
|
|
6
|
+
<h1 className="text-5xl font-bold tracking-tight">Build something great.</h1>
|
|
7
|
+
|
|
8
|
+
<p className="mt-6 max-w-xl text-lg text-gray-600">
|
|
9
|
+
A simple description for your project goes here.
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<a href="#" className="mt-8 inline-block rounded-lg bg-black px-6 py-3 font-medium text-white">
|
|
13
|
+
Get Started
|
|
14
|
+
</a>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div className="aspect-video rounded-2xl bg-gray-100"></div>
|
|
18
|
+
</div>
|
|
19
|
+
</section>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default function Hero() {
|
|
2
|
+
return (
|
|
3
|
+
<section className="px-6 py-24">
|
|
4
|
+
<div className="mx-auto max-w-4xl text-center">
|
|
5
|
+
<h1 className="text-5xl font-bold tracking-tight">Build something great.</h1>
|
|
6
|
+
|
|
7
|
+
<p className="mx-auto mt-6 max-w-2xl text-lg text-gray-600">
|
|
8
|
+
A simple description for your project goes here.
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<a href="#" className="mt-8 inline-block rounded-lg bg-black px-6 py-3 font-medium text-white">
|
|
12
|
+
Get Started
|
|
13
|
+
</a>
|
|
14
|
+
</div>
|
|
15
|
+
</section>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default function Hero() {
|
|
2
|
+
return (
|
|
3
|
+
<section className="px-6 py-24">
|
|
4
|
+
<div className="mx-auto max-w-4xl text-center">
|
|
5
|
+
<h1 className="text-5xl font-bold tracking-tight">Build something great.</h1>
|
|
6
|
+
|
|
7
|
+
<p className="mx-auto mt-6 max-w-2xl text-lg text-gray-600">
|
|
8
|
+
A simple description for your project goes here.
|
|
9
|
+
</p>
|
|
10
|
+
</div>
|
|
11
|
+
</section>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const FRAMES = [
|
|
2
|
+
"⠋",
|
|
3
|
+
"⠙",
|
|
4
|
+
"⠹",
|
|
5
|
+
"⠸",
|
|
6
|
+
"⠼",
|
|
7
|
+
"⠴",
|
|
8
|
+
"⠦",
|
|
9
|
+
"⠧",
|
|
10
|
+
"⠇",
|
|
11
|
+
"⠏",
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
export function startSpinner(message) {
|
|
15
|
+
let frame = 0;
|
|
16
|
+
|
|
17
|
+
process.stdout.write(`${FRAMES[frame]} ${message}`);
|
|
18
|
+
|
|
19
|
+
const interval = setInterval(() => {
|
|
20
|
+
frame = (frame + 1) % FRAMES.length;
|
|
21
|
+
|
|
22
|
+
process.stdout.write("\r");
|
|
23
|
+
process.stdout.write(`${FRAMES[frame]} ${message}`);
|
|
24
|
+
}, 80);
|
|
25
|
+
|
|
26
|
+
return () => {
|
|
27
|
+
clearInterval(interval);
|
|
28
|
+
process.stdout.write("\r\x1b[K");
|
|
29
|
+
};
|
|
30
|
+
}
|