-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
{ "prompt": "create colorful UI\n", "images": [] }
- Loading branch information
Showing
1 changed file
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |