-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
220 lines (200 loc) · 11.4 KB
/
index.html
File metadata and controls
220 lines (200 loc) · 11.4 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CodeToContext - Codebase to Prompt Converter</title>
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="logo.ico">
<link rel="shortcut icon" type="image/x-icon" href="logo.ico">
<link rel="apple-touch-icon" href="logo.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="app-container">
<!-- HEADER -->
<header class="app-header">
<div class="header-left">
<button class="btn-toggle-sidebar" id="toggleSidebar" title="Toggle Sidebar (Ctrl+B)">
<span class="material-symbols-outlined">menu</span>
</button>
<div class="header-title">
<img src="logo.png" alt="CodeToContext Logo" class="app-logo">
<span>CodeToContext</span>
</div>
</div>
<div class="header-right">
<button class="btn-generate" id="pybutton" onclick="downloadPythonScript()">
<i class="fa-brands fa-python"></i>
Python CODE
</button>
<div class="sidebar-select">
<button class="btn-generate" id="docsbutton" onclick="window.location.href='help.html'">
<span class="material-symbols-outlined">description</span>
Docs
</button>
</div>
<a href="https://github.com/Ashjha75/CocdeToContext" target="_blank" class="btn-icon" title="GitHub">
<i class="fa-brands fa-github"></i>
</a>
</div>
</header>
<!-- MAIN CONTAINER -->
<div class="main-container">
<!-- SIDEBAR -->
<aside class="sidebar" id="sidebar">
<div class="sidebar-header">
<h3>EXPLORER</h3>
<div class="sidebar-actions">
<button class="btn-icon-small" id="expandAll" title="Expand All">
<img src="public/expandall.svg" alt="Expand All" class="toolbar-icon" />
</button>
<button class="btn-icon-small" id="collapseAll" title="Collapse All">
<img src="public/collapseAll.svg" alt="Collapse All" class="toolbar-icon" />
</button>
<button class="btn-icon-small" id="selectAll" title="Select All">
<img src="public/checkedBox.svg" alt="Select All" class="toolbar-icon" />
</button>
<button class="btn-icon-small" id="deselectAll" title="Deselect All">
<img src="public/uncheckedbox.svg" alt="Deselect All" class="toolbar-icon" />
</button>
<button class="btn-icon-small" id="clearAll" title="Clear All">
<img src="public/delete.svg" alt="Clear All" class="toolbar-icon" />
</button>
</div>
</div>
<div class="search-box">
<div class="search-field">
<span class="material-symbols-outlined">search</span>
<input type="text" id="fileSearch" placeholder="Search files or folders" class="search-input" autocomplete="off">
<button type="button" class="search-clear" id="searchClear" aria-label="Clear search">×</button>
</div>
<small class="search-meta" id="searchMeta">Search file and folder names (case-insensitive)</small>
</div>
<div class="sidebar-select">
<button class="btn-select-dir" id="selectDirBtn">
<img src="public/folder.svg" alt="Select Directory" class="sidebar-btn-icon" />
Select Directory
</button>
</div>
<div class="sidebar-select">
<button class="btn-generate" id="generateContextBtn">
<img src="public/contexticon.svg" alt="Context" class="sidebar-btn-icon" />
Create Context
</button>
</div>
<div class="file-tree" id="fileTree">
<div class="empty-state">
<span class="material-symbols-outlined">folder_off</span>
<p>No folder selected</p>
<small>Click "Select Directory" to get started</small>
</div>
</div>
</aside>
<div class="sidebar-resizer" id="sidebarResizer" role="separator" aria-orientation="vertical" title="Drag to resize sidebar"></div>
<!-- CONTENT AREA -->
<div class="content-area">
<!-- TAB BAR -->
<div class="tab-bar">
<div class="tab active" data-file="context">
<span class="material-symbols-outlined">description</span>
<span class="tab-name">Context Output</span>
</div>
</div>
<!-- EDITOR -->
<div class="editor-container">
<div class="editor-header">
<div class="editor-info">
<span class="info-item">
<span class="material-symbols-outlined">description</span>
Files: <strong id="fileCount">0</strong>
</span>
<span class="separator">•</span>
<span class="info-item">
<span class="material-symbols-outlined">memory</span>
Estimated Tokens: <strong id="tokenCount">0</strong>
</span>
<span class="separator">•</span>
<span class="info-item">
<span class="material-symbols-outlined">storage</span>
Size: <strong id="totalSize">0 B</strong>
</span>
<span class="separator">•</span>
<span class="info-item">
<span class="material-symbols-outlined">code</span>
<strong id="languagesList">-</strong>
</span>
<span class="separator">•</span>
<span class="info-item">
<div class="model-logos" id="modelLogos" aria-hidden="true">
<img src="public/gemini.png" alt="Gemini" data-model="gemini" class="model-logo" />
<img src="public/gpt.png" alt="GPT" data-model="gpt" class="model-logo" />
<img src="public/claude.png" alt="Claude" data-model="claude" class="model-logo" />
</div>
<select id="modelSelector" title="Choose AI model format - optimizes output structure for each AI">
<option value="gemini" title="Hybrid format with metadata">Gemini (Hybrid)</option>
<option value="gpt" title="Markdown format with clear code blocks">GPT-4 (Markdown)</option>
<option value="claude" title="XML format with structured context">Claude (XML)</option>
</select>
</span>
</div>
<div class="editor-actions">
<button class="btn-action" id="copyBtn" title="Copy to Clipboard">
<span class="material-symbols-outlined">content_copy</span>
</button>
<button class="btn-action" id="downloadTxtBtn" title="Download TXT">
<span class="material-symbols-outlined">download</span>
</button>
</div>
</div>
<div class="editor-content">
<div class="drag-drop-zone-main" id="dragDropZone">
<div class="drag-drop-content-main">
<span class="material-symbols-outlined drag-drop-icon-main">folder_open</span>
<h2>Drag & Drop Your Project Folder Here</h2>
<p>or click "Select Directory" in the sidebar</p>
<div class="drag-drop-hint">
<span class="material-symbols-outlined">info</span>
<span>Drop your entire project folder to get started</span>
</div>
</div>
<div class="drag-drop-overlay-main" id="dragDropOverlay">
<span class="material-symbols-outlined drag-drop-icon-large-main">cloud_upload</span>
<h2>Drop Your Folder Now</h2>
<p>Release to load files</p>
</div>
</div>
<div class="code-editor" id="codeEditor" style="display: none;">
<div class="editor-placeholder">
<span class="material-symbols-outlined">code_blocks</span>
<p>Your generated context will appear here</p>
<small>Select files and click "Create Context" button</small>
</div>
</div>
</div>
<div class="stats-panel">
<div class="stat-item">
<span class="stat-label">
<span class="material-symbols-outlined">calculate</span>
Estimated Tokens in Words:
</span>
<span class="stat-value" id="tokenPronunciation">zero tokens</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- LOADING OVERLAY -->
<div class="loading-overlay" id="loadingOverlay">
<div class="spinner"></div>
<p id="loadingText">Processing files...</p>
</div>
<!-- TOAST NOTIFICATIONS -->
<div class="toast-container" id="toastContainer"></div>
<script src="index.js"></script>
</body>
</html>