File size: 13,775 Bytes
ffa0093
 
 
 
 
2fe2727
ffa0093
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2fe2727
ffa0093
 
 
ff50748
ffa0093
 
 
ff50748
ffa0093
 
ff50748
ffa0093
 
2642f13
 
 
ffa0093
 
 
 
ff50748
ffa0093
ff50748
 
ffa0093
ff50748
 
ffa0093
ff50748
2642f13
 
 
ffa0093
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2fe2727
 
 
ffa0093
 
 
 
 
 
 
 
 
 
 
 
 
 
4e3ead6
 
 
 
 
 
 
ffa0093
4e3ead6
2642f13
 
4e3ead6
2642f13
4e3ead6
 
 
 
 
8b653e0
4e3ead6
 
 
 
8b653e0
 
 
 
 
 
 
 
 
 
 
4e3ead6
 
 
 
 
8b0de68
4e3ead6
 
 
 
 
 
2642f13
ffa0093
 
 
 
 
 
 
 
 
ff50748
ffa0093
 
 
 
 
ff50748
 
ffa0093
 
 
 
 
 
 
ff50748
ffa0093
 
 
 
 
ff50748
 
ffa0093
 
 
 
 
 
 
ff50748
ffa0093
 
 
 
 
 
ff50748
 
ffa0093
 
 
 
2642f13
 
 
 
4e3ead6
2642f13
 
 
8b0de68
2642f13
 
 
 
 
 
 
 
 
8b0de68
 
 
 
 
 
 
 
 
2642f13
8b0de68
2642f13
4e3ead6
2642f13
 
 
 
ffa0093
 
 
 
 
 
 
 
 
 
 
2fe2727
ff50748
 
ffa0093
 
 
 
 
 
 
 
2fe2727
 
 
 
 
 
 
 
 
 
 
 
