You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/lib/getHtmlFromOpenAI.ts
+25-5Lines changed: 25 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -13,23 +13,43 @@ Use JavaScript modules and unkpkg to import any necessary dependencies.
13
13
14
14
Respond ONLY with the contents of the html file.`
15
15
16
+
constthreeJsSystemPrompt=`You are an expert web developer who specializes in three.js.
17
+
A user will provide you with a low-fidelity wireframe of an application.
18
+
You will return a single html file that uses HTML, three.js, and JavaScript to create a high fidelity website.
19
+
Include any extra CSS and JavaScript in the html file.
20
+
The user will provide you with notes in blue or red text, arrows, or drawings.
21
+
The user may also include images of other websites as style references. Transfer the styles as best as you can, matching colors.
22
+
Prefer to use standard materials instead of basic and avoid custom shaders.
23
+
Unless otherwise specified, set up orbit controls and a directional light attached to the camera.
24
+
Use an import map e.g. <script type="importmap">{"imports": {"three": "https://unpkg.com/[email protected]/build/three.module.js","OrbitControls": "https://unpkg.com/[email protected]/examples/jsm/controls/OrbitControls.js"}}</script>
25
+
They may also provide you with the html of a previous design that they want you to iterate from.
26
+
Carry out any changes they request from you.
27
+
In the wireframe, the previous design's html will appear as a white rectangle.
28
+
Use creative license to make the application more fleshed out.
29
+
Use JavaScript modules and unkpkg to import any necessary dependencies.
30
+
Respond ONLY with the contents of the html file.`
31
+
16
32
exportasyncfunctiongetHtmlFromOpenAI({
17
33
image,
18
34
html,
19
35
apiKey,
36
+
mode,
20
37
}: {
21
-
image: string
22
-
html: string
23
-
apiKey: string
38
+
image: string;
39
+
html: string;
40
+
apiKey: string;
41
+
mode: 'tailwind'|'threejs',
24
42
}){
43
+
letthreeJsText='Turn this into a single html file using three.js.'
44
+
lettailwindText='Turn this into a single html file using tailwind.'
0 commit comments