Skip to content

Commit

Permalink
[vx.dev] prompt:
Browse files Browse the repository at this point in the history
{
  "prompt": "create colorful UI\n",
  "images": []
}
  • Loading branch information
Yuyz0112 committed Dec 21, 2023
1 parent 6791b75 commit dceffa5
Showing 1 changed file with 70 additions and 3 deletions.
73 changes: 70 additions & 3 deletions preview-ui/src/Preview.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,70 @@
export default function Empty() {
return <p>vx.dev</p>;
}
import { useEffect, useState } from 'react';
import { ResponsiveBar } from "@nivo/bar";
import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";

const HomePage = () => {
// Placeholder data for chart
const chartData = [
{ day: "Monday", visitors: 40 },
{ day: "Tuesday", visitors: 30 },
{ day: "Wednesday", visitors: 20 },
{ day: "Thursday", visitors: 27 },
{ day: "Friday", visitors: 18 },
{ day: "Saturday", visitors: 23 },
{ day: "Sunday", visitors: 34 }
];

return (
<div className="bg-gradient-to-r from-purple-500 to-pink-500 h-screen p-12">
<header className="flex justify-between items-center pb-8">
<h1 className="text-4xl font-bold text-white">Dashboard</h1>
<Avatar>
<AvatarImage src="https://images.unsplash.com/photo-1606788075766-d25f6de60077?w=800" />
<AvatarFallback delayMs={600}>JD</AvatarFallback>
</Avatar>
</header>
<main>
<div className="bg-white p-5 rounded-lg shadow-lg mb-8">
<h2 className="text-2xl font-semibold mb-4 text-gray-800">Visitors Over the Week</h2>
<div className="h-64">
<ResponsiveBar
data={chartData}
keys={['visitors']}
indexBy="day"
margin={{ top: 50, right: 130, bottom: 50, left: 60 }}
padding={0.3}
colors={{ scheme: 'nivo' }}
borderColor={{ from: 'color', modifiers: [['darker', 1.6]] }}
axisTop={null}
axisRight={null}
axisBottom={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
legend: 'day',
legendPosition: 'middle',
legendOffset: 32
}}
axisLeft={{
tickSize: 5,
tickPadding: 5,
tickRotation: 0,
legend: 'visitors',
legendPosition: 'middle',
legendOffset: -40
}}
labelSkipWidth={12}
labelSkipHeight={12}
labelTextColor={{ from: 'color', modifiers: [['darker', 1.6]] }}
animate={true}
motionStiffness={90}
motionDamping={15}
/>
</div>
</div>
</main>
</div>
);
};

export default HomePage;

0 comments on commit dceffa5

Please sign in to comment.