a9fa582
 
 
8b0de68
ffa0093
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DocVault v2.1 | UPDATED</title>
    <meta name="description" content="DocVault — personal document manager powered by Hugging Face Datasets.">
    <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=Outfit:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <!-- Phosphor Icons -->
    <script src="https://unpkg.com/@phosphor-icons/web"></script>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <!-- Hidden file input -->
    <input type="file" id="fileInput" multiple style="display:none">

    <!-- Toast container -->
    <div id="toastContainer" class="toast-container"></div>

    <!-- Upload / Action Progress -->
    <div id="uploadProgress" class="upload-progress">
        <div class="upload-progress-inner">
            <div class="spinner-sm"></div>
            <span id="progressText">Working...</span>
        </div>
    </div>

    <div class="app-container">

        <!-- Sidebar -->
        <aside class="sidebar">
            <div class="logo-container">
                <i class="ph-fill ph-safe logo-icon"></i>
                <h1 class="logo-text">DocVault <span style="font-size: 10px; background: var(--primary-light); color: var(--primary-color); padding: 2px 8px; border-radius: 6px; vertical-align: middle; margin-left:8px;">v2.1</span></h1>
            </div>

            <div class="new-btn-wrapper">
                <button class="btn-primary new-btn" id="newBtn">
                    <i class="ph-bold ph-plus"></i> New
                </button>
                <div class="new-dropdown" id="newDropdown">
                    <button class="new-dropdown-item" id="createFolderBtn">
                        <i class="ph-fill ph-folder-plus"></i> Create Folder
                    </button>
                    <button class="new-dropdown-item" id="uploadFileBtn">
                        <i class="ph-fill ph-upload-simple"></i> Upload File
                    </button>
                    <button class="new-dropdown-item" id="addLinkBtn">
                        <i class="ph-fill ph-link-plus"></i> Add Link
                    </button>
                </div>
            </div>

            <nav class="sidebar-nav">
                <a href="#" class="nav-item active" id="navMyFiles">
                    <i class="ph-fill ph-folder"></i> My Files
                </a>
                <a href="#" class="nav-item" id="navRecent">
                    <i class="ph-fill ph-clock-counter-clockwise"></i> Recent
                </a>
                <a href="#" class="nav-item" id="navStarred">
                    <i class="ph-fill ph-star"></i> Starred
                </a>
                <a href="#" class="nav-item" id="navLinks">
                    <i class="ph-fill ph-link"></i> Links
                </a>
            </nav>

            <div class="sidebar-bottom">
                <div class="storage-dashboard">
                    <div class="storage-header">
                        <i class="ph-fill ph-database"></i>
                        <span>Storage</span>
                    </div>
                    <div class="storage-progress">
                        <div class="progress-fill" id="storageProgress" style="width: 0%"></div>
                    </div>
                    <p class="storage-text" id="storageUsageText">0 files • 0 MB used</p>
                </div>
                <div class="hf-badge">
                    <span class="hf-emoji">🤗</span>
                    <span>Powered by Hugging Face</span>
                </div>

            </div>
        </aside>

        <main class="main-content">
            <header class="top-header">
                <div class="menu-toggle" id="menuToggle">
                    <i class="ph-bold ph-list"></i>
                </div>
                <div class="search-bar">
                    <i class="ph-bold ph-magnifying-glass"></i>
                    <input type="text" id="searchInput" placeholder="Search files or folders...">
                </div>
                <div class="user-actions">
                    <div class="avatar">U</div>
                </div>
            </header>

            <div class="breadcrumbs" id="breadcrumbs">
                <span class="breadcrumb-item active">My Files</span>
            </div>

            <div class="content-area" id="contentArea">
                <div id="filesView">
                    <div class="section-header">
                        <h2>Folders</h2>
                        <div class="view-toggles">
                            <button class="icon-btn active" id="viewGrid" title="Grid"><i class="ph-fill ph-squares-four"></i></button>
                            <button class="icon-btn" id="viewList" title="List"><i class="ph-fill ph-list-dashes"></i></button>
                        </div>
                    </div>
                    <div class="grid-container" id="foldersContainer"></div>

                    <div class="section-header mt-8">
                        <h2>Files</h2>
                    </div>
                    <div class="grid-container" id="filesContainer"></div>
                </div>

                <div id="linksView" class="links-view" style="display:none;">
                    <section class="links-hero">
                        <div class="links-hero-copy">
                            <span class="links-eyebrow">Interactive Link Storage</span>
                            <h2>Save important websites alongside your documents</h2>
                            <p>Collect references, dashboards, and research links in one searchable place.</p>
                        </div>
                        <div class="links-hero-art" aria-hidden="true">
                            <div class="hero-orb hero-orb-one"></div>
                            <div class="hero-orb hero-orb-two"></div>
                            <div class="hero-card hero-card-back"></div>
                            <div class="hero-card hero-card-front">
                                <div class="hero-link-glyph">
                                    <i class="ph-bold ph-link"></i>
                                </div>
                            </div>
                            <i class="ph-thin ph-globe hero-globe"></i>
                        </div>
                        <button class="btn-primary" id="heroAddLinkBtn">
                            <i class="ph-fill ph-link-plus"></i> Add Link
                        </button>
                    </section>


                    <section id="linksSection">
                        <div class="section-header">
                            <h2>Your Links</h2>
                        </div>
                        <div class="links-container" id="linksContainer"></div>
                    </section>
                </div>
            </div>
        </main>
    </div>

    <!-- =================== MODALS =================== -->

    <!-- Create Folder -->
    <div class="modal-overlay" id="createFolderModal">
        <div class="modal glass-panel">
            <button class="close-modal" id="closeNameModal"><i class="ph-bold ph-x"></i></button>
            <h3><i class="ph-fill ph-folder-plus" style="color:var(--folder-color);margin-right:10px"></i>New Folder</h3>
            <div class="input-group">
                <input type="text" id="folderNameInput" placeholder="Enter folder name..." autocomplete="off">
            </div>
            <div class="modal-footer">
                <button class="btn-secondary" id="cancelFolderBtn">Cancel</button>
                <button class="btn-primary" id="confirmFolderBtn">Create</button>
            </div>
        </div>
    </div>

    <!-- Delete Confirmation -->
    <div class="modal-overlay" id="deleteModal">
        <div class="modal glass-panel" style="max-width:360px">
            <button class="close-modal" id="closeDeleteModal"><i class="ph-bold ph-x"></i></button>
            <div class="delete-icon-wrap"><i class="ph-fill ph-warning"></i></div>
            <p style="text-align:center; margin-bottom:20px; font-size:15px; color:var(--text-main);">
                Are you sure you want to delete <strong>this item</strong>?
            </p>
            <div class="modal-footer" style="justify-content:center;gap:16px">
                <button class="btn-secondary" id="cancelDeleteBtn">Cancel</button>
                <button class="btn-danger" id="confirmDeleteBtn"><i class="ph-fill ph-trash"></i> Delete</button>
            </div>
        </div>
    </div>

    <!-- Rename Modal -->
    <div class="modal-overlay" id="renameModal">
        <div class="modal glass-panel" style="max-width:400px">
            <button class="close-modal" id="closeRenameModal"><i class="ph-bold ph-x"></i></button>
            <h3><i class="ph-fill ph-pencil-simple" style="color:var(--primary-color)"></i> Rename File</h3>
            <div class="input-group">
                <label class="input-label">New Name</label>
                <input type="text" id="renameInput" placeholder="Enter new name..." autocomplete="off">
            </div>
            <div class="modal-footer">
                <button class="btn-secondary" id="cancelRenameBtn">Cancel</button>
                <button class="btn-primary" id="confirmRenameBtn"><i class="ph-fill ph-check"></i> Rename</button>
            </div>
        </div>
    </div>

    <!-- Add Link Modal -->
    <div class="modal-overlay" id="addLinkModal">
        <div class="modal glass-panel" style="max-width:500px">
            <button class="close-modal" id="closeAddLinkModal"><i class="ph-bold ph-x"></i></button>
            <h3 id="addLinkModalTitle"><i class="ph-fill ph-link-plus" style="color:var(--primary-color);margin-right:10px"></i>Add Link</h3>
            <div class="input-group">
                <label class="input-label">URL *</label>
                <input type="url" id="linkUrlInput" placeholder="https://example.com" autocomplete="off">
                <p class="input-help">You can paste `hf.com` or a full `https://...` link.</p>
            </div>
            <div class="input-group">
                <label class="input-label">Title</label>
                <input type="text" id="linkTitleInput" placeholder="Link title..." autocomplete="off">
            </div>
            <div class="input-group">
                <label class="input-label">Description</label>
                <textarea id="linkDescriptionInput" placeholder="Add notes about this link..." rows="3"></textarea>
            </div>
            <div class="link-preview-panel" id="linkPreviewPanel">
                <div class="link-preview-icon">
                    <i class="ph-fill ph-globe"></i>
                </div>
                <div class="link-preview-content">
                    <strong id="linkPreviewTitle">Website preview</strong>
                    <span id="linkPreviewUrl">A normalized URL preview will appear here.</span>
                </div>
            </div>
            <div class="modal-footer">
                <span class="shortcut-hint">Ctrl/Cmd + Enter to save</span>
                <button class="btn-secondary" id="cancelLinkBtn">Cancel</button>
                <button class="btn-primary" id="confirmLinkBtn"><i class="ph-fill ph-check"></i> Save Link</button>
            </div>
        </div>
    </div>



    <!-- Preview Modal -->
    <div class="modal-overlay" id="previewModal">
        <div class="modal glass-panel" style="max-width:900px; width:95%; height:85vh; display:flex; flex-direction:column; padding:0; overflow:hidden">
            <div class="preview-header">
                <div class="preview-title">
                    <i class="ph-fill ph-file preview-icon"></i>
                    <span id="previewFileName">filename.pdf</span>
                </div>
                <div style="display:flex; gap:12px">
                    <button class="icon-btn" id="renameFromPreview" title="Rename"><i class="ph-bold ph-pencil-simple"></i></button>
                    <button class="icon-btn" id="downloadFromPreview" title="Download"><i class="ph-bold ph-download-simple"></i></button>
                    <button class="close-modal" id="closePreviewModal" style="position:static"><i class="ph-bold ph-x"></i></button>
                </div>
            </div>
            <div class="preview-body" id="previewBody">
                <div class="loading-state"><div class="spinner"></div><p>Loading preview...</p></div>
            </div>
        </div>
    </div>

    <!-- Version History Modal -->
    <div class="modal-overlay" id="historyModal">
        <div class="modal glass-panel" style="max-width:500px; width:90%">
            <button class="close-modal" id="closeHistoryModal"><i class="ph-bold ph-x"></i></button>
            <h3><i class="ph-fill ph-clock-counter-clockwise" style="color:var(--primary-color)"></i> Version History</h3>
            <p id="historyFileName" style="margin-bottom:20px; color:var(--text-muted); font-size:14px">filename.pdf</p>
            <div class="history-list" id="historyList" style="max-height: 400px; overflow-y: auto;">
                <div class="loading-state-sm"><div class="spinner-sm"></div><p>Fetching history...</p></div>
            </div>
        </div>
    </div>

    <script>
        window.__DOCVAULT_REMOTE_API_BASE__ = 'https://mohsin-devs-docvault.hf.space/api';
    </script>
    <script type="module" src="js/main.js?v=9"></script>
</body>
</html>