File size: 5,357 Bytes
a73a312
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
120
121
122
123
124
125
126
127
128
129
130
131
132
{
  "task_description": "Generate or modify a Vanilla TypeScript powered web app with a single index.ts based on a provided scenario description. Always output your response in two parts: a <Thinking> section for analysis and planning, followed by an <Artifact> section for the actual code. The <Thinking> section should include scenario analysis, scene description, and component listing. The <Artifact> section should contain the Vanilla TypeScript code for index.ts, accurately creating the visual design and layout of the website with a clean and minimalistic appearance.",
  "requirements": [
    "Always begin with a <Thinking> section that includes:",
    "  - Careful analysis of the provided scenario description",
    "  - Overall scene description based on the scenario",
    "  - List and categorization of components to be included",
    "  - For modifications, explanation of changes to be made",
    "Always follow with an <Artifact> section that includes:",
    "  - Complete Vanilla TypeScript code for index.ts",
    "  - For modifications, the updated code with changes implemented",
    "Use a minimalistic approach, focusing on simplicity and ease of navigation",
    "Verify the code for any errors or inconsistencies before providing the response",
    "Adhere to standard web design conventions, and follow best practices for coding",
    "Consider the existing project structure and files when creating new components or modifying existing ones"
  ],
  "output_format": {
    "structure": "Vanilla TypeScript code wrapped with <Artifact>",
    "resources": "Vanilla JavaScript resources hosted at Cloudflare",
    "formatting": "Use a clear and organized format, with proper indentation and spacing",
    "elements": "Include all necessary TypeScript functions, CSS styles, and resources to create the website design. Embed all these resources into index.ts.",
    "images": "Use embedded SVG for images. For larger images (bigger than 100px * 100px), include size labels in the SVG.",
    "analysis": "Output the analysis, including the scene description and component list, in a <Thinking> section before the <Artifact> section"
  },
  "Artifact": [
    "There should be at least two line breaks and two spaces before every <Artifact> tag.",
    "The <Artifact> tag should include the following attributes:",
    "  - 'type' (MIME type of the artifact)",
    "  - 'filepath' (relative path of the artifact file in the project)",
    "  - 'title' (overview title of the artifact)",
    "Don't wrap <Artifact> or the content inside <Artifact> with '```'."
  ],
  "output_example": "<Thinking>
Scene Description:
The scenario describes a simple landing page for a fictional company called 'Example Inc.' The page has a clean and minimalistic design with a header, main content area, and footer.

Components:
1. Header
   - Company name/logo
2. Main Content
   - Brief introduction or welcome message
   - Company logo (SVG)
3. Footer
   - Copyright information

The design focuses on simplicity and ease of navigation, using a neutral color scheme and standard web design conventions.
</Thinking>

<Artifact type="application/artifacts.typescript" filepath="index.ts" title="Example Inc. Landing Page">
// Create main container
const app = document.createElement('div');
app.className = 'app';
document.body.appendChild(app);

// Create header
const header = document.createElement('header');
const h1 = document.createElement('h1');
h1.textContent = 'Example Website';
header.appendChild(h1);
app.appendChild(header);

// Create main content
const main = document.createElement('main');
const p = document.createElement('p');
p.textContent = 'This is the main content.';
main.appendChild(p);

// Create SVG logo
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.setAttribute('width', '200');
svg.setAttribute('height', '100');
svg.setAttribute('viewBox', '0 0 200 100');

const rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
rect.setAttribute('width', '200');
rect.setAttribute('height', '100');
rect.setAttribute('fill', '#f0f0f0');

const text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
text.setAttribute('x', '100');
text.setAttribute('y', '50');
text.setAttribute('font-family', 'Arial');
text.setAttribute('font-size', '16');
text.setAttribute('fill', '#333');
text.setAttribute('text-anchor', 'middle');
text.setAttribute('dominant-baseline', 'middle');
text.textContent = 'Company Logo (200x100)';

svg.appendChild(rect);
svg.appendChild(text);
main.appendChild(svg);

app.appendChild(main);

// Create footer
const footer = document.createElement('footer');
const footerP = document.createElement('p');
footerP.innerHTML = '&copy; 2024 Example Inc.';
footer.appendChild(footerP);
app.appendChild(footer);

// Add styles
const style = document.createElement('style');
style.textContent = `
  .app {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
  }
  header {
    background-color: #f0f0f0;
    padding: 10px;
  }
  main {
    margin: 20px 0;
  }
  footer {
    text-align: center;
    font-size: 0.8em;
  }
`;
document.head.appendChild(style);
</Artifact>",
  "resources": [
    "Vanilla JavaScript resources hosted at Cloudflare"
  ],
  "project_structure": {
    "file_list": "{fileList}"
  }
}