@titas_mallick/wedding-site-gen 1.0.8 → 1.0.9
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/cli.mjs +38 -0
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -35,6 +35,34 @@ async function main() {
|
|
|
35
35
|
config.siteUrl = await question("Website URL (e.g., https://ourwedding.com): ") || "https://ourwedding.com";
|
|
36
36
|
config.hashtag = await question("Wedding Hashtag (e.g., #TitasWedsSukanya): ") || `#${config.groomName}Weds${config.brideName}`;
|
|
37
37
|
|
|
38
|
+
console.log("\nChoose a Visual Theme:");
|
|
39
|
+
console.log("1. Classic Pink & Gold (Traditional & Romantic)");
|
|
40
|
+
console.log("2. Royal Blue & Gold (Elegant & Regal)");
|
|
41
|
+
console.log("3. Forest Green & Cream (Nature-inspired & Modern)");
|
|
42
|
+
console.log("4. Deep Red & Champagne (Passionate & Classic)");
|
|
43
|
+
|
|
44
|
+
const themeChoice = await question("Select Theme (1-4) [default: 1]: ") || "1";
|
|
45
|
+
|
|
46
|
+
const themes = {
|
|
47
|
+
"1": { // Pink & Gold
|
|
48
|
+
pink500: "#ec4899",
|
|
49
|
+
gold400: "#d99e43",
|
|
50
|
+
},
|
|
51
|
+
"2": { // Royal Blue & Gold
|
|
52
|
+
pink500: "#1e40af", // Replacing pink with blue
|
|
53
|
+
gold400: "#fbbf24",
|
|
54
|
+
},
|
|
55
|
+
"3": { // Forest Green & Cream
|
|
56
|
+
pink500: "#065f46", // Replacing pink with green
|
|
57
|
+
gold400: "#92400e", // More earthy gold
|
|
58
|
+
},
|
|
59
|
+
"4": { // Deep Red & Champagne
|
|
60
|
+
pink500: "#991b1b", // Replacing pink with red
|
|
61
|
+
gold400: "#d4af37",
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const selectedTheme = themes[themeChoice] || themes["1"];
|
|
38
66
|
const targetDir = await question("Target directory name: ") || "my-wedding-website";
|
|
39
67
|
|
|
40
68
|
rl.close();
|
|
@@ -127,6 +155,16 @@ export default adminCred;
|
|
|
127
155
|
content = JSON.stringify(pkg, null, 2);
|
|
128
156
|
}
|
|
129
157
|
|
|
158
|
+
if (entry.name === 'tailwind.config.js') {
|
|
159
|
+
// Replace the primary colors in the tailwind config
|
|
160
|
+
content = content.replace(/pink:\s*{\s*[^}]*500:\s*'#[a-fA-F0-9]{6}'/g, (match) => {
|
|
161
|
+
return match.replace(/'#[a-fA-F0-9]{6}'/, `'${selectedTheme.pink500}'`);
|
|
162
|
+
});
|
|
163
|
+
content = content.replace(/gold:\s*{\s*[^}]*400:\s*'#[a-fA-F0-9]{6}'/g, (match) => {
|
|
164
|
+
return match.replace(/'#[a-fA-F0-9]{6}'/, `'${selectedTheme.gold400}'`);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
130
168
|
await fs.writeFile(destPath, content, 'utf8');
|
|
131
169
|
} else {
|
|
132
170
|
await fs.copyFile(srcPath, destPath);
|