Skip to content

Commit 4a93523

Browse files
committed
feat: preview panel now hoverable
1 parent 8d7fa0c commit 4a93523

2 files changed

Lines changed: 7 additions & 31 deletions

File tree

src/app/components/CssRush/components/PreviewPane.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ export function PreviewPane({ code, targetHtml }: PreviewPaneProps) {
1919
: `<html><body style="margin:0;padding:0;">${userCode}</body></html>`;
2020

2121
return (
22-
<div className="flex flex-col bg-gray-800/50 backdrop-blur rounded-xl p-6 border border-gray-700">
23-
<h3 className="text-sm font-semibold text-gray-300 mb-3 uppercase tracking-wide">
22+
<div className="flex flex-col bg-slate-900/40 backdrop-blur rounded-lg p-6 border border-slate-800">
23+
<h3 className="text-sm font-semibold text-slate-300 mb-3 uppercase tracking-wide">
2424
{showTarget ? '🎯 Target Design' : '👁 Your Rendered Code'}
2525
</h3>
2626

27-
<div className="flex-1 relative rounded-lg overflow-hidden border-2 border-gray-700 bg-white">
27+
<div
28+
onMouseEnter={() => setShowTarget(true)}
29+
onMouseLeave={() => setShowTarget(false)}
30+
className="flex-1 relative rounded-lg overflow-hidden border border-slate-700 bg-white"
31+
>
2832
<iframe
2933
key="user"
3034
title="User Output"
@@ -43,14 +47,6 @@ export function PreviewPane({ code, targetHtml }: PreviewPaneProps) {
4347
}`}
4448
/>
4549
</div>
46-
47-
<div
48-
onMouseEnter={() => setShowTarget(true)}
49-
onMouseLeave={() => setShowTarget(false)}
50-
className="mt-4 p-3 bg-slate-700/30 border border-slate-600 rounded-lg text-center text-slate-300 text-sm cursor-pointer hover:bg-slate-700/50 transition-colors"
51-
>
52-
👆 Hover here to see the target design
53-
</div>
5450
</div>
5551
);
5652
}

src/app/components/targets.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,6 @@ export const targets: Target[] = [
3434
'</style>',
3535
]
3636
},
37-
{
38-
id: 'target-3',
39-
blocks: [
40-
'<div class="root">\n',
41-
' <div></div>\n',
42-
' <div></div>\n',
43-
'</div>\n',
44-
'<style>\n',
45-
' .root {\n',
46-
' display: flex;\ngap: 1rem;\n',
47-
' }\n',
48-
' div:nth-child(2) {\n',
49-
' background-color: #10b981;\nwidth: 4rem;\nheight: 4rem;\n',
50-
' }\n',
51-
' div:nth-child(3) {\n',
52-
' background-color: #f59e0b;\nwidth: 4rem;\nheight: 4rem;\n',
53-
' }\n',
54-
'</style>',
55-
]
56-
},
5737
{
5838
id: 'target-4',
5939
blocks: [

0 commit comments

Comments
 (0)