File size: 14,010 Bytes
8a8388a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97645ee
 
8a8388a
 
 
 
 
 
 
 
 
 
 
 
 
 
97645ee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a8388a
 
 
 
 
 
 
24d615f
 
 
8a8388a
24d615f
 
 
 
 
 
8a8388a
 
 
 
24d615f
 
8a8388a
24d615f
 
 
 
 
 
8a8388a
 
 
 
24d615f
 
8a8388a
24d615f
 
 
 
 
 
8a8388a
 
 
 
24d615f
 
8a8388a
24d615f
 
 
 
 
 
8a8388a
 
 
 
 
 
24d615f
8a8388a
 
24d615f
 
 
8a8388a
24d615f
8a8388a
 
 
24d615f
 
 
8a8388a
24d615f
8a8388a
 
 
24d615f
 
 
8a8388a
24d615f
8a8388a
 
 
24d615f
 
 
8a8388a
 
 
 
24d615f
 
 
 
 
 
8a8388a
24d615f
 
 
8a8388a
24d615f
 
 
8a8388a
24d615f
8a8388a
 
 
 
24d615f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a8388a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dashboard - ClipsCompass</title>
    <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                        secondary: '#1E40AF',
                        accent: '#10B981'
                    }
                }
            }
        }
    </script>
