-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
225 lines (213 loc) · 9.02 KB
/
popup.html
File metadata and controls
225 lines (213 loc) · 9.02 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Activity Tracker</title>
<link rel="stylesheet" href="popup.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container">
<header class="header">
<div class="logo">
<svg class="logo-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"/>
<polyline points="12 6 12 12 16 14"/>
</svg>
<h1>Activity Tracker</h1>
</div>
<div class="header-actions">
<button class="btn-icon" id="settingsBtn" title="Settings">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="3"/>
<path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/>
</svg>
</button>
</div>
</header>
<!-- Time Filter -->
<nav class="time-filter">
<button class="filter-btn active" data-range="today">Today</button>
<button class="filter-btn" data-range="week">Week</button>
<button class="filter-btn" data-range="month">Month</button>
<button class="filter-btn" data-range="year">Year</button>
<button class="filter-btn date-picker-btn" data-range="custom" id="datePickerBtn" title="Pick a specific date">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
<line x1="16" y1="2" x2="16" y2="6"/>
<line x1="8" y1="2" x2="8" y2="6"/>
<line x1="3" y1="10" x2="21" y2="10"/>
</svg>
</button>
</nav>
<!-- Date Picker Panel -->
<div class="date-picker-panel" id="datePickerPanel">
<div class="date-picker-header">
<button class="nav-btn" id="prevMonth">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M15 18l-6-6 6-6"/>
</svg>
</button>
<span class="current-month" id="currentMonth">January 2026</span>
<button class="nav-btn" id="nextMonth">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M9 18l6-6-6-6"/>
</svg>
</button>
</div>
<div class="date-picker-weekdays">
<span>Su</span><span>Mo</span><span>Tu</span><span>We</span><span>Th</span><span>Fr</span><span>Sa</span>
</div>
<div class="date-picker-days" id="datePickerDays">
<!-- Days will be generated by JS -->
</div>
<div class="date-picker-footer">
<span class="selected-date-label" id="selectedDateLabel">Select a date</span>
<button class="btn-secondary btn-small" id="closeDatePicker">Close</button>
</div>
</div>
<!-- Stats Overview -->
<section class="stats-overview">
<div class="stat-card">
<span class="stat-value" id="totalTime">0h 0m</span>
<span class="stat-label">Total Time</span>
</div>
<div class="stat-card">
<span class="stat-value" id="sitesCount">0</span>
<span class="stat-label">Sites Visited</span>
</div>
<div class="stat-card">
<span class="stat-value" id="pagesCount">0</span>
<span class="stat-label">Pages</span>
</div>
</section>
<!-- Current Session -->
<section class="current-session" id="currentSession">
<div class="section-header">
<h2>Currently Tracking</h2>
<span class="live-indicator">
<span class="pulse"></span>
LIVE
</span>
</div>
<div class="current-site" id="currentSite">
<span class="current-domain">No active tab</span>
<span class="current-time">-</span>
</div>
</section>
<!-- Search -->
<div class="search-wrapper">
<svg class="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/>
<path d="M21 21l-4.35-4.35"/>
</svg>
<input type="text" class="search-input" id="searchInput" placeholder="Search domains or pages...">
</div>
<!-- Activity List -->
<section class="activity-section">
<div class="section-header">
<h2>Activity</h2>
<button class="sort-btn" id="sortBtn" title="Sort by time">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 6h18M6 12h12M9 18h6"/>
</svg>
</button>
</div>
<div class="activity-list" id="activityList">
<!-- Activity items will be inserted here -->
</div>
</section>
<!-- Empty State -->
<div class="empty-state" id="emptyState" style="display: none;">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M12 8v4l3 3"/>
<circle cx="12" cy="12" r="10"/>
</svg>
<p>No activity recorded yet</p>
<span>Start browsing to track your time</span>
</div>
<!-- Settings Modal -->
<div class="modal" id="settingsModal">
<div class="modal-content">
<div class="modal-header">
<h2>Settings</h2>
<button class="btn-icon modal-close" id="closeSettings">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18 6L6 18M6 6l12 12"/>
</svg>
</button>
</div>
<div class="modal-body">
<div class="setting-item">
<div class="setting-info">
<span class="setting-label">Data Retention</span>
<span class="setting-desc">Activity data is kept for 1 year</span>
</div>
</div>
<div class="setting-item">
<div class="setting-info">
<span class="setting-label">Export Data</span>
<span class="setting-desc">Download your activity as JSON</span>
</div>
<button class="btn-secondary" id="exportBtn">Export</button>
</div>
<!-- Email Settings Section -->
<div class="setting-section-header">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width: 14px; height: 14px;">
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>
<polyline points="22,6 12,13 2,6"/>
</svg>
Daily Email Summary
</div>
<div class="setting-item toggle-item">
<div class="setting-info">
<span class="setting-label">Enable Daily Emails</span>
<span class="setting-desc">Receive summary at 11 PM</span>
</div>
<label class="toggle">
<input type="checkbox" id="emailEnabled">
<span class="toggle-slider"></span>
</label>
</div>
<div class="email-config" id="emailConfig">
<div class="setting-input-group">
<label class="input-label">Your Email</label>
<input type="email" class="setting-input" id="userEmail" placeholder="you@example.com">
</div>
<div class="setting-input-group">
<label class="input-label">Resend API Key</label>
<input type="password" class="setting-input" id="apiKey" placeholder="re_xxxxxxxxxx">
<span class="input-hint">Get your free API key at <a href="https://resend.com" target="_blank">resend.com</a></span>
</div>
<div class="setting-input-group">
<label class="input-label">Sender Email (optional)</label>
<input type="text" class="setting-input" id="senderEmail" placeholder="Activity Tracker <onboarding@resend.dev>">
</div>
<button class="btn-primary" id="saveEmailSettings">Save Settings</button>
</div>
<div class="setting-item">
<div class="setting-info">
<span class="setting-label" id="emailStatus">Not configured</span>
<span class="setting-desc">Send a test email to verify</span>
</div>
<button class="btn-secondary" id="testEmailBtn">
<span id="testEmailText">Test</span>
</button>
</div>
<div class="setting-item danger">
<div class="setting-info">
<span class="setting-label">Clear All Data</span>
<span class="setting-desc">This action cannot be undone</span>
</div>
<button class="btn-danger" id="clearDataBtn">Clear</button>
</div>
</div>
</div>
</div>
</div>
<script src="popup.js"></script>
</body>
</html>