cf-yoyo 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.
Files changed (141) hide show
  1. package/.eslintrc.json +28 -0
  2. package/.github/workflows/ci.yml +96 -0
  3. package/.prettierrc.json +10 -0
  4. package/CHANGELOG.md +55 -0
  5. package/README.md +138 -0
  6. package/__tests__/cli-e2e.test.ts +145 -0
  7. package/__tests__/config.test.ts +268 -0
  8. package/__tests__/filesystem.test.ts +453 -0
  9. package/__tests__/logger.test.ts +274 -0
  10. package/__tests__/template-engine.test.ts +450 -0
  11. package/__tests__/types.test.ts +25 -0
  12. package/deep_todos.md +766 -0
  13. package/dist/cli/commands/create.d.ts +26 -0
  14. package/dist/cli/commands/create.d.ts.map +1 -0
  15. package/dist/cli/commands/create.js +308 -0
  16. package/dist/cli/commands/create.js.map +1 -0
  17. package/dist/cli/commands/git.d.ts +10 -0
  18. package/dist/cli/commands/git.d.ts.map +1 -0
  19. package/dist/cli/commands/git.js +887 -0
  20. package/dist/cli/commands/git.js.map +1 -0
  21. package/dist/cli/commands/list.d.ts +10 -0
  22. package/dist/cli/commands/list.d.ts.map +1 -0
  23. package/dist/cli/commands/list.js +90 -0
  24. package/dist/cli/commands/list.js.map +1 -0
  25. package/dist/cli/index.d.ts +15 -0
  26. package/dist/cli/index.d.ts.map +1 -0
  27. package/dist/cli/index.js +62 -0
  28. package/dist/cli/index.js.map +1 -0
  29. package/dist/core/config.d.ts +35 -0
  30. package/dist/core/config.d.ts.map +1 -0
  31. package/dist/core/config.js +260 -0
  32. package/dist/core/config.js.map +1 -0
  33. package/dist/core/filesystem.d.ts +84 -0
  34. package/dist/core/filesystem.d.ts.map +1 -0
  35. package/dist/core/filesystem.js +417 -0
  36. package/dist/core/filesystem.js.map +1 -0
  37. package/dist/core/git-token.d.ts +81 -0
  38. package/dist/core/git-token.d.ts.map +1 -0
  39. package/dist/core/git-token.js +244 -0
  40. package/dist/core/git-token.js.map +1 -0
  41. package/dist/core/git.d.ts +70 -0
  42. package/dist/core/git.d.ts.map +1 -0
  43. package/dist/core/git.js +367 -0
  44. package/dist/core/git.js.map +1 -0
  45. package/dist/core/prompt.d.ts +28 -0
  46. package/dist/core/prompt.d.ts.map +1 -0
  47. package/dist/core/prompt.js +253 -0
  48. package/dist/core/prompt.js.map +1 -0
  49. package/dist/core/template-engine.d.ts +52 -0
  50. package/dist/core/template-engine.d.ts.map +1 -0
  51. package/dist/core/template-engine.js +308 -0
  52. package/dist/core/template-engine.js.map +1 -0
  53. package/dist/core/template-manager.d.ts +54 -0
  54. package/dist/core/template-manager.d.ts.map +1 -0
  55. package/dist/core/template-manager.js +330 -0
  56. package/dist/core/template-manager.js.map +1 -0
  57. package/dist/index.d.ts +12 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/dist/index.js +19 -0
  60. package/dist/index.js.map +1 -0
  61. package/dist/types/index.d.ts +244 -0
  62. package/dist/types/index.d.ts.map +1 -0
  63. package/dist/types/index.js +51 -0
  64. package/dist/types/index.js.map +1 -0
  65. package/dist/utils/logger.d.ts +68 -0
  66. package/dist/utils/logger.d.ts.map +1 -0
  67. package/dist/utils/logger.js +140 -0
  68. package/dist/utils/logger.js.map +1 -0
  69. package/memory.md +241 -0
  70. package/need-debug.md +395 -0
  71. package/package.json +42 -0
  72. package/src/cli/commands/create.ts +326 -0
  73. package/src/cli/commands/git.ts +1001 -0
  74. package/src/cli/commands/list.ts +97 -0
  75. package/src/cli/index.ts +71 -0
  76. package/src/core/config.ts +262 -0
  77. package/src/core/filesystem.ts +408 -0
  78. package/src/core/git-token.ts +248 -0
  79. package/src/core/git.ts +384 -0
  80. package/src/core/prompt.ts +345 -0
  81. package/src/core/template-engine.ts +324 -0
  82. package/src/core/template-manager.ts +338 -0
  83. package/src/index.ts +19 -0
  84. package/src/types/index.ts +259 -0
  85. package/src/utils/logger.ts +150 -0
  86. package/templates/pages/basic/README.md.mustache +63 -0
  87. package/templates/pages/basic/package.json.mustache +23 -0
  88. package/templates/pages/basic/public/css/style.css +199 -0
  89. package/templates/pages/basic/public/index.html.mustache +72 -0
  90. package/templates/pages/basic/public/js/main.js +103 -0
  91. package/templates/pages/basic/template.json +38 -0
  92. package/templates/pages/basic/tsconfig.json +21 -0
  93. package/templates/pages/basic/wrangler.toml.mustache +14 -0
  94. package/templates/pages/basic-js/README.md.mustache +62 -0
  95. package/templates/pages/basic-js/package.json.mustache +25 -0
  96. package/templates/pages/basic-js/public/css/style.css +212 -0
  97. package/templates/pages/basic-js/public/index.html.mustache +53 -0
  98. package/templates/pages/basic-js/public/js/main.js +134 -0
  99. package/templates/pages/basic-js/template.json +35 -0
  100. package/templates/pages/basic-js/wrangler.toml.mustache +14 -0
  101. package/templates/pages/react/README.md.mustache +97 -0
  102. package/templates/pages/react/index.html.mustache +14 -0
  103. package/templates/pages/react/package.json.mustache +34 -0
  104. package/templates/pages/react/src/App.css +168 -0
  105. package/templates/pages/react/src/App.tsx.mustache +62 -0
  106. package/templates/pages/react/src/index.css +53 -0
  107. package/templates/pages/react/src/main.tsx.mustache +10 -0
  108. package/templates/pages/react/src/vite-env.d.ts +1 -0
  109. package/templates/pages/react/template.json +54 -0
  110. package/templates/pages/react/tsconfig.json +21 -0
  111. package/templates/pages/react/tsconfig.node.json +10 -0
  112. package/templates/pages/react/vite.config.ts +16 -0
  113. package/templates/worker/basic/README.md.mustache +56 -0
  114. package/templates/worker/basic/package.json.mustache +29 -0
  115. package/templates/worker/basic/src/index.ts.mustache +125 -0
  116. package/templates/worker/basic/template.json +30 -0
  117. package/templates/worker/basic/tsconfig.json +24 -0
  118. package/templates/worker/basic/wrangler.toml.mustache +33 -0
  119. package/templates/worker/basic-js/README.md.mustache +55 -0
  120. package/templates/worker/basic-js/package.json.mustache +25 -0
  121. package/templates/worker/basic-js/src/index.js.mustache +146 -0
  122. package/templates/worker/basic-js/template.json +27 -0
  123. package/templates/worker/basic-js/wrangler.toml.mustache +33 -0
  124. package/templates/worker/hono/README.md.mustache +79 -0
  125. package/templates/worker/hono/package.json.mustache +33 -0
  126. package/templates/worker/hono/src/index.ts.mustache +64 -0
  127. package/templates/worker/hono/src/routes/index.ts.mustache +165 -0
  128. package/templates/worker/hono/template.json +34 -0
  129. package/templates/worker/hono/tsconfig.json +24 -0
  130. package/templates/worker/hono/wrangler.toml.mustache +36 -0
  131. package/templates/worker/hono-js/README.md.mustache +67 -0
  132. package/templates/worker/hono-js/package.json.mustache +29 -0
  133. package/templates/worker/hono-js/src/index.js.mustache +55 -0
  134. package/templates/worker/hono-js/src/routes/index.js.mustache +127 -0
  135. package/templates/worker/hono-js/template.json +31 -0
  136. package/templates/worker/hono-js/wrangler.toml.mustache +36 -0
  137. package/thoughts/ledgers/CONTINUITY_ses_287e.md +74 -0
  138. package/thoughts/ledgers/CONTINUITY_ses_28b5.md +85 -0
  139. package/tsconfig.json +30 -0
  140. package/vitest.config.ts +20 -0
  141. package//351/240/205/347/233/256/350/241/250.md +140 -0