</head>
<body class="bg-gray-50">
    <!-- Navigation -->
    <nav class="bg-white shadow-sm border-b">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-16">
                <div class="flex items-center">
                    <div class="flex-shrink-0 flex items-center">
                        <i data-feather="compass" class="h-8 w-8 text-primary"></i>
                        <span class="ml-2 text-xl font-bold text-gray-900">ClipsCompass</span>
                    </div>
                    <div class="hidden md:ml-6 md:flex md:space-x-8" id="mainNavLinks">
                        <!-- Dynamic links will be inserted here by JavaScript -->
                    </div>
                </div>
                <div class="flex items-center space-x-4">
                    <span class="text-sm text-gray-700" id="userName">John Doe</span>
                    <div class="relative">
                        <button id="userMenuButton" class="flex items-center text-sm rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary">
                            <img class="h-8 w-8 rounded-full" src="http://static.photos/people/200x200/1" alt="User profile">
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </nav>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const mainNavLinks = document.getElementById('mainNavLinks');
            const currentPath = window.location.pathname;
            
            const navItems = [
                { path: '/dashboard', name: 'Dashboard', icon: 'home' },
                { path: '/campaigns', name: 'Campaigns', icon: 'target' },
                { path: '/leaderboard', name: 'Leaderboard', icon: 'trending-up' },
                { path: '/goals', name: 'Goals', icon: 'award' }
            ];
            
            let navHTML = '';
            navItems.forEach(item => {
                const isActive = currentPath === item.path;
                navHTML += `
                    <a href="${item.path}" class="${isActive ? 'border-primary text-gray-900' : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700'} inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium">
                        <i data-feather="${item.icon}" class="h-4 w-4 mr-1"></i>
                        ${item.name}
                    </a>
                `;
            });
            
            mainNavLinks.innerHTML = navHTML;
            feather.replace();
            
            // Load user data
            const userData = JSON.parse(localStorage.getItem('userData') || '{}');
            if (userData.fullName) {
                document.getElementById('userName').textContent = userData.fullName;
                document.getElementById('welcomeName').textContent = userData.fullName.split(' ')[0];
            }
        });

        function logout() {
            localStorage.removeItem('isLoggedIn');
            localStorage.removeItem('userData');
            window.location.href = '/login';
        }
    </script>
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
        <div class="px-4 py-6 sm:px-0">
            <!-- Welcome Section -->
            <div class="mb-8">
                <h1 class="text-2xl font-bold text-gray-900">Welcome back, <span id="welcomeName">John</span>!</h1>
                <p class="text-gray-600">Here's your campaign overview for today</p>
            </div>
            <!-- Stats Grid -->
            <div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
                <div class="bg-white overflow-hidden shadow rounded-lg transition-transform hover:scale-105">
                    <div class="p-4 sm:p-6">
                        <div class="flex items-center">
                            <div class="flex-shrink-0 bg-primary/10 p-2 rounded-full">
                                <i data-feather="target" class="h-5 w-5 sm:h-6 sm:w-6 text-primary"></i>
                            </div>
                            <div class="ml-4 flex-1 min-w-0">
                                <dt class="text-xs sm:text-sm font-medium text-gray-500 truncate">Active Campaigns</dt>
                                <dd class="text-base sm:text-lg font-semibold text-gray-900" id="activeCampaigns">12</dd>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="bg-white overflow-hidden shadow rounded-lg transition-transform hover:scale-105">
                    <div class="p-4 sm:p-6">
                        <div class="flex items-center">
                            <div class="flex-shrink-0 bg-accent/10 p-2 rounded-full">
                                <i data-feather="check-circle" class="h-5 w-5 sm:h-6 sm:w-6 text-accent"></i>
                            </div>
                            <div class="ml-4 flex-1 min-w-0">
                                <dt class="text-xs sm:text-sm font-medium text-gray-500 truncate">Completed Today</dt>
                                <dd class="text-base sm:text-lg font-semibold text-gray-900" id="completedToday">8</dd>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="bg-white overflow-hidden shadow rounded-lg transition-transform hover:scale-105">
                    <div class="p-4 sm:p-6">
                        <div class="flex items-center">
                            <div class="flex-shrink-0 bg-primary/10 p-2 rounded-full">
                                <i data-feather="trending-up" class="h-5 w-5 sm:h-6 sm:w-6 text-primary"></i>
                            </div>
                            <div class="ml-4 flex-1 min-w-0">
                                <dt class="text-xs sm:text-sm font-medium text-gray-500 truncate">Weekly Progress</dt>
                                <dd class="text-base sm:text-lg font-semibold text-gray-900" id="weeklyProgress">75%</dd>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="bg-white overflow-hidden shadow rounded-lg transition-transform hover:scale-105">
                    <div class="p-4 sm:p-6">
                        <div class="flex items-center">
                            <div class="flex-shrink-0 bg-yellow-500/10 p-2 rounded-full">
                                <i data-feather="award" class="h-5 w-5 sm:h-6 sm:w-6 text-yellow-500"></i>
                            </div>
                            <div class="ml-4 flex-1 min-w-0">
                                <dt class="text-xs sm:text-sm font-medium text-gray-500 truncate">Team Rank</dt>
                                <dd class="text-base sm:text-lg font-semibold text-gray-900" id="teamRank">#2</dd>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- Progress Section -->
            <div class="mt-6 sm:mt-8 grid grid-cols-1 gap-4 sm:gap-5 lg:grid-cols-2">
                <!-- Personal Progress -->
                <div class="bg-white shadow rounded-lg">
                    <div class="p-4 sm:p-6">
                        <h3 class="text-base sm:text-lg leading-6 font-medium text-gray-900">Personal Progress</h3>
                        <div class="mt-3 sm:mt-4 space-y-3 sm:space-y-4">
                        <div>
                            <div class="flex justify-between text-xs sm:text-sm text-gray-600 mb-1">
                                <span>Daily Goal</span>
                                <span id="dailyGoalProgress">8/10</span>
                            </div>
                            <div class="w-full bg-gray-200 rounded-full h-1.5 sm:h-2">
                                <div class="bg-primary h-1.5 sm:h-2 rounded-full" style="width: 80%"></div>
</div>
                        <div>
                            <div class="flex justify-between text-xs sm:text-sm text-gray-600 mb-1">
                                <span>Weekly Target</span>
                                <span id="weeklyTargetProgress">35/50</span>
                            </div>
                            <div class="w-full bg-gray-200 rounded-full h-1.5 sm:h-2">
                                <div class="bg-accent h-1.5 sm:h-2 rounded-full" style="width: 70%"></div>
