-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
301 lines (284 loc) · 14.2 KB
/
Copy pathindex.html
File metadata and controls
301 lines (284 loc) · 14.2 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
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<title>ConTags</title>
<!-- Modern clean font -->
<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=Inter:wght@400;500;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet"
href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
crossorigin="">
<link rel="stylesheet"
href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.css">
<link rel="stylesheet"
href="https://unpkg.com/leaflet.markercluster@1.4.1/dist/MarkerCluster.Default.css">
<!-- PapaParse for parsing the CSV -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.4.1/papaparse.min.js"></script>
<!-- Phosphor Icons for premium icons -->
<script src="https://unpkg.com/@phosphor-icons/web"></script>
<!-- Google Identity Services for OAuth -->
<script src="https://accounts.google.com/gsi/client" async defer></script>
<!-- Microsoft Authentication Library for browser-based OAuth (PKCE) -->
<script src="https://alcdn.msauth.net/browser/2.35.0/js/msal-browser.min.js" defer></script>
<link rel="manifest" href="./manifest.json">
</head>
<body>
<header class="app-header">
<div class="header-left">
<div class="dropdown settings-dropdown">
<button id="settingsMenuBtn" class="hamburger-button" type="button"
aria-label="Open settings" aria-haspopup="menu" aria-expanded="false">
<i class="ph ph-list"></i>
</button>
<div id="settingsMenu" class="dropdown-menu settings-menu" role="menu" hidden>
<button id="syncGoogleBtn" class="dropdown-item" type="button" role="menuitem" disabled>
<i class="ph ph-arrows-clockwise"></i>
Sync with Google
<span id="syncCount" class="button-count" hidden></span>
</button>
<button id="syncMicrosoftBtn" class="dropdown-item" type="button" role="menuitem" disabled>
<i class="ph ph-arrows-clockwise"></i>
Sync with Microsoft
<span id="microsoftSyncCount" class="button-count" hidden></span>
</button>
<button id="exportVcardBtn" class="dropdown-item" type="button" role="menuitem" disabled>
<i class="ph ph-export"></i>
Export vCard
</button>
<button id="openMapBtn" class="dropdown-item" type="button" role="menuitem">
<i class="ph ph-map-trifold"></i>
Map
<i id="mapProgress" class="ph ph-arrows-clockwise map-progress-icon"
aria-label="Resolving addresses" title="Resolving addresses" hidden></i>
</button>
<button id="deleteContactsBtn" class="dropdown-item dropdown-item-danger"
type="button" role="menuitem" disabled>
<i class="ph ph-trash"></i>
Delete local data
</button>
</div>
</div>
<i class="ph ph-address-book"></i>
<h1>ConTags</h1>
<span id="appVersion" class="app-version" title="Installed app version">v…</span>
</div>
<div class="search-container">
<i class="ph ph-magnifying-glass search-icon"></i>
<input type="text" id="searchInput" placeholder="Search contacts..." disabled>
</div>
<div class="header-right">
<div class="dropdown">
<button id="importMenuBtn" class="btn-primary" type="button"
aria-haspopup="menu" aria-expanded="false">
<i class="ph ph-download-simple"></i>
Import contacts
<i class="ph ph-caret-down"></i>
</button>
<div id="importMenu" class="dropdown-menu" role="menu" hidden>
<label class="dropdown-item" for="csvFileInput" role="menuitem">
<i class="ph ph-file-csv"></i>
From CSV file
</label>
<button id="googleImportBtn" class="dropdown-item" type="button" role="menuitem">
<i class="ph ph-google-logo"></i>
From Google Contacts
</button>
<button id="microsoftImportBtn" class="dropdown-item" type="button" role="menuitem">
<i class="ph ph-microsoft-outlook-logo"></i>
From Microsoft Outlook
</button>
<label class="dropdown-item" for="vcardFileInput" role="menuitem">
<i class="ph ph-address-book"></i>
From vCard file
</label>
</div>
</div>
<input type="file" id="csvFileInput" accept=".csv" style="display: none;">
<input type="file" id="vcardFileInput" accept=".vcf,text/vcard" style="display: none;">
<button id="createContactBtn" class="btn-primary btn-create" type="button">
<i class="ph ph-user-plus"></i>
Create contact
</button>
</div>
</header>
<main class="app-layout">
<!-- Sidebar for Labels -->
<aside class="sidebar" id="sidebar">
<button id="mobileLabelsToggle" class="mobile-labels-toggle" type="button"
aria-expanded="false" aria-controls="labelsList">
<span>
<i class="ph ph-funnel"></i>
Labels
<span id="mobileSelectedLabelCount" class="mobile-selected-count" hidden>0 selected</span>
</span>
<span>
<strong id="mobileFilterResultCount">0 results</strong>
<i class="ph ph-caret-right"></i>
</span>
</button>
<div class="sidebar-header">
<h2>
Labels
<span id="sidebarResultCount" class="sidebar-result-count" aria-label="Matching contacts">0</span>
</h2>
<div class="sidebar-header-actions">
<button class="icon-button add-label-group-btn" id="addLabelGroupBtn"
type="button" aria-label="Create label group" title="Create label group">
<i class="ph ph-folder-plus"></i>
</button>
<button class="btn-secondary btn-small" id="clearFiltersBtn" disabled>Clear</button>
<button id="closeMobileLabelsBtn" class="icon-button mobile-labels-close"
type="button" aria-label="Close label filters">
<i class="ph ph-x"></i>
</button>
</div>
</div>
<div class="mobile-label-search">
<i class="ph ph-magnifying-glass"></i>
<input id="labelSearchInput" type="search" placeholder="Search labels..."
aria-label="Search labels">
</div>
<div class="labels-list" id="labelsList">
<p class="empty-state-text">No labels loaded</p>
<!-- Checkboxes will be injected here -->
</div>
<div class="mobile-labels-footer">
<span id="mobileFilterSummary">0 matching contacts</span>
<button id="doneMobileLabelsBtn" class="btn-primary" type="button">Done</button>
</div>
<div id="storageInfo" class="storage-info">
Contacts are stored only on this device.
</div>
</aside>
<!-- Main Content for Contacts Grid -->
<section class="content-area">
<div id="resultsSummary" class="results-summary" aria-live="polite" hidden>
<div class="results-count">
<strong id="filteredResultCount">0</strong>
<span id="resultsCountLabel">contacts</span>
</div>
<span id="resultsContext" class="results-context"></span>
</div>
<div id="statusMessage" class="status-message">
Please load a contacts CSV file to begin.
</div>
<div class="contacts-grid" id="contactsGrid">
<!-- Contact cards will be injected here -->
</div>
</section>
</main>
<dialog id="contactDialog" class="contact-dialog">
<form id="contactForm">
<div class="dialog-header">
<div>
<h2 id="contactDialogTitle">Create contact</h2>
<p id="contactDialogDescription">Add a contact to your locally stored list.</p>
</div>
<button id="closeContactDialogBtn" class="icon-button" type="button" aria-label="Close">
<i class="ph ph-x"></i>
</button>
</div>
<div class="form-grid">
<div class="photo-field">
<div id="contactPhotoPreview" class="photo-preview" aria-hidden="true">
<i class="ph ph-user"></i>
</div>
<div>
<label class="btn-secondary photo-upload-button" for="contactPhoto">
<i class="ph ph-camera"></i>
Choose photo
</label>
<input id="contactPhoto" name="photo" type="file"
accept="image/jpeg,image/png,image/webp,image/gif" hidden>
<small>JPG, PNG, WebP or GIF. The image is resized and stored locally.</small>
</div>
</div>
<label class="form-field">
<span>Name <strong aria-hidden="true">*</strong></span>
<input id="contactName" name="name" type="text" required autocomplete="name">
</label>
<label class="form-field">
<span>Email</span>
<input name="email" type="email" autocomplete="email">
</label>
<label class="form-field">
<span>Phone</span>
<input name="phone" type="tel" autocomplete="tel">
</label>
<label class="form-field">
<span>Address</span>
<textarea name="address" rows="2" autocomplete="street-address"
placeholder="Street, postal code, city, country"></textarea>
</label>
<label class="form-field">
<span>Labels</span>
<input name="labels" type="text" placeholder="Friends, Work">
<small>Separate multiple labels with commas.</small>
</label>
</div>
<p id="contactFormError" class="form-error" role="alert" hidden></p>
<div class="dialog-actions">
<button id="cancelContactBtn" class="btn-secondary" type="button">Cancel</button>
<button class="btn-primary" type="submit">
<i class="ph ph-check"></i>
<span id="contactSubmitLabel">Save contact</span>
</button>
</div>
</form>
</dialog>
<dialog id="contactDetailsDialog" class="contact-dialog contact-details-dialog">
<div class="contact-details-content">
<div class="dialog-header">
<div>
<h2>Contact details</h2>
<p>Locally stored contact information.</p>
</div>
<button id="closeContactDetailsBtn" class="icon-button" type="button"
aria-label="Close contact details">
<i class="ph ph-x"></i>
</button>
</div>
<div id="contactDetailsBody"></div>
<div class="dialog-actions">
<button id="editContactFromDetailsBtn" class="btn-primary" type="button">
<i class="ph ph-pencil-simple"></i>
Edit contact
</button>
</div>
</div>
</dialog>
<dialog id="mapDialog" class="map-dialog">
<div class="map-dialog-layout">
<div class="dialog-header map-dialog-header">
<div>
<h2>Contact map</h2>
<p>Addresses are resolved once and their coordinates are stored locally.</p>
</div>
<button id="closeMapBtn" class="icon-button" type="button" aria-label="Close map">
<i class="ph ph-x"></i>
</button>
</div>
<div id="mapStatus" class="map-status" role="status"></div>
<div id="contactsMap" class="contacts-map" aria-label="Map of contact addresses"></div>
<details id="unmappedContacts" class="unmapped-contacts" hidden>
<summary>Addresses not shown on the map</summary>
<ul id="unmappedContactsList"></ul>
</details>
<p class="map-privacy">
Opening this view sends unresolved addresses—not contact names—to Nominatim.
Results are cached locally.
</p>
</div>
</dialog>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
crossorigin=""></script>
<script src="https://unpkg.com/leaflet.markercluster@1.4.1/dist/leaflet.markercluster.js"></script>
<script type="module" src="main.js"></script>
</body>
</html>