create-comate-pagebuilder 1.0.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/README.md +95 -0
- package/bin/index.js +41 -0
- package/package.json +33 -0
- package/template/README.md +102 -0
- package/template/index.html +13 -0
- package/template/package-lock.json +2683 -0
- package/template/package.json +30 -0
- package/template/postcss.config.js +6 -0
- package/template/src/App.jsx +11 -0
- package/template/src/components/Card.jsx +42 -0
- package/template/src/components/Hero.jsx +66 -0
- package/template/src/index.css +41 -0
- package/template/src/main.jsx +10 -0
- package/template/src/pages/Home.jsx +56 -0
- package/template/src/utils/cn.js +10 -0
- package/template/tailwind.config.js +74 -0
- package/template/vite.config.js +20 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "PageBuilder-react-template",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "vite",
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"preview": "vite preview"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"react": "^18.3.1",
|
|
12
|
+
"react-dom": "^18.3.1",
|
|
13
|
+
"framer-motion": "^11.0.8",
|
|
14
|
+
"lucide-react": "^0.344.0",
|
|
15
|
+
"clsx": "^2.1.0",
|
|
16
|
+
"tailwind-merge": "^2.2.1"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
20
|
+
"vite": "^5.1.4",
|
|
21
|
+
"tailwindcss": "^3.4.1",
|
|
22
|
+
"postcss": "^8.4.35",
|
|
23
|
+
"autoprefixer": "^10.4.17"
|
|
24
|
+
},
|
|
25
|
+
"optionalDependencies": {
|
|
26
|
+
"gsap": "^3.12.5",
|
|
27
|
+
"lottie-web": "^5.12.2",
|
|
28
|
+
"animate.css": "^4.1.1"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { motion } from 'framer-motion'
|
|
2
|
+
import { cn } from '@/utils/cn'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* PageBuilder 标准卡片组件
|
|
6
|
+
* 支持 hover 动效、自定义样式
|
|
7
|
+
*/
|
|
8
|
+
export default function Card({
|
|
9
|
+
title,
|
|
10
|
+
description,
|
|
11
|
+
icon: Icon,
|
|
12
|
+
className,
|
|
13
|
+
children
|
|
14
|
+
}) {
|
|
15
|
+
return (
|
|
16
|
+
<motion.div
|
|
17
|
+
className={cn("card group cursor-pointer", className)}
|
|
18
|
+
whileHover={{ y: -4 }}
|
|
19
|
+
transition={{ duration: 0.3 }}
|
|
20
|
+
>
|
|
21
|
+
{Icon && (
|
|
22
|
+
<div className="w-12 h-12 rounded-lg bg-primary-100 flex items-center justify-center mb-4 group-hover:bg-primary-200 transition-colors">
|
|
23
|
+
<Icon className="w-6 h-6 text-primary-600" />
|
|
24
|
+
</div>
|
|
25
|
+
)}
|
|
26
|
+
|
|
27
|
+
{title && (
|
|
28
|
+
<h3 className="text-xl font-semibold mb-2 text-neutral-900">
|
|
29
|
+
{title}
|
|
30
|
+
</h3>
|
|
31
|
+
)}
|
|
32
|
+
|
|
33
|
+
{description && (
|
|
34
|
+
<p className="text-neutral-600 leading-relaxed">
|
|
35
|
+
{description}
|
|
36
|
+
</p>
|
|
37
|
+
)}
|
|
38
|
+
|
|
39
|
+
{children}
|
|
40
|
+
</motion.div>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { motion } from 'framer-motion'
|
|
2
|
+
import { ArrowRight } from 'lucide-react'
|
|
3
|
+
import { cn } from '@/utils/cn'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* PageBuilder 标准 Hero 组件
|
|
7
|
+
* 支持动效、响应式、高保真视觉
|
|
8
|
+
*/
|
|
9
|
+
export default function Hero({
|
|
10
|
+
title = "欢迎来到 PageBuilder",
|
|
11
|
+
subtitle = "高保真前端原型智能体",
|
|
12
|
+
ctaText = "开始使用",
|
|
13
|
+
onCtaClick = () => {}
|
|
14
|
+
}) {
|
|
15
|
+
return (
|
|
16
|
+
<section className="relative min-h-screen flex items-center justify-center px-6 py-20 overflow-hidden">
|
|
17
|
+
{/* 背景装饰 */}
|
|
18
|
+
<div className="absolute inset-0 -z-10">
|
|
19
|
+
<div className="absolute top-20 left-10 w-72 h-72 bg-primary-500/20 rounded-full blur-3xl" />
|
|
20
|
+
<div className="absolute bottom-20 right-10 w-96 h-96 bg-accent-500/20 rounded-full blur-3xl" />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div className="max-w-4xl mx-auto text-center">
|
|
24
|
+
{/* 标题 */}
|
|
25
|
+
<motion.h1
|
|
26
|
+
className="text-6xl md:text-7xl lg:text-8xl font-bold mb-6 bg-gradient-to-br from-neutral-900 via-neutral-800 to-neutral-600 bg-clip-text text-transparent"
|
|
27
|
+
initial={{ opacity: 0, y: 20 }}
|
|
28
|
+
animate={{ opacity: 1, y: 0 }}
|
|
29
|
+
transition={{ duration: 0.8, ease: "easeOut" }}
|
|
30
|
+
>
|
|
31
|
+
{title}
|
|
32
|
+
</motion.h1>
|
|
33
|
+
|
|
34
|
+
{/* 副标题 */}
|
|
35
|
+
<motion.p
|
|
36
|
+
className="text-xl md:text-2xl text-neutral-600 mb-12 max-w-2xl mx-auto"
|
|
37
|
+
initial={{ opacity: 0, y: 20 }}
|
|
38
|
+
animate={{ opacity: 1, y: 0 }}
|
|
39
|
+
transition={{ duration: 0.8, delay: 0.2, ease: "easeOut" }}
|
|
40
|
+
>
|
|
41
|
+
{subtitle}
|
|
42
|
+
</motion.p>
|
|
43
|
+
|
|
44
|
+
{/* CTA 按钮 */}
|
|
45
|
+
<motion.button
|
|
46
|
+
onClick={onCtaClick}
|
|
47
|
+
className={cn(
|
|
48
|
+
"group inline-flex items-center gap-2 px-8 py-4",
|
|
49
|
+
"bg-primary-600 hover:bg-primary-700",
|
|
50
|
+
"text-white font-semibold rounded-full",
|
|
51
|
+
"shadow-lg hover:shadow-xl",
|
|
52
|
+
"transition-all duration-300"
|
|
53
|
+
)}
|
|
54
|
+
initial={{ opacity: 0, y: 20 }}
|
|
55
|
+
animate={{ opacity: 1, y: 0 }}
|
|
56
|
+
transition={{ duration: 0.8, delay: 0.4, ease: "easeOut" }}
|
|
57
|
+
whileHover={{ scale: 1.05 }}
|
|
58
|
+
whileTap={{ scale: 0.95 }}
|
|
59
|
+
>
|
|
60
|
+
{ctaText}
|
|
61
|
+
<ArrowRight className="w-5 h-5 group-hover:translate-x-1 transition-transform" />
|
|
62
|
+
</motion.button>
|
|
63
|
+
</div>
|
|
64
|
+
</section>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
/* PageBuilder 全局样式基础 */
|
|
6
|
+
@layer base {
|
|
7
|
+
* {
|
|
8
|
+
@apply border-neutral-200;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
body {
|
|
12
|
+
@apply bg-white text-neutral-900 antialiased;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
h1, h2, h3, h4, h5, h6 {
|
|
16
|
+
@apply font-semibold tracking-tight;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@layer components {
|
|
21
|
+
/* 标准按钮样式 */
|
|
22
|
+
.btn-primary {
|
|
23
|
+
@apply px-6 py-3 bg-primary-600 text-white rounded-lg font-medium
|
|
24
|
+
hover:bg-primary-700 active:scale-95 transition-all duration-200
|
|
25
|
+
shadow-sm hover:shadow-md;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.btn-secondary {
|
|
29
|
+
@apply px-6 py-3 bg-neutral-100 text-neutral-900 rounded-lg font-medium
|
|
30
|
+
hover:bg-neutral-200 active:scale-95 transition-all duration-200;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* 标准卡片样式 */
|
|
34
|
+
.card {
|
|
35
|
+
@apply bg-white rounded-xl border border-neutral-200 p-6
|
|
36
|
+
shadow-sm hover:shadow-md transition-shadow duration-300;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* 可选:引入 animate.css(如果使用) */
|
|
41
|
+
/* @import 'animate.css'; */
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import Hero from '@components/Hero'
|
|
2
|
+
import Card from '@components/Card'
|
|
3
|
+
import { Palette, Zap, Layout } from 'lucide-react'
|
|
4
|
+
|
|
5
|
+
export default function Home() {
|
|
6
|
+
const features = [
|
|
7
|
+
{
|
|
8
|
+
icon: Palette,
|
|
9
|
+
title: "智能配色",
|
|
10
|
+
description: "自动生成符合设计规范的配色方案,支持多种风格"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
icon: Zap,
|
|
14
|
+
title: "丰富动效",
|
|
15
|
+
description: "集成 GSAP、Framer Motion 等主流动效库"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
icon: Layout,
|
|
19
|
+
title: "响应式布局",
|
|
20
|
+
description: "基于 Tailwind CSS 的现代响应式设计系统"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<main>
|
|
26
|
+
{/* Hero 区域 */}
|
|
27
|
+
<Hero
|
|
28
|
+
title="PageBuilder"
|
|
29
|
+
subtitle="将模糊需求转换为高保真前端原型"
|
|
30
|
+
ctaText="开始创建"
|
|
31
|
+
onCtaClick={() => console.log('CTA clicked')}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
{/* Features 区域 */}
|
|
35
|
+
<section className="max-w-7xl mx-auto px-6 py-20">
|
|
36
|
+
<div className="text-center mb-16">
|
|
37
|
+
<h2 className="text-4xl font-bold mb-4">核心特性</h2>
|
|
38
|
+
<p className="text-xl text-neutral-600">
|
|
39
|
+
开箱即用的现代前端开发体验
|
|
40
|
+
</p>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div className="grid md:grid-cols-3 gap-8">
|
|
44
|
+
{features.map((feature, index) => (
|
|
45
|
+
<Card
|
|
46
|
+
key={index}
|
|
47
|
+
icon={feature.icon}
|
|
48
|
+
title={feature.title}
|
|
49
|
+
description={feature.description}
|
|
50
|
+
/>
|
|
51
|
+
))}
|
|
52
|
+
</div>
|
|
53
|
+
</section>
|
|
54
|
+
</main>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
export default {
|
|
3
|
+
content: [
|
|
4
|
+
"./index.html",
|
|
5
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
6
|
+
],
|
|
7
|
+
theme: {
|
|
8
|
+
extend: {
|
|
9
|
+
colors: {
|
|
10
|
+
// PageBuilder 标准配色系统
|
|
11
|
+
primary: {
|
|
12
|
+
50: '#f0f9ff',
|
|
13
|
+
100: '#e0f2fe',
|
|
14
|
+
200: '#bae6fd',
|
|
15
|
+
300: '#7dd3fc',
|
|
16
|
+
400: '#38bdf8',
|
|
17
|
+
500: '#0ea5e9',
|
|
18
|
+
600: '#0284c7',
|
|
19
|
+
700: '#0369a1',
|
|
20
|
+
800: '#075985',
|
|
21
|
+
900: '#0c4a6e',
|
|
22
|
+
},
|
|
23
|
+
accent: {
|
|
24
|
+
50: '#fdf4ff',
|
|
25
|
+
100: '#fae8ff',
|
|
26
|
+
200: '#f5d0fe',
|
|
27
|
+
300: '#f0abfc',
|
|
28
|
+
400: '#e879f9',
|
|
29
|
+
500: '#d946ef',
|
|
30
|
+
600: '#c026d3',
|
|
31
|
+
700: '#a21caf',
|
|
32
|
+
800: '#86198f',
|
|
33
|
+
900: '#701a75',
|
|
34
|
+
},
|
|
35
|
+
neutral: {
|
|
36
|
+
50: '#fafafa',
|
|
37
|
+
100: '#f5f5f5',
|
|
38
|
+
200: '#e5e5e5',
|
|
39
|
+
300: '#d4d4d4',
|
|
40
|
+
400: '#a3a3a3',
|
|
41
|
+
500: '#737373',
|
|
42
|
+
600: '#525252',
|
|
43
|
+
700: '#404040',
|
|
44
|
+
800: '#262626',
|
|
45
|
+
900: '#171717',
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
fontFamily: {
|
|
49
|
+
sans: ['Inter', 'system-ui', 'sans-serif'],
|
|
50
|
+
display: ['Cal Sans', 'Inter', 'system-ui', 'sans-serif'],
|
|
51
|
+
},
|
|
52
|
+
animation: {
|
|
53
|
+
'fade-in': 'fadeIn 0.6s ease-out',
|
|
54
|
+
'slide-up': 'slideUp 0.6s ease-out',
|
|
55
|
+
'scale-in': 'scaleIn 0.4s ease-out',
|
|
56
|
+
},
|
|
57
|
+
keyframes: {
|
|
58
|
+
fadeIn: {
|
|
59
|
+
'0%': { opacity: '0' },
|
|
60
|
+
'100%': { opacity: '1' },
|
|
61
|
+
},
|
|
62
|
+
slideUp: {
|
|
63
|
+
'0%': { transform: 'translateY(20px)', opacity: '0' },
|
|
64
|
+
'100%': { transform: 'translateY(0)', opacity: '1' },
|
|
65
|
+
},
|
|
66
|
+
scaleIn: {
|
|
67
|
+
'0%': { transform: 'scale(0.95)', opacity: '0' },
|
|
68
|
+
'100%': { transform: 'scale(1)', opacity: '1' },
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
plugins: [],
|
|
74
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
import path from 'path'
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [react()],
|
|
7
|
+
resolve: {
|
|
8
|
+
alias: {
|
|
9
|
+
'@': path.resolve(__dirname, './src'),
|
|
10
|
+
'@components': path.resolve(__dirname, './src/components'),
|
|
11
|
+
'@pages': path.resolve(__dirname, './src/pages'),
|
|
12
|
+
'@styles': path.resolve(__dirname, './src/styles'),
|
|
13
|
+
'@utils': path.resolve(__dirname, './src/utils')
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
server: {
|
|
17
|
+
port: 3000,
|
|
18
|
+
open: true
|
|
19
|
+
}
|
|
20
|
+
})
|