File size: 3,021 Bytes
94193b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
const basicHTMLTemplate = `<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Test App</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: Arial, sans-serif;
            line-height: 1.6;
        }
        nav {
            background: #2c3e50;
            padding: 1rem;
        }
        nav ul {
            list-style: none;
            display: flex;
            gap: 2rem;
        }
        nav a {
            color: #ecf0f1;
            text-decoration: none;
        }
        main {
            padding: 2rem;
        }
    </style>
</head>
<body>
    <nav class="main-nav">
        <ul class="nav-list">
            <li><a href="#home">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#services">Services</a></li>
            <li><a href="#contact">Contact</a></li>
        </ul>
    </nav>
    <main class="content">
        <h1 class="page-title">Welcome to Test App</h1>
        <p>This is a test application for validating code generation.</p>
    </main>
    <script>
    </script>
</body>
</html>`;

const basicCSSFile = `/* Additional styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #0056b3;
}`;

const basicJSFile = `
document.addEventListener('DOMContentLoaded', function() {

    const navLinks = document.querySelectorAll('nav a');
    navLinks.forEach(link => {
        link.addEventListener('click', function(e) {
            e.preventDefault();
        });
    });
});`;

export const defaultPromptMd = `You are building a website. Use HTML, CSS, and JavaScript.`;

export const handlebarsSetup: Record<string, string> = {
  '/.PROMPT.md': defaultPromptMd,
  '/index.html': `<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>{{site_title}}</title></head>
<body>
{{> header}}
<main><h1>{{page_heading}}</h1><p>Welcome to our site.</p></main>
</body>
</html>`,
  '/about.html': `<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>About - {{site_title}}</title></head>
<body>
{{> header}}
<main><h1>About Us</h1><p>We build great things.</p></main>
</body>
</html>`,
  '/templates/header.hbs': `<header><nav class="main-nav">Site Navigation</nav></header>`,
  '/data.json': `{"site_title": "Curl Test Site", "page_heading": "Welcome Home"}`,
  '/styles.css': `body { font-family: sans-serif; }`,
};

export const standardSetup: Record<string, string> = {
  '/.PROMPT.md': defaultPromptMd,
  '/index.html': basicHTMLTemplate,
  '/styles.css': basicCSSFile,
  '/script.js': basicJSFile,
};

export { basicHTMLTemplate, basicCSSFile, basicJSFile };