create-landing-app 0.2.0 → 0.2.2
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/dist/install.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { execa } from "execa";
|
|
2
2
|
import { spinner } from "@clack/prompts";
|
|
3
3
|
export async function install(pm, cwd) {
|
|
4
|
+
// git init is required before install so husky's prepare script can set up hooks
|
|
5
|
+
await execa("git", ["init"], { cwd });
|
|
4
6
|
const s = spinner();
|
|
5
7
|
s.start(`Installing dependencies with ${pm}...`);
|
|
6
8
|
try {
|
package/dist/utils/copy-dir.js
CHANGED
|
@@ -14,8 +14,11 @@ export async function copyDir(src, dest, overwrite = false) {
|
|
|
14
14
|
await copyDir(srcPath, destPath, overwrite);
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
// npm strips .gitignore from published packages; store as _gitignore and restore on copy
|
|
18
|
+
const destName = entry.name === "_gitignore" ? ".gitignore" : entry.name;
|
|
19
|
+
const destFile = path.join(dest, destName);
|
|
20
|
+
if (overwrite || !fs.existsSync(destFile)) {
|
|
21
|
+
fs.copyFileSync(srcPath, destFile);
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-landing-app",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Create a production-ready Next.js landing page with one command",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -44,5 +44,7 @@
|
|
|
44
44
|
"ts-jest": "^29.1.0",
|
|
45
45
|
"typescript": "^5.0.0"
|
|
46
46
|
},
|
|
47
|
-
"engines": {
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=20.9.0"
|
|
49
|
+
}
|
|
48
50
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
/.pnp
|
|
4
|
+
.pnp.js
|
|
5
|
+
|
|
6
|
+
# testing
|
|
7
|
+
/coverage
|
|
8
|
+
|
|
9
|
+
# next.js
|
|
10
|
+
/.next/
|
|
11
|
+
/out/
|
|
12
|
+
|
|
13
|
+
# production
|
|
14
|
+
/build
|
|
15
|
+
|
|
16
|
+
# misc
|
|
17
|
+
.DS_Store
|
|
18
|
+
*.pem
|
|
19
|
+
|
|
20
|
+
# debug
|
|
21
|
+
npm-debug.log*
|
|
22
|
+
yarn-debug.log*
|
|
23
|
+
yarn-error.log*
|
|
24
|
+
|
|
25
|
+
# env files
|
|
26
|
+
.env
|
|
27
|
+
.env*.local
|
|
28
|
+
.env.local
|
|
29
|
+
.env.development.local
|
|
30
|
+
.env.test.local
|
|
31
|
+
.env.production.local
|
|
32
|
+
|
|
33
|
+
# vercel
|
|
34
|
+
.vercel
|
|
35
|
+
|
|
36
|
+
# typescript
|
|
37
|
+
*.tsbuildinfo
|
|
38
|
+
next-env.d.ts
|
|
39
|
+
|
|
40
|
+
# turbo
|
|
41
|
+
.turbo
|
|
42
|
+
|
|
43
|
+
# husky
|
|
44
|
+
.husky/_
|
|
@@ -1,13 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState, useEffect, useRef } from "react";
|
|
1
3
|
import Link from "next/link";
|
|
2
4
|
import { NAV_LINKS, SITE_NAME } from "@/constants/common";
|
|
3
5
|
import NavbarMobile from "./navbar-mobile";
|
|
4
6
|
import { Button } from "@/components/ui/button";
|
|
7
|
+
import { cn } from "@/lib/utils";
|
|
5
8
|
// __NAVBAR_IMPORT__
|
|
6
9
|
|
|
7
|
-
// Server component — no animation needed at nav level
|
|
8
10
|
export default function Navbar() {
|
|
11
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
12
|
+
const lastScrollY = useRef(0);
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const controlNavbar = () => {
|
|
16
|
+
const currentScrollY = window.scrollY;
|
|
17
|
+
|
|
18
|
+
if (currentScrollY < lastScrollY.current || currentScrollY < 10) {
|
|
19
|
+
setIsVisible(true); // scrolling up OR near top → show
|
|
20
|
+
} else {
|
|
21
|
+
setIsVisible(false); // scrolling down → hide
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
lastScrollY.current = currentScrollY;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
window.addEventListener("scroll", controlNavbar);
|
|
28
|
+
return () => window.removeEventListener("scroll", controlNavbar);
|
|
29
|
+
}, []);
|
|
30
|
+
|
|
9
31
|
return (
|
|
10
|
-
<header
|
|
32
|
+
<header
|
|
33
|
+
className={cn(
|
|
34
|
+
"fixed top-0 z-50 w-full border-b border-border/40 bg-background/80 backdrop-blur-sm header-shadow transition-transform duration-300",
|
|
35
|
+
isVisible ? "translate-y-0" : "-translate-y-[calc(100%+20px)]"
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
11
38
|
<div className="content-container flex h-16 items-center justify-between">
|
|
12
39
|
{/* Logo */}
|
|
13
40
|
<Link href="/" className="flex items-center gap-2 text-xl font-bold text-primary">
|
|
@@ -1,15 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useState, useEffect, useRef } from "react";
|
|
2
3
|
import Link from "next/link";
|
|
3
4
|
import { NAV_LINKS, SITE_NAME } from "@/constants/common";
|
|
4
5
|
import NavbarMobile from "./navbar-mobile";
|
|
5
6
|
import { Button } from "@/components/ui/button";
|
|
6
7
|
import LanguageSwitcher from "./language-switcher";
|
|
7
8
|
import { useDictionary } from "@/lib/dict-context";
|
|
9
|
+
import { cn } from "@/lib/utils";
|
|
8
10
|
|
|
9
11
|
export default function Navbar() {
|
|
10
12
|
const dict = useDictionary();
|
|
13
|
+
const [isVisible, setIsVisible] = useState(true);
|
|
14
|
+
const lastScrollY = useRef(0);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const controlNavbar = () => {
|
|
18
|
+
const currentScrollY = window.scrollY;
|
|
19
|
+
|
|
20
|
+
if (currentScrollY < lastScrollY.current || currentScrollY < 10) {
|
|
21
|
+
setIsVisible(true);
|
|
22
|
+
} else {
|
|
23
|
+
setIsVisible(false);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
lastScrollY.current = currentScrollY;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
window.addEventListener("scroll", controlNavbar);
|
|
30
|
+
return () => window.removeEventListener("scroll", controlNavbar);
|
|
31
|
+
}, []);
|
|
32
|
+
|
|
11
33
|
return (
|
|
12
|
-
<header
|
|
34
|
+
<header
|
|
35
|
+
className={cn(
|
|
36
|
+
"fixed top-0 z-50 w-full border-b border-border/40 bg-background/80 backdrop-blur-sm header-shadow transition-transform duration-300",
|
|
37
|
+
isVisible ? "translate-y-0" : "-translate-y-[calc(100%+20px)]"
|
|
38
|
+
)}
|
|
39
|
+
>
|
|
13
40
|
<div className="content-container flex h-16 items-center justify-between">
|
|
14
41
|
{/* Logo */}
|
|
15
42
|
<Link href="/" className="flex items-center gap-2 text-xl font-bold text-primary">
|