Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mMAKABAKAa committed Jan 20, 2024
1 parent e18679d commit a0c79a1
Show file tree
Hide file tree
Showing 20 changed files with 781 additions and 10 deletions.
17 changes: 17 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,21 @@
background-color: var(--glass);
overflow: hidden;
grid-template-columns: 11rem auto 20rem;
gap: 10px;
}

@media screen and (max-width: 1200px) {
.AppGlass{
grid-template-columns: 10% 50% auto;
overflow: scroll;
}
}

@media screen and (max-width: 768px){
.AppGlass{
grid-template-columns: 1fr;
}
.AppGlass::-webkit-scrollbar{
display: none;
}
}
4 changes: 4 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import './App.css'
import Sidebar from './componemts/sidebar/Sidebar';
import MainDash from './componemts/MainDash/MainDash';
import RightSide from './componemts/RightSide/RightSide';
function App() {
return (
<div className="App">
<div className="AppGlass">
<Sidebar/>
<MainDash/>
<RightSide/>
</div>
</div>
);
Expand Down
82 changes: 81 additions & 1 deletion src/Data/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ import {
UilPackage,
UilChart,
UilSignOutAlt,
UilMoneyWithdrawal,
UilUsdSquare,
} from "@iconscout/react-unicons";

import img1 from "../imgs/img1.png";
import img2 from "../imgs/img2.png";
import img3 from "../imgs/img3.png";

export const SidebarData=[{
icon: UilEstate,
heading: "Dashboard",
Expand All @@ -27,4 +33,78 @@ import {
{
icon: UilChart,
heading: 'Analytics'
},];
},];

export const CardsData=[
{
title:"Sales",
color:{
backGround: "linear-gradient(180deg, #bb67ff 0%, #c484f3 100%)",
boxShadow: "0px 10px 20px 0px #e0c6f5",
},
barValue:70,
value:"25,970",
png:UilUsdSquare,
series:[
{
name: "Sales",
data: [31, 40, 28, 51, 42, 109, 100],
},
],
},
{
title: "Revenue",
color: {
backGround: "linear-gradient(180deg, #FF919D 0%, #FC929D 100%)",
boxShadow: "0px 10px 20px 0px #FDC0C7",
},
barValue: 80,
value: "14,270",
png: UilMoneyWithdrawal,
series: [
{
name: "Revenue",
data: [10, 100, 50, 70, 80, 30, 40],
},
],
},
{
title: "Expenses",
color: {
backGround:
"linear-gradient(rgb(248, 212, 154) -146.42%, rgb(255 202 113) -46.42%)",
boxShadow: "0px 10px 20px 0px #F9D59B",
},
barValue: 60,
value: "4,270",
png: UilClipboardAlt,
series: [
{
name: "Expenses",
data: [10, 25, 15, 30, 12, 15, 20],
},
],
},
];

// Recent Update Card Data
export const UpdatesData = [
{
img: img1,
name: "Andrew Thomas",
noti: "has ordered Apple smart watch 2500mh battery.",
time: "25 seconds ago",
},
{
img: img2,
name: "James Bond",
noti: "has received Samsung gadget for charging battery.",
time: "30 minutes ago",
},
{
img: img3,
name: "Iron Man",
noti: "has ordered Apple smart watch, samsung Gear 2500mh battery.",
time: "2 hours ago",
},
];
102 changes: 102 additions & 0 deletions src/componemts/Card/Card.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
.CompactCard{
display: flex;
flex: 1;
height: 7rem!important;
border-radius: 0.7rem;
color: white;
position: relative;
cursor: pointer;
padding: 1rem;
}

.CompactCard:hover{
box-shadow: none;
}

.radialBar{
display: flex;
flex: 1;
justify-content: flex-end;
flex-direction: column ;
gap: 1rem;
}
.CircularProgressbar{
width: 4rem!important;
overflow: visible!important;

}
.CircularProgressbar-path{
stroke: white!important;
stroke-width: 12px!important;
filter: drop-shadow(2px 4px 6px white);
}
.CircularProgressbar-trail{
display: none;
}
.CircularProgressbar-text{
fill: white!important;
}
.radialBar span{
font-size: 17px;
font-weight: bold;
}

/* detail */
.detail{
display: flex;
flex-direction: column;
justify-content: space-between;
flex: 1;
align-items: flex-end;
}
.detail span:nth-child(2){
font-size: 22px;
font-weight: bold;
}
.detail span:nth-child(3){
font-size: 12px;
}
/* Expanded Card */
.ExpandedCard{
position: absolute;
width: 60%;
height: 70vh;
z-index: 9;
left: 13rem;
border-radius: 1rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 1rem;
}
.ExpandedCard span:nth-of-type(1){
color: white;
font-size: 26px;
font-weight: bold;
text-shadow: 0px 0px 15px white;
}
.ExpandedCard span:nth-of-type(2){
color: white;
font-size: 16px;
}
.chartContainer{
width: 70%;
}

@media screen and (max-width: 1200px){
.ExpandedCard{
top: 2rem;
left: 6rem;
height: 70vh;
}
}

@media screen and (max-width: 768px){
.ExpandedCard{
top: 8rem;
height: 50%;
left: 15px;
width: 80%;
}
}
130 changes: 130 additions & 0 deletions src/componemts/Card/Card.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import React, { useState } from 'react';
import './Card.css';
import { motion, AnimateSharedLayout } from "framer-motion";
import { CircularProgressbar } from "react-circular-progressbar";
import "react-circular-progressbar/dist/styles.css";
import {UilTimes} from '@iconscout/react-unicons';
import Chart from 'react-apexcharts'
const Card = (props) => {

const [expanded, setExpanded] = useState(false);

return (
<div className="Card">
<AnimateSharedLayout>
{
expanded?(
<ExpandedCard param={props} setExpanded={()=>setExpanded(false)}/>
):
<CompactCard param={props} setExpanded={()=>setExpanded(true)}/>
}
</AnimateSharedLayout>
</div>
)
}


//CompactCard
function CompactCard({param,setExpanded}){
const Png=param.png;
return(
<motion.div className="CompactCard"
style={
{
background:param.color.backGround,
boxShadow:param.color.boxShadow
}}
onClick={setExpanded}
layoutId='expandableCard'
>

<div className="radialBar">
<CircularProgressbar
value={param.barValue}
text={`${param.barValue}%`}
/>
<span>{param.title}</span>
</div>
<div className="detail">
<Png/>
<span>${param.value}</span>
<span>Last 24 hours</span>
</div>
</motion.div>
)
}

//ExpandedCard
function ExpandedCard({param,setExpanded}){
const data={
options: {
chart: {
type: "area",
height: "auto",
},

dropShadow: {
enabled: false,
enabledOnSeries: undefined,
top: 0,
left: 0,
blur: 3,
color: "#000",
opacity: 0.35,
},

fill: {
colors: ["#fff"],
type: "gradient",
},
dataLabels: {
enabled: false,
},
stroke: {
curve: "smooth",
colors: ["white"],
},
tooltip: {
x: {
format: "dd/MM/yy HH:mm",
},
},
grid: {
show: true,
},
xaxis: {
type: "datetime",
categories: [
"2018-09-19T00:00:00.000Z",
"2018-09-19T01:30:00.000Z",
"2018-09-19T02:30:00.000Z",
"2018-09-19T03:30:00.000Z",
"2018-09-19T04:30:00.000Z",
"2018-09-19T05:30:00.000Z",
"2018-09-19T06:30:00.000Z",
],
},
},
}
return(
<motion.div className="ExpandedCard"
style={
{
background:param.color.backGround,
boxShadow:param.color.boxShadow
}}
layoutId='expandableCard'
>
<div
style={{alignSelf:'flex-end',cursor:'pointer',color:'white'}}>
<UilTimes onClick={setExpanded}/>
</div>
<span>{param.title}</span>
<div className="chartContainer">
<Chart series={param.series} type='area' options={data.options}/>
</div>
<span>Last 24 hours</span>
</motion.div>
)
}
export default Card
23 changes: 23 additions & 0 deletions src/componemts/Cards/Cards.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.Cards{
display: flex;
gap:10px;
}

.parentContainer{
width: 100%;
}

@media screen and (max-width: 1200px){
.Cards{
flex-direction: column;
}
.parentContainer{
height: 9rem;
}
}

@media screen and (max-width: 768px){
.Cards{
width: 90%;
}
}
Loading

0 comments on commit a0c79a1

Please sign in to comment.