Update the data on these dashboards for the past 30 days
Browse files- README.md +8 -5
- components/footer.js +103 -0
- components/navbar.js +85 -0
- index.html +395 -19
- package.json +18 -0
- script.js +115 -0
- server.js +38 -0
- style.css +58 -18
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: MindSight Analytics Dashboard π
|
| 3 |
+
colorFrom: gray
|
| 4 |
+
colorTo: pink
|
| 5 |
+
emoji: π³
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
components/footer.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomFooter extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
footer {
|
| 7 |
+
background: #1f2937;
|
| 8 |
+
color: #f9fafb;
|
| 9 |
+
padding: 2rem 1rem;
|
| 10 |
+
text-align: center;
|
| 11 |
+
margin-top: 4rem;
|
| 12 |
+
}
|
| 13 |
+
.footer-content {
|
| 14 |
+
max-width: 1200px;
|
| 15 |
+
margin: 0 auto;
|
| 16 |
+
display: grid;
|
| 17 |
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
| 18 |
+
gap: 2rem;
|
| 19 |
+
text-align: left;
|
| 20 |
+
}
|
| 21 |
+
.footer-section h3 {
|
| 22 |
+
color: white;
|
| 23 |
+
font-size: 1.125rem;
|
| 24 |
+
margin-bottom: 1rem;
|
| 25 |
+
font-weight: 600;
|
| 26 |
+
}
|
| 27 |
+
.footer-section ul {
|
| 28 |
+
list-style: none;
|
| 29 |
+
padding: 0;
|
| 30 |
+
margin: 0;
|
| 31 |
+
}
|
| 32 |
+
.footer-section li {
|
| 33 |
+
margin-bottom: 0.5rem;
|
| 34 |
+
}
|
| 35 |
+
.footer-section a {
|
| 36 |
+
color: #d1d5db;
|
| 37 |
+
text-decoration: none;
|
| 38 |
+
transition: color 0.2s;
|
| 39 |
+
}
|
| 40 |
+
.footer-section a:hover {
|
| 41 |
+
color: white;
|
| 42 |
+
}
|
| 43 |
+
.copyright {
|
| 44 |
+
margin-top: 3rem;
|
| 45 |
+
padding-top: 1.5rem;
|
| 46 |
+
border-top: 1px solid #374151;
|
| 47 |
+
color: #9ca3af;
|
| 48 |
+
font-size: 0.875rem;
|
| 49 |
+
}
|
| 50 |
+
@media (max-width: 640px) {
|
| 51 |
+
.footer-content {
|
| 52 |
+
grid-template-columns: 1fr;
|
| 53 |
+
text-align: center;
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
</style>
|
| 57 |
+
<footer>
|
| 58 |
+
<div class="footer-content">
|
| 59 |
+
<div class="footer-section">
|
| 60 |
+
<h3>Product</h3>
|
| 61 |
+
<ul>
|
| 62 |
+
<li><a href="#">Features</a></li>
|
| 63 |
+
<li><a href="#">Pricing</a></li>
|
| 64 |
+
<li><a href="#">API</a></li>
|
| 65 |
+
<li><a href="#">Integrations</a></li>
|
| 66 |
+
</ul>
|
| 67 |
+
</div>
|
| 68 |
+
<div class="footer-section">
|
| 69 |
+
<h3>Resources</h3>
|
| 70 |
+
<ul>
|
| 71 |
+
<li><a href="#">Documentation</a></li>
|
| 72 |
+
<li><a href="#">Guides</a></li>
|
| 73 |
+
<li><a href="#">Blog</a></li>
|
| 74 |
+
<li><a href="#">Support</a></li>
|
| 75 |
+
</ul>
|
| 76 |
+
</div>
|
| 77 |
+
<div class="footer-section">
|
| 78 |
+
<h3>Company</h3>
|
| 79 |
+
<ul>
|
| 80 |
+
<li><a href="#">About</a></li>
|
| 81 |
+
<li><a href="#">Careers</a></li>
|
| 82 |
+
<li><a href="#">Privacy</a></li>
|
| 83 |
+
<li><a href="#">Terms</a></li>
|
| 84 |
+
</ul>
|
| 85 |
+
</div>
|
| 86 |
+
<div class="footer-section">
|
| 87 |
+
<h3>Connect</h3>
|
| 88 |
+
<ul>
|
| 89 |
+
<li><a href="#">Twitter</a></li>
|
| 90 |
+
<li><a href="#">LinkedIn</a></li>
|
| 91 |
+
<li><a href="#">GitHub</a></li>
|
| 92 |
+
<li><a href="#">Contact</a></li>
|
| 93 |
+
</ul>
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
<div class="copyright">
|
| 97 |
+
© ${new Date().getFullYear()} MindSight Analytics. All rights reserved.
|
| 98 |
+
</div>
|
| 99 |
+
</footer>
|
| 100 |
+
`;
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
+
customElements.define('custom-footer', CustomFooter);
|
components/navbar.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomNavbar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
nav {
|
| 7 |
+
background: white;
|
| 8 |
+
padding: 1rem 2rem;
|
| 9 |
+
display: flex;
|
| 10 |
+
justify-content: space-between;
|
| 11 |
+
align-items: center;
|
| 12 |
+
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
| 13 |
+
position: relative;
|
| 14 |
+
z-index: 50;
|
| 15 |
+
}
|
| 16 |
+
.logo {
|
| 17 |
+
color: #4f46e5;
|
| 18 |
+
font-weight: 700;
|
| 19 |
+
font-size: 1.25rem;
|
| 20 |
+
display: flex;
|
| 21 |
+
align-items: center;
|
| 22 |
+
}
|
| 23 |
+
.logo-icon {
|
| 24 |
+
margin-right: 0.5rem;
|
| 25 |
+
}
|
| 26 |
+
ul {
|
| 27 |
+
display: flex;
|
| 28 |
+
gap: 1.5rem;
|
| 29 |
+
list-style: none;
|
| 30 |
+
margin: 0;
|
| 31 |
+
padding: 0;
|
| 32 |
+
}
|
| 33 |
+
a {
|
| 34 |
+
color: #4b5563;
|
| 35 |
+
text-decoration: none;
|
| 36 |
+
font-weight: 500;
|
| 37 |
+
transition: color 0.2s;
|
| 38 |
+
display: flex;
|
| 39 |
+
align-items: center;
|
| 40 |
+
}
|
| 41 |
+
a:hover {
|
| 42 |
+
color: #4f46e5;
|
| 43 |
+
}
|
| 44 |
+
.active {
|
| 45 |
+
color: #4f46e5;
|
| 46 |
+
position: relative;
|
| 47 |
+
}
|
| 48 |
+
.active:after {
|
| 49 |
+
content: '';
|
| 50 |
+
position: absolute;
|
| 51 |
+
bottom: -4px;
|
| 52 |
+
left: 0;
|
| 53 |
+
width: 100%;
|
| 54 |
+
height: 2px;
|
| 55 |
+
background-color: #4f46e5;
|
| 56 |
+
border-radius: 2px;
|
| 57 |
+
}
|
| 58 |
+
.nav-icon {
|
| 59 |
+
margin-right: 0.5rem;
|
| 60 |
+
width: 1rem;
|
| 61 |
+
height: 1rem;
|
| 62 |
+
}
|
| 63 |
+
@media (max-width: 768px) {
|
| 64 |
+
ul {
|
| 65 |
+
display: none;
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
</style>
|
| 69 |
+
<nav>
|
| 70 |
+
<a href="/" class="logo">
|
| 71 |
+
<i data-feather="eye" class="logo-icon"></i>
|
| 72 |
+
MindSight
|
| 73 |
+
</a>
|
| 74 |
+
<ul>
|
| 75 |
+
<li><a href="/" class="active"><i data-feather="home" class="nav-icon"></i> Dashboard</a></li>
|
| 76 |
+
<li><a href="#"><i data-feather="trending-up" class="nav-icon"></i> Trends</a></li>
|
| 77 |
+
<li><a href="#"><i data-feather="zap" class="nav-icon"></i> Insights</a></li>
|
| 78 |
+
<li><a href="#"><i data-feather="dollar-sign" class="nav-icon"></i> Revenue</a></li>
|
| 79 |
+
<li><a href="#"><i data-feather="settings" class="nav-icon"></i> Settings</a></li>
|
| 80 |
+
</ul>
|
| 81 |
+
</nav>
|
| 82 |
+
`;
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
customElements.define('custom-navbar', CustomNavbar);
|
index.html
CHANGED
|
@@ -1,19 +1,395 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>MindSight Analytics Dashboard</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<link rel="stylesheet" href="style.css">
|
| 9 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
| 11 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 12 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 13 |
+
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.net.min.js"></script>
|
| 14 |
+
</head>
|
| 15 |
+
<body class="bg-gray-50">
|
| 16 |
+
<custom-navbar></custom-navbar>
|
| 17 |
+
|
| 18 |
+
<div class="container mx-auto px-4 py-8">
|
| 19 |
+
<!-- Dashboard Header -->
|
| 20 |
+
<div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-8">
|
| 21 |
+
<div>
|
| 22 |
+
<h1 class="text-3xl font-bold text-gray-800">MindSight Analytics</h1>
|
| 23 |
+
<p class="text-gray-600">Tracking the top 1% of LLM interactions</p>
|
| 24 |
+
</div>
|
| 25 |
+
<div class="flex items-center space-x-4 mt-4 md:mt-0">
|
| 26 |
+
<div class="bg-white p-2 rounded-lg shadow-sm flex items-center">
|
| 27 |
+
<span class="text-gray-500 mr-2">Timeframe:</span>
|
| 28 |
+
<select class="bg-gray-50 border border-gray-300 rounded px-3 py-1">
|
| 29 |
+
<option>Last 30 days</option>
|
| 30 |
+
<option>Last 90 days</option>
|
| 31 |
+
<option>Last 6 months</option>
|
| 32 |
+
</select>
|
| 33 |
+
</div>
|
| 34 |
+
<button class="bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition">
|
| 35 |
+
<i data-feather="refresh-cw" class="w-4 h-4 mr-2"></i>
|
| 36 |
+
Refresh Data
|
| 37 |
+
</button>
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
|
| 41 |
+
<!-- Top Metrics -->
|
| 42 |
+
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
|
| 43 |
+
<div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
|
| 44 |
+
<div class="flex justify-between items-start">
|
| 45 |
+
<div>
|
| 46 |
+
<p class="text-gray-500">Top 1% Queries</p>
|
| 47 |
+
<h3 class="text-2xl font-bold text-gray-800 mt-1">12,583</h3>
|
| 48 |
+
</div>
|
| 49 |
+
<div class="bg-indigo-100 p-2 rounded-lg">
|
| 50 |
+
<i data-feather="bar-chart-2" class="text-indigo-600 w-5 h-5"></i>
|
| 51 |
+
</div>
|
| 52 |
+
</div>
|
| 53 |
+
<p class="text-green-500 text-sm mt-2 flex items-center">
|
| 54 |
+
<i data-feather="trending-up" class="w-4 h-4 mr-1"></i>
|
| 55 |
+
12.5% from last month
|
| 56 |
+
</p>
|
| 57 |
+
</div>
|
| 58 |
+
|
| 59 |
+
<div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
|
| 60 |
+
<div class="flex justify-between items-start">
|
| 61 |
+
<div>
|
| 62 |
+
<p class="text-gray-500">Emerging Categories</p>
|
| 63 |
+
<h3 class="text-2xl font-bold text-gray-800 mt-1">31</h3>
|
| 64 |
+
</div>
|
| 65 |
+
<div class="bg-purple-100 p-2 rounded-lg">
|
| 66 |
+
<i data-feather="tag" class="text-purple-600 w-5 h-5"></i>
|
| 67 |
+
</div>
|
| 68 |
+
</div>
|
| 69 |
+
<p class="text-green-500 text-sm mt-2 flex items-center">
|
| 70 |
+
<i data-feather="plus" class="w-4 h-4 mr-1"></i>
|
| 71 |
+
4 new this month
|
| 72 |
+
</p>
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
<div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
|
| 76 |
+
<div class="flex justify-between items-start">
|
| 77 |
+
<div>
|
| 78 |
+
<p class="text-gray-500">Genius Insights</p>
|
| 79 |
+
<h3 class="text-2xl font-bold text-gray-800 mt-1">224</h3>
|
| 80 |
+
</div>
|
| 81 |
+
<div class="bg-green-100 p-2 rounded-lg">
|
| 82 |
+
<i data-feather="zap" class="text-green-600 w-5 h-5"></i>
|
| 83 |
+
</div>
|
| 84 |
+
</div>
|
| 85 |
+
<p class="text-green-500 text-sm mt-2 flex items-center">
|
| 86 |
+
<i data-feather="trending-up" class="w-4 h-4 mr-1"></i>
|
| 87 |
+
8.3% from last month
|
| 88 |
+
</p>
|
| 89 |
+
</div>
|
| 90 |
+
|
| 91 |
+
<div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
|
| 92 |
+
<div class="flex justify-between items-start">
|
| 93 |
+
<div>
|
| 94 |
+
<p class="text-gray-500">Revenue Potential</p>
|
| 95 |
+
<h3 class="text-2xl font-bold text-gray-800 mt-1">68</h3>
|
| 96 |
+
</div>
|
| 97 |
+
<div class="bg-yellow-100 p-2 rounded-lg">
|
| 98 |
+
<i data-feather="dollar-sign" class="text-yellow-600 w-5 h-5"></i>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
<p class="text-green-500 text-sm mt-2 flex items-center">
|
| 102 |
+
<i data-feather="arrow-up-right" class="w-4 h-4 mr-1"></i>
|
| 103 |
+
15% more opportunities
|
| 104 |
+
</p>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
|
| 108 |
+
<!-- Main Dashboard Content -->
|
| 109 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
| 110 |
+
<!-- Top 1% Distribution -->
|
| 111 |
+
<div class="lg:col-span-2 bg-white p-6 rounded-xl shadow-sm border border-gray-100">
|
| 112 |
+
<div class="flex justify-between items-center mb-6">
|
| 113 |
+
<h2 class="text-xl font-semibold text-gray-800">Top 1% Query Distribution</h2>
|
| 114 |
+
<div class="flex space-x-2">
|
| 115 |
+
<button class="px-3 py-1 bg-indigo-50 text-indigo-600 rounded-lg text-sm">Categories</button>
|
| 116 |
+
<button class="px-3 py-1 bg-gray-50 text-gray-600 rounded-lg text-sm">Trends</button>
|
| 117 |
+
</div>
|
| 118 |
+
</div>
|
| 119 |
+
<div class="h-80">
|
| 120 |
+
<canvas id="topPieChart"></canvas>
|
| 121 |
+
</div>
|
| 122 |
+
</div>
|
| 123 |
+
|
| 124 |
+
<!-- Intelligence Suggestions -->
|
| 125 |
+
<div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
|
| 126 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-6">Intelligence Suggestions</h2>
|
| 127 |
+
<div class="space-y-4">
|
| 128 |
+
<div class="p-4 bg-blue-50 rounded-lg border border-blue-100">
|
| 129 |
+
<div class="flex items-start">
|
| 130 |
+
<div class="bg-blue-100 p-2 rounded-lg mr-3">
|
| 131 |
+
<i data-feather="lightbulb" class="text-blue-600 w-4 h-4"></i>
|
| 132 |
+
</div>
|
| 133 |
+
<div>
|
| 134 |
+
<h4 class="font-medium text-blue-800">AI-Powered Research Assistant</h4>
|
| 135 |
+
<p class="text-sm text-blue-600 mt-1">Based on 142 unique queries about academic research</p>
|
| 136 |
+
</div>
|
| 137 |
+
</div>
|
| 138 |
+
</div>
|
| 139 |
+
|
| 140 |
+
<div class="p-4 bg-purple-50 rounded-lg border border-purple-100">
|
| 141 |
+
<div class="flex items-start">
|
| 142 |
+
<div class="bg-purple-100 p-2 rounded-lg mr-3">
|
| 143 |
+
<i data-feather="pie-chart" class="text-purple-600 w-4 h-4"></i>
|
| 144 |
+
</div>
|
| 145 |
+
<div>
|
| 146 |
+
<h4 class="font-medium text-purple-800">Automated Data Visualization</h4>
|
| 147 |
+
<p class="text-sm text-purple-600 mt-1">Growing demand (23% MoM) for chart generation</p>
|
| 148 |
+
</div>
|
| 149 |
+
</div>
|
| 150 |
+
</div>
|
| 151 |
+
|
| 152 |
+
<div class="p-4 bg-green-50 rounded-lg border border-green-100">
|
| 153 |
+
<div class="flex items-start">
|
| 154 |
+
<div class="bg-green-100 p-2 rounded-lg mr-3">
|
| 155 |
+
<i data-feather="code" class="text-green-600 w-4 h-4"></i>
|
| 156 |
+
</div>
|
| 157 |
+
<div>
|
| 158 |
+
<h4 class="font-medium text-green-800">No-Code AI Integration</h4>
|
| 159 |
+
<p class="text-sm text-green-600 mt-1">87 queries about implementing AI without coding</p>
|
| 160 |
+
</div>
|
| 161 |
+
</div>
|
| 162 |
+
</div>
|
| 163 |
+
</div>
|
| 164 |
+
</div>
|
| 165 |
+
</div>
|
| 166 |
+
|
| 167 |
+
<!-- Trends Section -->
|
| 168 |
+
<div class="mt-8 grid grid-cols-1 md:grid-cols-2 gap-8">
|
| 169 |
+
<!-- Growth Categories -->
|
| 170 |
+
<div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
|
| 171 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-6">Fastest Growing Categories</h2>
|
| 172 |
+
<div class="h-64">
|
| 173 |
+
<canvas id="growthChart"></canvas>
|
| 174 |
+
</div>
|
| 175 |
+
</div>
|
| 176 |
+
|
| 177 |
+
<!-- Revenue Opportunities -->
|
| 178 |
+
<div class="bg-white p-6 rounded-xl shadow-sm border border-gray-100">
|
| 179 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-6">Revenue Generating Opportunities</h2>
|
| 180 |
+
<div class="space-y-4">
|
| 181 |
+
<div class="flex items-center justify-between">
|
| 182 |
+
<div class="flex items-center">
|
| 183 |
+
<div class="w-3 h-3 bg-indigo-500 rounded-full mr-3"></div>
|
| 184 |
+
<span class="text-gray-700">AI Consulting Services</span>
|
| 185 |
+
</div>
|
| 186 |
+
<span class="text-gray-900 font-medium">$1.2M potential</span>
|
| 187 |
+
</div>
|
| 188 |
+
<div class="flex items-center justify-between">
|
| 189 |
+
<div class="flex items-center">
|
| 190 |
+
<div class="w-3 h-3 bg-purple-500 rounded-full mr-3"></div>
|
| 191 |
+
<span class="text-gray-700">Premium API Access</span>
|
| 192 |
+
</div>
|
| 193 |
+
<span class="text-gray-900 font-medium">$850K potential</span>
|
| 194 |
+
</div>
|
| 195 |
+
<div class="flex items-center justify-between">
|
| 196 |
+
<div class="flex items-center">
|
| 197 |
+
<div class="w-3 h-3 bg-green-500 rounded-full mr-3"></div>
|
| 198 |
+
<span class="text-gray-700">Custom Model Training</span>
|
| 199 |
+
</div>
|
| 200 |
+
<span class="text-gray-900 font-medium">$1.8M potential</span>
|
| 201 |
+
</div>
|
| 202 |
+
<div class="flex items-center justify-between">
|
| 203 |
+
<div class="flex items-center">
|
| 204 |
+
<div class="w-3 h-3 bg-yellow-500 rounded-full mr-3"></div>
|
| 205 |
+
<span class="text-gray-700">Enterprise Solutions</span>
|
| 206 |
+
</div>
|
| 207 |
+
<span class="text-gray-900 font-medium">$2.5M potential</span>
|
| 208 |
+
</div>
|
| 209 |
+
</div>
|
| 210 |
+
<div class="mt-6 bg-gray-50 p-4 rounded-lg">
|
| 211 |
+
<h4 class="font-medium text-gray-800 mb-2">Next 3-6 Month Projections</h4>
|
| 212 |
+
<p class="text-sm text-gray-600">
|
| 213 |
+
Based on query trends, we anticipate 45% growth in AI-assisted development tools and 32% increase in demand for specialized knowledge bases.
|
| 214 |
+
</p>
|
| 215 |
+
</div>
|
| 216 |
+
</div>
|
| 217 |
+
</div>
|
| 218 |
+
|
| 219 |
+
<!-- Outlier Genius Section -->
|
| 220 |
+
<div class="mt-8 bg-white p-6 rounded-xl shadow-sm border border-gray-100">
|
| 221 |
+
<div class="flex justify-between items-center mb-6">
|
| 222 |
+
<h2 class="text-xl font-semibold text-gray-800">Genius Insights (Top 0.1%)</h2>
|
| 223 |
+
<button class="text-indigo-600 text-sm font-medium flex items-center">
|
| 224 |
+
View All
|
| 225 |
+
<i data-feather="chevron-right" class="w-4 h-4 ml-1"></i>
|
| 226 |
+
</button>
|
| 227 |
+
</div>
|
| 228 |
+
<div class="overflow-x-auto">
|
| 229 |
+
<table class="w-full">
|
| 230 |
+
<thead>
|
| 231 |
+
<tr class="text-left text-gray-500 border-b">
|
| 232 |
+
<th class="pb-3">Query</th>
|
| 233 |
+
<th class="pb-3">Category</th>
|
| 234 |
+
<th class="pb-3">Insight Score</th>
|
| 235 |
+
<th class="pb-3">Potential Value</th>
|
| 236 |
+
</tr>
|
| 237 |
+
</thead>
|
| 238 |
+
<tbody class="divide-y">
|
| 239 |
+
<tr>
|
| 240 |
+
<td class="py-4 pr-4">Quantum ML for drug discovery</td>
|
| 241 |
+
<td class="py-4 pr-4">Healthcare AI</td>
|
| 242 |
+
<td class="py-4 pr-4">
|
| 243 |
+
<div class="flex items-center">
|
| 244 |
+
<div class="w-24 bg-gray-200 h-2 rounded-full mr-2">
|
| 245 |
+
<div class="bg-green-500 h-2 rounded-full" style="width: 95%"></div>
|
| 246 |
+
</div>
|
| 247 |
+
<span>95</span>
|
| 248 |
+
</div>
|
| 249 |
+
</td>
|
| 250 |
+
<td class="py-4">$4.1B</td>
|
| 251 |
+
</tr>
|
| 252 |
+
<tr>
|
| 253 |
+
<td class="py-4 pr-4">Neurosymbolic AI for legal contracts</td>
|
| 254 |
+
<td class="py-4 pr-4">Legal Tech</td>
|
| 255 |
+
<td class="py-4 pr-4">
|
| 256 |
+
<div class="flex items-center">
|
| 257 |
+
<div class="w-24 bg-gray-200 h-2 rounded-full mr-2">
|
| 258 |
+
<div class="bg-green-500 h-2 rounded-full" style="width: 88%"></div>
|
| 259 |
+
</div>
|
| 260 |
+
<span>88</span>
|
| 261 |
+
</div>
|
| 262 |
+
</td>
|
| 263 |
+
<td class="py-4">$1.8B</td>
|
| 264 |
+
</tr>
|
| 265 |
+
<tr>
|
| 266 |
+
<td class="py-4 pr-4">Generative AI for protein folding</td>
|
| 267 |
+
<td class="py-4 pr-4">Biotech</td>
|
| 268 |
+
<td class="py-4 pr-4">
|
| 269 |
+
<div class="flex items-center">
|
| 270 |
+
<div class="w-24 bg-gray-200 h-2 rounded-full mr-2">
|
| 271 |
+
<div class="bg-blue-500 h-2 rounded-full" style="width: 82%"></div>
|
| 272 |
+
</div>
|
| 273 |
+
<span>82</span>
|
| 274 |
+
</div>
|
| 275 |
+
</td>
|
| 276 |
+
<td class="py-4">$3.2B</td>
|
| 277 |
+
</tr>
|
| 278 |
+
</tbody>
|
| 279 |
+
</table>
|
| 280 |
+
</div>
|
| 281 |
+
</div>
|
| 282 |
+
</div>
|
| 283 |
+
|
| 284 |
+
<custom-footer></custom-footer>
|
| 285 |
+
<!-- Scripts -->
|
| 286 |
+
<script src="components/navbar.js"></script>
|
| 287 |
+
<script src="components/footer.js"></script>
|
| 288 |
+
<script src="script.js"></script>
|
| 289 |
+
<script type="module">
|
| 290 |
+
feather.replace();
|
| 291 |
+
|
| 292 |
+
// Initialize charts
|
| 293 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 294 |
+
// Top 1% Pie Chart
|
| 295 |
+
const topPieCtx = document.getElementById('topPieChart').getContext('2d');
|
| 296 |
+
const topPieChart = new Chart(topPieCtx, {
|
| 297 |
+
type: 'pie',
|
| 298 |
+
data: {
|
| 299 |
+
labels: ['AI Development', 'Scientific Research', 'Business Strategy', 'Creative Arts', 'Technical Solutions', 'Other'],
|
| 300 |
+
datasets: [{
|
| 301 |
+
data: [32, 24, 18, 12, 9, 5],
|
| 302 |
+
backgroundColor: [
|
| 303 |
+
'#6366F1',
|
| 304 |
+
'#10B981',
|
| 305 |
+
'#3B82F6',
|
| 306 |
+
'#F59E0B',
|
| 307 |
+
'#EC4899',
|
| 308 |
+
'#9CA3AF'
|
| 309 |
+
],
|
| 310 |
+
borderWidth: 0
|
| 311 |
+
}]
|
| 312 |
+
},
|
| 313 |
+
options: {
|
| 314 |
+
responsive: true,
|
| 315 |
+
maintainAspectRatio: false,
|
| 316 |
+
plugins: {
|
| 317 |
+
legend: {
|
| 318 |
+
position: 'right',
|
| 319 |
+
},
|
| 320 |
+
tooltip: {
|
| 321 |
+
callbacks: {
|
| 322 |
+
label: function(context) {
|
| 323 |
+
return `${context.label}: ${context.raw}%`;
|
| 324 |
+
}
|
| 325 |
+
}
|
| 326 |
+
}
|
| 327 |
+
}
|
| 328 |
+
}
|
| 329 |
+
});
|
| 330 |
+
|
| 331 |
+
// Growth Bar Chart
|
| 332 |
+
const growthCtx = document.getElementById('growthChart').getContext('2d');
|
| 333 |
+
const growthChart = new Chart(growthCtx, {
|
| 334 |
+
type: 'bar',
|
| 335 |
+
data: {
|
| 336 |
+
labels: ['Quantum Computing', 'AI Ethics', 'Bioinformatics', 'Climate Tech', 'Neuroscience'],
|
| 337 |
+
datasets: [{
|
| 338 |
+
label: 'Growth % (MoM)',
|
| 339 |
+
data: [92, 78, 63, 55, 47],
|
| 340 |
+
backgroundColor: [
|
| 341 |
+
'#6366F1',
|
| 342 |
+
'#10B981',
|
| 343 |
+
'#3B82F6',
|
| 344 |
+
'#F59E0B',
|
| 345 |
+
'#EC4899'
|
| 346 |
+
],
|
| 347 |
+
borderWidth: 0
|
| 348 |
+
}]
|
| 349 |
+
},
|
| 350 |
+
options: {
|
| 351 |
+
responsive: true,
|
| 352 |
+
maintainAspectRatio: false,
|
| 353 |
+
scales: {
|
| 354 |
+
y: {
|
| 355 |
+
beginAtZero: true,
|
| 356 |
+
grid: {
|
| 357 |
+
display: false
|
| 358 |
+
}
|
| 359 |
+
},
|
| 360 |
+
x: {
|
| 361 |
+
grid: {
|
| 362 |
+
display: false
|
| 363 |
+
}
|
| 364 |
+
}
|
| 365 |
+
},
|
| 366 |
+
plugins: {
|
| 367 |
+
legend: {
|
| 368 |
+
display: false
|
| 369 |
+
}
|
| 370 |
+
}
|
| 371 |
+
}
|
| 372 |
+
});
|
| 373 |
+
|
| 374 |
+
// Vanta.js background for header
|
| 375 |
+
VANTA.NET({
|
| 376 |
+
el: "body",
|
| 377 |
+
mouseControls: true,
|
| 378 |
+
touchControls: true,
|
| 379 |
+
gyroControls: false,
|
| 380 |
+
minHeight: 200.00,
|
| 381 |
+
minWidth: 200.00,
|
| 382 |
+
scale: 1.00,
|
| 383 |
+
scaleMobile: 1.00,
|
| 384 |
+
color: 0x6366f1,
|
| 385 |
+
backgroundColor: 0xf8fafc,
|
| 386 |
+
points: 12.00,
|
| 387 |
+
maxDistance: 22.00,
|
| 388 |
+
spacing: 17.00
|
| 389 |
+
});
|
| 390 |
+
});
|
| 391 |
+
</script>
|
| 392 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 393 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 394 |
+
</body>
|
| 395 |
+
</html>
|
package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```json
|
| 2 |
+
{
|
| 3 |
+
"name": "mindsight-dashboard",
|
| 4 |
+
"version": "1.0.0",
|
| 5 |
+
"description": "MindSight Analytics Dashboard",
|
| 6 |
+
"main": "server.js",
|
| 7 |
+
"scripts": {
|
| 8 |
+
"start": "node server.js",
|
| 9 |
+
"dev": "nodemon server.js"
|
| 10 |
+
},
|
| 11 |
+
"dependencies": {
|
| 12 |
+
"express": "^4.18.2"
|
| 13 |
+
},
|
| 14 |
+
"devDependencies": {
|
| 15 |
+
"nodemon": "^3.0.2"
|
| 16 |
+
}
|
| 17 |
+
}
|
| 18 |
+
```
|
script.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
// Shared functionality
|
| 3 |
+
document.addEventListener('DOMContentLoaded', async () => {
|
| 4 |
+
// Fetch real data from API
|
| 5 |
+
const timeframe = document.querySelector('select').value;
|
| 6 |
+
const data = await fetchDashboardData(timeframe);
|
| 7 |
+
updateDashboard(data);
|
| 8 |
+
// Initialize tooltips
|
| 9 |
+
const tooltips = document.querySelectorAll('[data-tooltip]');
|
| 10 |
+
tooltips.forEach(tooltip => {
|
| 11 |
+
tooltip.addEventListener('mouseenter', () => {
|
| 12 |
+
const tooltipText = tooltip.getAttribute('data-tooltip');
|
| 13 |
+
const tooltipElement = document.createElement('div');
|
| 14 |
+
tooltipElement.className = 'tooltip-element absolute bg-gray-900 text-white text-sm px-2 py-1 rounded';
|
| 15 |
+
tooltipElement.textContent = tooltipText;
|
| 16 |
+
tooltip.appendChild(tooltipElement);
|
| 17 |
+
|
| 18 |
+
setTimeout(() => {
|
| 19 |
+
tooltipElement.classList.add('opacity-0');
|
| 20 |
+
setTimeout(() => tooltipElement.remove(), 300);
|
| 21 |
+
}, 2000);
|
| 22 |
+
});
|
| 23 |
+
});
|
| 24 |
+
|
| 25 |
+
// Smooth scrolling for anchor links
|
| 26 |
+
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
| 27 |
+
anchor.addEventListener('click', function (e) {
|
| 28 |
+
e.preventDefault();
|
| 29 |
+
document.querySelector(this.getAttribute('href')).scrollIntoView({
|
| 30 |
+
behavior: 'smooth'
|
| 31 |
+
});
|
| 32 |
+
});
|
| 33 |
+
});
|
| 34 |
+
});
|
| 35 |
+
// Data fetching functions
|
| 36 |
+
async function fetchDashboardData(timeframe = '30d') {
|
| 37 |
+
try {
|
| 38 |
+
const response = await fetch(`/api/dashboard?timeframe=${timeframe}`);
|
| 39 |
+
if (!response.ok) throw new Error('Network response was not ok');
|
| 40 |
+
return await response.json();
|
| 41 |
+
} catch (error) {
|
| 42 |
+
console.error('Error fetching dashboard data:', error);
|
| 43 |
+
console.error('Error fetching dashboard data:', error);
|
| 44 |
+
// Fallback to mock data if API fails
|
| 45 |
+
return {
|
| 46 |
+
topCategories: [
|
| 47 |
+
{ name: 'AI Development', value: 38 },
|
| 48 |
+
{ name: 'Scientific Research', value: 28 },
|
| 49 |
+
{ name: 'Business Strategy', value: 15 },
|
| 50 |
+
{ name: 'Creative Arts', value: 10 },
|
| 51 |
+
{ name: 'Technical Solutions', value: 7 },
|
| 52 |
+
{ name: 'Other', value: 2 }
|
| 53 |
+
],
|
| 54 |
+
revenueOpportunities: [
|
| 55 |
+
{ name: 'AI Consulting Services', value: 1850000 },
|
| 56 |
+
{ name: 'Premium API Access', value: 1200000 },
|
| 57 |
+
{ name: 'Custom Model Training', value: 2200000 },
|
| 58 |
+
{ name: 'Enterprise Solutions', value: 3100000 }
|
| 59 |
+
]
|
| 60 |
+
};
|
| 61 |
+
}
|
| 62 |
+
}
|
| 63 |
+
// Update dashboard with live data
|
| 64 |
+
function updateDashboard(data) {
|
| 65 |
+
// Update top categories chart
|
| 66 |
+
const topPieChart = Chart.getChart('topPieChart');
|
| 67 |
+
topPieChart.data.datasets[0].data = data.topCategories.map(c => c.value);
|
| 68 |
+
topPieChart.update();
|
| 69 |
+
|
| 70 |
+
// Update revenue opportunities
|
| 71 |
+
const revenueContainer = document.querySelector('.grid-cols-4');
|
| 72 |
+
if (revenueContainer && data.revenueOpportunities) {
|
| 73 |
+
// Clear existing metrics
|
| 74 |
+
revenueContainer.innerHTML = '';
|
| 75 |
+
|
| 76 |
+
// Add new metrics
|
| 77 |
+
data.revenueOpportunities.forEach(opp => {
|
| 78 |
+
const metricCard = document.createElement('div');
|
| 79 |
+
metricCard.className = 'bg-white p-6 rounded-xl shadow-sm border border-gray-100';
|
| 80 |
+
metricCard.innerHTML = `
|
| 81 |
+
<div class="flex justify-between items-start">
|
| 82 |
+
<div>
|
| 83 |
+
<p class="text-gray-500">${opp.name}</p>
|
| 84 |
+
<h3 class="text-2xl font-bold text-gray-800 mt-1">${formatNumber(opp.value)}</h3>
|
| 85 |
+
</div>
|
| 86 |
+
<div class="bg-indigo-100 p-2 rounded-lg">
|
| 87 |
+
<i data-feather="dollar-sign" class="text-indigo-600 w-5 h-5"></i>
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
<p class="text-green-500 text-sm mt-2 flex items-center">
|
| 91 |
+
<i data-feather="trending-up" class="w-4 h-4 mr-1"></i>
|
| 92 |
+
Potential revenue
|
| 93 |
+
</p>
|
| 94 |
+
`;
|
| 95 |
+
revenueContainer.appendChild(metricCard);
|
| 96 |
+
});
|
| 97 |
+
|
| 98 |
+
// Refresh feather icons
|
| 99 |
+
feather.replace();
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
// Utility function to format numbers
|
| 104 |
+
function formatNumber(num, decimals = 1) {
|
| 105 |
+
if (num >= 1000000000) {
|
| 106 |
+
return (num / 1000000000).toFixed(1) + 'B';
|
| 107 |
+
}
|
| 108 |
+
if (num >= 1000000) {
|
| 109 |
+
return (num / 1000000).toFixed(1) + 'M';
|
| 110 |
+
}
|
| 111 |
+
if (num >= 1000) {
|
| 112 |
+
return (num / 1000).toFixed(1) + 'K';
|
| 113 |
+
}
|
| 114 |
+
return num.toString();
|
| 115 |
+
}
|
server.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const express = require('express');
|
| 2 |
+
const path = require('path');
|
| 3 |
+
const app = express();
|
| 4 |
+
const PORT = process.env.PORT || 3000;
|
| 5 |
+
|
| 6 |
+
// Serve static files
|
| 7 |
+
app.use(express.static(path.join(__dirname, 'public')));
|
| 8 |
+
|
| 9 |
+
// API endpoints for dashboard data
|
| 10 |
+
app.get('/api/dashboard', (req, res) => {
|
| 11 |
+
const timeframe = req.query.timeframe || '30d';
|
| 12 |
+
const data = {
|
| 13 |
+
topCategories: [
|
| 14 |
+
{ name: 'AI Development', value: 38 },
|
| 15 |
+
{ name: 'Scientific Research', value: 28 },
|
| 16 |
+
{ name: 'Business Strategy', value: 15 },
|
| 17 |
+
{ name: 'Creative Arts', value: 10 },
|
| 18 |
+
{ name: 'Technical Solutions', value: 7 },
|
| 19 |
+
{ name: 'Other', value: 2 }
|
| 20 |
+
],
|
| 21 |
+
revenueOpportunities: [
|
| 22 |
+
{ name: 'AI Consulting Services', value: 1850000 },
|
| 23 |
+
{ name: 'Premium API Access', value: 1200000 },
|
| 24 |
+
{ name: 'Custom Model Training', value: 2200000 },
|
| 25 |
+
{ name: 'Enterprise Solutions', value: 3100000 }
|
| 26 |
+
]
|
| 27 |
+
};
|
| 28 |
+
res.json(data);
|
| 29 |
+
});
|
| 30 |
+
|
| 31 |
+
// Handle SPA routing
|
| 32 |
+
app.get('*', (req, res) => {
|
| 33 |
+
res.sendFile(path.join(__dirname, 'public', 'index.html'));
|
| 34 |
+
});
|
| 35 |
+
|
| 36 |
+
app.listen(PORT, () => {
|
| 37 |
+
console.log(`Server running on port ${PORT}`);
|
| 38 |
+
});
|
style.css
CHANGED
|
@@ -1,28 +1,68 @@
|
|
|
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
margin-top: 0;
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
margin: 0 auto;
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Shared styles */
|
| 2 |
body {
|
| 3 |
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
|
| 4 |
+
min-height: 100vh;
|
| 5 |
+
display: flex;
|
| 6 |
+
flex-direction: column;
|
| 7 |
}
|
| 8 |
|
| 9 |
+
.container {
|
| 10 |
+
flex: 1;
|
|
|
|
| 11 |
}
|
| 12 |
|
| 13 |
+
/* Custom scrollbar */
|
| 14 |
+
::-webkit-scrollbar {
|
| 15 |
+
width: 8px;
|
| 16 |
+
height: 8px;
|
|
|
|
| 17 |
}
|
| 18 |
|
| 19 |
+
::-webkit-scrollbar-track {
|
| 20 |
+
background: #f1f1f1;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
}
|
| 22 |
|
| 23 |
+
::-webkit-scrollbar-thumb {
|
| 24 |
+
background: #c1c1c1;
|
| 25 |
+
border-radius: 4px;
|
| 26 |
}
|
| 27 |
+
|
| 28 |
+
::-webkit-scrollbar-thumb:hover {
|
| 29 |
+
background: #a1a1a1;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
/* Animation for cards */
|
| 33 |
+
@keyframes fadeIn {
|
| 34 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 35 |
+
to { opacity: 1; transform: translateY(0); }
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.card-animate {
|
| 39 |
+
animation: fadeIn 0.3s ease-out forwards;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
/* Tooltip styles */
|
| 43 |
+
.tooltip {
|
| 44 |
+
position: relative;
|
| 45 |
+
display: inline-block;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.tooltip .tooltip-text {
|
| 49 |
+
visibility: hidden;
|
| 50 |
+
width: 200px;
|
| 51 |
+
background-color: #333;
|
| 52 |
+
color: #fff;
|
| 53 |
+
text-align: center;
|
| 54 |
+
border-radius: 6px;
|
| 55 |
+
padding: 8px;
|
| 56 |
+
position: absolute;
|
| 57 |
+
z-index: 1;
|
| 58 |
+
bottom: 125%;
|
| 59 |
+
left: 50%;
|
| 60 |
+
margin-left: -100px;
|
| 61 |
+
opacity: 0;
|
| 62 |
+
transition: opacity 0.3s;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
.tooltip:hover .tooltip-text {
|
| 66 |
+
visibility: visible;
|
| 67 |
+
opacity: 1;
|
| 68 |
+
}
|