Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

show generated code in preview

Abi Raja444c16abe642
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 74556cf5..69329258 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -16,7 +16,7 @@ function App() {
}
return (
- <div className="mx-auto mt-10 max-w-2xl">
+ <div className="mx-auto mt-10 max-w-[1000px]">
<h1 className="text-2xl mb-4">Drag & Drop a Screenshot</h1>
{referenceImages.length > 0 && (
<img className="w-[300px]" src={referenceImages[0]} alt="Reference" />
@@ -29,7 +29,7 @@ function App() {
)}
<CodePreview code={generatedCode} />
- <Preview />
+ <Preview code={generatedCode} />
</div>
);
}
diff --git a/frontend/src/components/Preview.tsx b/frontend/src/components/Preview.tsx
index 5cbaf844..c8508b1b 100644
--- a/frontend/src/components/Preview.tsx
+++ b/frontend/src/components/Preview.tsx
@@ -1,11 +1,15 @@
-function Preview() {
+interface Props {
+ code: string;
+}
+
+function Preview({ code }: Props) {
return (
<div className="w-[704px]">
<iframe
title="Iframe Example"
- srcDoc={"<h1>Hello World</h1>"}
+ srcDoc={code}
className="border-[5px] border-black rounded-[33px] p-4 shadow-lg
- transform scale-[0.55] origin-top-left w-[1280px] h-[832px]"
+ transform scale-[0.8] origin-top-left w-[1280px] h-[832px]"
></iframe>
</div>
);