@@ -0,0 +1,72 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-TW">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>{{projectName}}</title>
7
+ <link rel="stylesheet" href="css/style.css">
8
+ <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🚀</text></svg>">
9
+ </head>
10
+ <body>
11
+ <header class="hero">
12
+ <div class="container">
13
+ <h1>🚀 {{projectName}}</h1>
14
+ <p class="description">{{description}}</p>
15
+ <div class="badges">
16
+ <span class="badge">Cloudflare Pages</span>
17
+ <span class="badge">靜態網站</span>
18
+ </div>
19
+ </div>
20
+ </header>
21
+
22
+ <main class="container">
23
+ <section class="features">
24
+ <h2>✨ 功能特色</h2>
25
+ <div class="feature-grid">
26
+ <div class="feature-card">
27
+ <div class="feature-icon">⚡</div>
28
+ <h3>極速載入</h3>
29
+ <p>部署於 Cloudflare 全球邊緣網路,提供極快的載入速度</p>
30
+ </div>
31
+ <div class="feature-card">
32
+ <div class="feature-icon">🌍</div>
33
+ <h3>全球 CDN</h3>
34
+ <p>內容自動分發至全球 300+ 個數據中心</p>
35
+ </div>
36
+ <div class="feature-card">
37
+ <div class="feature-icon">🔒</div>
38
+ <h3>自動 HTTPS</h3>
39
+ <p>免費 SSL 證書,自動續期</p>
40
+ </div>
41
+ <div class="feature-card">
42
+ <div class="feature-icon">🚀</div>
43
+ <h3>無限擴展</h3>
44
+ <p>無需擔心流量峰值,自動擴展</p>
45
+ </div>
46
+ </div>
47
+ </section>
48
+
49
+ <section class="cta">
50
+ <h2>🎉 開始使用</h2>
51
+ <p>這是一個由 create-cf-project 生成的專案</p>
52
+ <div class="code-block">
53
+ <code>
54
+ <span class="comment"># 安裝依賴</span><br>
55
+ npm install<br><br>
56
+ <span class="comment"># 開發模式</span><br>
57
+ npm run dev
58
+ </code>
59
+ </div>
60
+ </section>
61
+ </main>
62
+
63
+ <footer>
64
+ <div class="container">
65
+ <p>建立於 {{date}} | {{year}}</p>
66
+ <p>{{#license}}{{license}}{{/license}}{{^license}}MIT License{{/license}}</p>
67
+ </div>
68
+ </footer>
69
+
70
+ <script src="js/main.js"></script>
71
+ </body>
72
+ </html>
@@ -0,0 +1,103 @@
1
+ /**
2
+ * 主 JavaScript 檔案
3
+ * {{projectName}}
4
+ */
5
+
6
+ // DOM 載入完成後執行
7
+ document.addEventListener('DOMContentLoaded', function () {
8
+ console.log('🚀 {{projectName}} 已載入');
9
+
10
+ // 初始化
11
+ initAnimations();
12
+ initSmoothScroll();
13
+ });
14
+
15
+ /**
16
+ * 初始化動畫效果
17
+ */
18
+ function initAnimations() {
19
+ // 觀察元素進入視口
20
+ const observerOptions = {
21
+ threshold: 0.1,
22
+ rootMargin: '0px 0px -50px 0px',
23
+ };
24
+
25
+ const observer = new IntersectionObserver((entries) => {
26
+ entries.forEach((entry) => {
27
+ if (entry.isIntersecting) {
28
+ entry.target.classList.add('visible');
29
+ }
30
+ });
31
+ }, observerOptions);
32
+
33
+ // 觀察所有功能卡片
34
+ const cards = document.querySelectorAll('.feature-card');
35
+ cards.forEach((card, index) => {
36
+ card.style.opacity = '0';
37
+ card.style.transform = 'translateY(20px)';
38
+ card.style.transition = `opacity 0.5s ease ${index * 0.1}s, transform 0.5s ease ${index * 0.1}s`;
39
+ observer.observe(card);
40
+ });
41
+
42
+ // 添加可見類別時的樣式
43
+ const style = document.createElement('style');
44
+ style.textContent = `
45
+ .feature-card.visible {
46
+ opacity: 1 !important;
47
+ transform: translateY(0) !important;
48
+ }
49
+ `;
50
+ document.head.appendChild(style);
51
+ }
52
+
53
+ /**
54
+ * 平滑滾動
55
+ */
56
+ function initSmoothScroll() {
57
+ document.querySelectorAll('a[href^="#"]').forEach((anchor) => {
58
+ anchor.addEventListener('click', function (e) {
59
+ e.preventDefault();
60
+ const target = document.querySelector(this.getAttribute('href'));
61
+ if (target) {
62
+ target.scrollIntoView({
63
+ behavior: 'smooth',
64
+ block: 'start',
65
+ });
66
+ }
67
+ });
68
+ });
69
+ }
70
+
71
+ /**
72
+ * 添加複製代碼功能
73
+ */
74
+ function initCodeCopy() {
75
+ const codeBlocks = document.querySelectorAll('.code-block');
76
+
77
+ codeBlocks.forEach((block) => {
78
+ const button = document.createElement('button');
79
+ button.className = 'copy-btn';
80
+ button.innerHTML = '📋';
81
+ button.title = '複製代碼';
82
+
83
+ button.addEventListener('click', async () => {
84
+ const code = block.querySelector('code')?.textContent || '';
85
+ try {
86
+ await navigator.clipboard.writeText(code);
87
+ button.innerHTML = '✅';
88
+ setTimeout(() => {
89
+ button.innerHTML = '📋';
90
+ }, 2000);
91
+ } catch (err) {
92
+ console.error('複製失敗:', err);
93
+ }
94
+ });
95
+
96
+ block.style.position = 'relative';
97
+ block.appendChild(button);
98
+ });
99
+ }
100
+
101
+ // 如果需要在控制台輸出歡迎信息
102
+ console.log('%c{{projectName}}', 'font-size: 24px; font-weight: bold; color: #667eea;');
103
+ console.log('%c由 Cloudflare Pages 驅動 ⚡', 'font-size: 12px; color: #666;');
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "基礎 Cloudflare Pages",
3
+ "description": "純靜態 HTML/CSS/JS 的 Cloudflare Pages 專案",
4
+ "projectType": "pages",
5
+ "templateType": "static",
6
+ "files": [
7
+ {
8
+ "sourcePath": "package.json.mustache",
9
+ "targetPath": "package.json"
10
+ },
11
+ {
12
+ "sourcePath": "wrangler.toml.mustache",
13
+ "targetPath": "wrangler.toml"
14
+ },
15
+ {
16
+ "sourcePath": "public/index.html.mustache",
17
+ "targetPath": "public/index.html"
18
+ },
19
+ {
20
+ "sourcePath": "public/css/style.css",
21
+ "targetPath": "public/css/style.css"
22
+ },
23
+ {
24
+ "sourcePath": "public/js/main.js",
25
+ "targetPath": "public/js/main.js"
26
+ },
27
+ {
28
+ "sourcePath": "tsconfig.json",
29
+ "targetPath": "tsconfig.json"
30
+ },
31
+ {
32
+ "sourcePath": "README.md.mustache",
33
+ "targetPath": "README.md"
34
+ }
35
+ ],
36
+ "requiredVars": ["projectName", "projectType", "template"],
37
+ "optionalVars": ["author", "email", "description", "license"]
38
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "lib": ["ES2022", "DOM"],
7
+ "strict": true,
8
+ "noUnusedLocals": true,
9
+ "noUnusedParameters": true,
10
+ "noImplicitReturns": true,
11
+ "noFallthroughCasesInSwitch": true,
12
+ "esModuleInterop": true,
13
+ "skipLibCheck": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "outDir": "./dist",
16
+ "rootDir": ".",
17
+ "types": ["node"]
18
+ },
19
+ "include": ["**/*.ts"],
20
+ "exclude": ["node_modules", "dist", "public"]
21
+ }
@@ -0,0 +1,14 @@
1
+ #:schema node_modules/wrangler/config-schema.json
2
+ name = "{{projectName}}"
3
+
4
+ # Cloudflare Pages 配置
5
+ [build]
6
+ command = ""
7
+
8
+ [site]
9
+ bucket = "./public"
10
+
11
+ # 環境變數
12
+ [env.production]
13
+
14
+ [env.development]
@@ -0,0 +1,62 @@
1
+ # {{projectName}}
2
+
3
+ {{description}}
4
+
5
+ 這是一個基於 Cloudflare Pages 的靜態網站專案,使用 create-cf-project 腳手架工具建立。
6
+
7
+ ## 快速開始
8
+
9
+ ### 安裝依賴
10
+
11
+ ```bash
12
+ npm install
13
+ ```
14
+
15
+ ### 開發模式
16
+
17
+ ```bash
18
+ npm run dev
19
+ ```
20
+
21
+ 這會啟動 wrangler pages dev 伺服器,你可以在本地測試網站。
22
+
23
+ ### 部署
24
+
25
+ ```bash
26
+ npm run deploy
27
+ ```
28
+
29
+ ## 專案結構
30
+
31
+ ```
32
+ {{projectName}}/
33
+ ├── public/ # 靜態資源目錄
34
+ │ ├── css/
35
+ │ │ └── style.css # 樣式表
36
+ │ ├── js/
37
+ │ │ └── main.js # JavaScript 檔案
38
+ │ └── index.html # HTML 入口
39
+ ├── package.json # 專案配置
40
+ ├── wrangler.toml # Cloudflare 配置
41
+ └── README.md # 本文件
42
+ ```
43
+
44
+ ## 技術細節
45
+
46
+ - **平台**: Cloudflare Pages
47
+ - **語言**: JavaScript (ES Module)
48
+ - **樣式**: CSS3
49
+ - **部署**: Edge Network
50
+
51
+ ## 特性
52
+
53
+ - ⚡ 全球 CDN 加速
54
+ - 🔒 自動 HTTPS
55
+ - 🚀 無限頻寬
56
+ - 🌍 Edge 網絡部署
57
+
58
+ ## 授權
59
+
60
+ {{#license}}{{license}}{{/license}}{{^license}}MIT{{/license}}
61
+
62
+ 建立於 {{date}} | {{year}}
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "1.0.0",
4
+ "description": "{{description}}",
5
+ "private": true,
6
+ "type": "module",
7
+ "scripts": {
8
+ "dev": "wrangler pages dev public",
9
+ "deploy": "wrangler pages deploy public",
10
+ "build": "echo '靜態網站無需建置'",
11
+ "preview": "wrangler pages dev public --port 8788"
12
+ },
13
+ "keywords": [
14
+ "cloudflare",
15
+ "pages",
16
+ "static",
17
+ "edge",
18
+ "javascript"
19
+ ],
20
+ "author": "{{#author}}{{author}}{{/author}}{{^author}}Anonymous{{/author}}",
21
+ "license": "{{#license}}{{license}}{{/license}}{{^license}}MIT{{/license}}",
22
+ "devDependencies": {
23
+ "wrangler": "^3.39.0"
24
+ }
25
+ }
@@ -0,0 +1,212 @@
1
+ /**
2
+ * 基礎樣式表
3
+ * Cloudflare Pages 靜態網站
4
+ */
5
+
6
+ /* CSS 變數定義 */
7
+ :root {
8
+ --primary-color: #667eea;
9
+ --secondary-color: #764ba2;
10
+ --text-color: #333;
11
+ --bg-color: #f5f5f5;
12
+ --white: #fff;
13
+ --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
14
+ --border-radius: 8px;
15
+ }
16
+
17
+ /* 重置 */
18
+ * {
19
+ margin: 0;
20
+ padding: 0;
21
+ box-sizing: border-box;
22
+ }
23
+
24
+ body {
25
+ font-family:
26
+ -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
27
+ line-height: 1.6;
28
+ color: var(--text-color);
29
+ background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
30
+ min-height: 100vh;
31
+ padding: 2rem 1rem;
32
+ }
33
+
34
+ .container {
35
+ max-width: 800px;
36
+ margin: 0 auto;
37
+ background: var(--white);
38
+ border-radius: var(--border-radius);
39
+ box-shadow: var(--shadow);
40
+ overflow: hidden;
41
+ }
42
+
43
+ /* 頁首 */
44
+ header {
45
+ background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
46
+ color: var(--white);
47
+ padding: 3rem 2rem;
48
+ text-align: center;
49
+ }
50
+
51
+ header h1 {
52
+ font-size: 2.5rem;
53
+ margin-bottom: 0.5rem;
54
+ }
55
+
56
+ header .description {
57
+ font-size: 1.1rem;
58
+ opacity: 0.9;
59
+ }
60
+
61
+ /* 主要內容 */
62
+ main {
63
+ padding: 2rem;
64
+ }
65
+
66
+ section {
67
+ margin-bottom: 2rem;
68
+ }
69
+
70
+ section:last-child {
71
+ margin-bottom: 0;
72
+ }
73
+
74
+ h2 {
75
+ color: var(--primary-color);
76
+ margin-bottom: 1rem;
77
+ font-size: 1.5rem;
78
+ }
79
+
80
+ p {
81
+ margin-bottom: 0.5rem;
82
+ }
83
+
84
+ /* 標籤 */
85
+ .badges {
86
+ margin-top: 1rem;
87
+ }
88
+
89
+ .badge {
90
+ display: inline-block;
91
+ background: var(--primary-color);
92
+ color: var(--white);
93
+ padding: 0.25rem 0.75rem;
94
+ border-radius: 20px;
95
+ font-size: 0.875rem;
96
+ margin-right: 0.5rem;
97
+ margin-bottom: 0.5rem;
98
+ }
99
+
100
+ .badge-js {
101
+ background: #f7df1e;
102
+ color: #333;
103
+ }
104
+
105
+ .badge-static {
106
+ background: #4caf50;
107
+ }
108
+
109
+ /* 特性列表 */
110
+ .features ul {
111
+ list-style: none;
112
+ padding: 0;
113
+ }
114
+
115
+ .features li {
116
+ padding: 0.5rem 0;
117
+ border-bottom: 1px solid #eee;
118
+ }
119
+
120
+ .features li:last-child {
121
+ border-bottom: none;
122
+ }
123
+
124
+ /* 按鈕 */
125
+ .btn {
126
+ background: var(--primary-color);
127
+ color: var(--white);
128
+ border: none;
129
+ padding: 0.75rem 1.5rem;
130
+ border-radius: var(--border-radius);
131
+ font-size: 1rem;
132
+ cursor: pointer;
133
+ transition: all 0.3s ease;
134
+ }
135
+
136
+ .btn:hover {
137
+ background: var(--secondary-color);
138
+ transform: translateY(-2px);
139
+ box-shadow: var(--shadow);
140
+ }
141
+
142
+ .btn:active {
143
+ transform: translateY(0);
144
+ }
145
+
146
+ /* 示範區塊 */
147
+ .demo {
148
+ background: #f8f9fa;
149
+ padding: 1.5rem;
150
+ border-radius: var(--border-radius);
151
+ }
152
+
153
+ #message {
154
+ margin-top: 1rem;
155
+ min-height: 1.5rem;
156
+ color: var(--primary-color);
157
+ font-weight: 500;
158
+ }
159
+
160
+ .timestamp {
161
+ margin-top: 1rem;
162
+ color: #666;
163
+ font-size: 0.9rem;
164
+ }
165
+
166
+ /* 頁尾 */
167
+ footer {
168
+ background: #f8f9fa;
169
+ padding: 1.5rem;
170
+ text-align: center;
171
+ color: #666;
172
+ border-top: 1px solid #eee;
173
+ }
174
+
175
+ footer p {
176
+ margin-bottom: 0.25rem;
177
+ }
178
+
179
+ .license {
180
+ font-size: 0.875rem;
181
+ }
182
+
183
+ /* 響態效果 */
184
+ @keyframes fadeIn {
185
+ from {
186
+ opacity: 0;
187
+ transform: translateY(20px);
188
+ }
189
+ to {
190
+ opacity: 1;
191
+ transform: translateY(0);
192
+ }
193
+ }
194
+
195
+ .container {
196
+ animation: fadeIn 0.5s ease;
197
+ }
198
+
199
+ /* 響應式設計 */
200
+ @media (max-width: 600px) {
201
+ header h1 {
202
+ font-size: 2rem;
203
+ }
204
+
205
+ main {
206
+ padding: 1rem;
207
+ }
208
+
209
+ .btn {
210
+ width: 100%;
211
+ }
212
+ }
@@ -0,0 +1,53 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh-TW">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>{{projectName}}</title>
7
+ <link rel="stylesheet" href="css/style.css">
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+ <header>
12
+ <h1>🌐 {{projectName}}</h1>
13
+ <p class="description">{{description}}</p>
14
+ </header>
15
+
16
+ <main>
17
+ <section class="intro">
18
+ <h2>歡迎使用 Cloudflare Pages</h2>
19
+ <p>這是一個純靜態的網站模板,部署在 Cloudflare Pages 上。</p>
20
+ <div class="badges">
21
+ <span class="badge">Cloudflare Pages</span>
22
+ <span class="badge badge-js">JavaScript</span>
23
+ <span class="badge badge-static">靜態網站</span>
24
+ </div>
25
+ </section>
26
+
27
+ <section class="features">
28
+ <h2>特性</h2>
29
+ <ul>
30
+ <li>⚡ 全球 CDN 加速</li>
31
+ <li>🔒 自動 HTTPS</li>
32
+ <li>🚀 無限頻寬</li>
33
+ <li>🌍 Edge 網絡部署</li>
34
+ </ul>
35
+ </section>
36
+
37
+ <section class="demo">
38
+ <h2>互動示範</h2>
39
+ <button id="clickBtn" class="btn">點擊我!</button>
40
+ <p id="message"></p>
41
+ <p class="timestamp">當前時間:<span id="timestamp"></span></p>
42
+ </section>
43
+ </main>
44
+
45
+ <footer>
46
+ <p>建立於 {{date}} | {{year}}</p>
47
+ <p class="license">授權:{{#license}}{{license}}{{/license}}{{^license}}MIT{{/license}}</p>
48
+ </footer>
49
+ </div>
50
+
51
+ <script type="module" src="js/main.js"></script>
52
+ </body>
53
+ </html>