</div>
                        <div>
                            <div class="flex justify-between text-xs sm:text-sm text-gray-600 mb-1">
                                <span>Monthly Objective</span>
                                <span id="monthlyObjectiveProgress">120/200</span>
                            </div>
                            <div class="w-full bg-gray-200 rounded-full h-1.5 sm:h-2">
                                <div class="bg-secondary h-1.5 sm:h-2 rounded-full" style="width: 60%"></div>
</div>
                    </div>
                </div>
                <!-- Recent Activity -->
                <div class="bg-white shadow rounded-lg">
                    <div class="p-4 sm:p-6">
                        <h3 class="text-base sm:text-lg leading-6 font-medium text-gray-900">Recent Activity</h3>
                        <div class="mt-3 sm:mt-4 space-y-2 sm:space-y-3" id="recentActivity">
                            <div class="flex items-center text-xs sm:text-sm">
                                <i data-feather="check" class="h-3 w-3 sm:h-4 sm:w-4 text-accent mr-2"></i>
                                <span class="truncate">Completed campaign "Tech News Roundup"</span>
                            </div>
                            <div class="flex items-center text-xs sm:text-sm">
                                <i data-feather="plus" class="h-3 w-3 sm:h-4 sm:w-4 text-primary mr-2"></i>
                                <span class="truncate">Started new campaign "Social Media Highlights"</span>
                            </div>
                            <div class="flex items-center text-xs sm:text-sm">
                                <i data-feather="award" class="h-3 w-3 sm:h-4 sm:w-4 text-yellow-500 mr-2"></i>
                                <span class="truncate">Reached weekly goal milestone</span>
                            </div>
</div>
                    </div>
                </div>
            </div>
            <!-- Quick Actions -->
            <div class="mt-6 sm:mt-8">
                <h3 class="text-base sm:text-lg leading-6 font-medium text-gray-900 mb-3 sm:mb-4">Quick Actions</h3>
                <div class="grid grid-cols-1 gap-3 sm:grid-cols-3 sm:gap-4">
                    <a href="/campaigns" class="inline-flex items-center justify-center px-3 py-1.5 sm:px-4 sm:py-2 border border-transparent text-xs sm:text-sm font-medium rounded-md text-white bg-primary hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary">
                        <i data-feather="plus" class="h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"></i>
                        New Campaign
                    </a>
                    <a href="/goals" class="inline-flex items-center justify-center px-3 py-1.5 sm:px-4 sm:py-2 border border-gray-300 text-xs sm:text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary">
                        <i data-feather="target" class="h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"></i>
                        Set Goals
                    </a>
                    <a href="/leaderboard" class="inline-flex items-center justify-center px-3 py-1.5 sm:px-4 sm:py-2 border border-gray-300 text-xs sm:text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary">
                        <i data-feather="trending-up" class="h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"></i>
                        View Leaderboard
                    </a>
</div>
    </div>
</div>

<script>
    feather.replace();
    
    // Mock data for dashboard
    document.addEventListener('DOMContentLoaded', function() {
        // Simulate API call to get user data
        setTimeout(() => {
            document.getElementById('userName').textContent = 'Sarah Chen';
            document.getElementById('welcomeName').textContent = 'Sarah';
            document.getElementById('activeCampaigns').textContent = '15';
            document.getElementById('completedToday').textContent = '12';
            document.getElementById('weeklyProgress').textContent = '85%';
            document.getElementById('teamRank').textContent = '#1';
            
            // Update progress bars
            document.getElementById('dailyGoalProgress').textContent = '12/15';
            document.getElementById('weeklyTargetProgress').textContent = '42/50';
            document.getElementById('monthlyObjectiveProgress').textContent = '165/200';
        }, 500);
    });
</script>
</body>
</html>