Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions projects/saasboard/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SaaSBoard</title>
<link rel="stylesheet" href="style.css">
</head>
<body>

<div class="dashboard">

<aside class="sidebar">
<h2>SaaSBoard</h2>
<ul>
<li class="active">Dashboard</li>
<li>Analytics</li>
<li>Users</li>
<li>Settings</li>
</ul>
</aside>

<main class="main-content">

<header class="topbar">
<h1>Dashboard Overview</h1>
</header>

<section class="cards">
<div class="card">
<h3>Revenue</h3>
<p>$24,500</p>
</div>

<div class="card">
<h3>Users</h3>
<p>1,240</p>
</div>

<div class="card">
<h3>Orders</h3>
<p>320</p>
</div>

<div class="card">
<h3>Growth</h3>
<p>+18%</p>
</div>
</section>

<section class="charts">
<canvas id="chart"></canvas>
</section>

<section class="users">
<h2>Recent Users</h2>
<table>
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Status</th>
</tr>
</thead>
<tbody id="userTable"></tbody>
</table>
</section>

</main>
</div>

<script src="script.js"></script>
</body>
</html>
42 changes: 42 additions & 0 deletions projects/saasboard/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const ctx = document.getElementById("chart").getContext("2d");

const dataPoints = [10, 25, 15, 30, 22, 40, 35];

const userData = [
{ name: "John Doe", email: "john@example.com", status: "Active" },
{ name: "Jane Smith", email: "jane@example.com", status: "Inactive" },
{ name: "Alex Lee", email: "alex@example.com", status: "Active" }
];

const userTable = document.getElementById("userTable");

userData.forEach(user=>{
const row=document.createElement("tr");
row.innerHTML=`
<td>${user.name}</td>
<td>${user.email}</td>
<td>${user.status}</td>
`;
userTable.appendChild(row);
});

/* Simple Chart Drawing */

function drawChart(){
ctx.clearRect(0,0,600,300);

ctx.strokeStyle="#38bdf8";
ctx.beginPath();

dataPoints.forEach((point,index)=>{
let x=index*80+50;
let y=300-point*5;

if(index===0) ctx.moveTo(x,y);
else ctx.lineTo(x,y);
});

ctx.stroke();
}

drawChart();
83 changes: 83 additions & 0 deletions projects/saasboard/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:Arial, sans-serif;
}

body{
background:#0f172a;
color:white;
}

.dashboard{
display:flex;
min-height:100vh;
}

.sidebar{
width:220px;
background:#1e293b;
padding:20px;
}

.sidebar h2{
margin-bottom:20px;
}

.sidebar ul{
list-style:none;
}

.sidebar li{
padding:10px;
margin-bottom:5px;
cursor:pointer;
border-radius:5px;
}

.sidebar li:hover,
.sidebar .active{
background:#38bdf8;
color:black;
}

.main-content{
flex:1;
padding:20px;
}

.topbar{
margin-bottom:20px;
}

.cards{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
gap:20px;
margin-bottom:30px;
}

.card{
background:#1e293b;
padding:20px;
border-radius:10px;
}

.charts{
background:#1e293b;
padding:20px;
border-radius:10px;
margin-bottom:30px;
}

.users table{
width:100%;
border-collapse:collapse;
}

.users th,
.users td{
padding:10px;
border-bottom:1px solid #334155;
}