broadfield-dev commited on
Commit
6404285
·
verified ·
1 Parent(s): ed84d3d

Update html_template.html

Browse files
Files changed (1) hide show
  1. html_template.html +180 -27
html_template.html CHANGED
@@ -6,38 +6,139 @@
6
  <style>
7
  body {
8
  font-family: 'Roboto', sans-serif;
9
- background: linear-gradient(to bottom right, #f0f4f8, #d9e2ec);
10
  margin: 0;
11
  padding: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  }
 
 
13
  .container {
14
  max-width: 1200px;
15
  margin: 20px auto;
16
  padding: 20px;
 
17
  }
18
  .input-section, .markdown-section, .preview-section {
19
- background: white;
20
  border-radius: 10px;
21
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
22
  padding: 20px;
23
  margin-bottom: 20px;
 
24
  }
25
  input[type="text"], input[type="file"] {
26
  width: 100%;
27
  padding: 10px;
28
  margin: 10px 0;
29
- border: 1px solid #ccc;
30
  border-radius: 5px;
31
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
32
  transition: border-color 0.3s;
33
  }
34
- input[type="text"]:focus, input[type="file"]:focus {
35
- border-color: #4CAF50;
36
- outline: none;
37
- }
38
  button {
39
  padding: 10px 20px;
40
- background: linear-gradient(to right, #4CAF50, #45a049);
41
  color: white;
42
  border: none;
43
  border-radius: 5px;
@@ -45,22 +146,11 @@
45
  margin: 5px;
46
  transition: background 0.3s, transform 0.1s;
47
  }
48
- button:hover {
49
- background: linear-gradient(to right, #45a049, #4CAF50);
50
- }
51
  button:active {
52
  transform: scale(0.98);
53
  }
54
- #downloadBtn {
55
- background: linear-gradient(to right, #3498db, #2980b9);
56
- }
57
- #downloadBtn:hover {
58
- background: linear-gradient(to right, #2980b9, #3498db);
59
- }
60
  .spinner {
61
  display: none;
62
- border: 4px solid #f3f3f3;
63
- border-top: 4px solid #3498db;
64
  border-radius: 50%;
65
  width: 30px;
66
  height: 30px;
@@ -85,28 +175,25 @@
85
  height: 400px;
86
  margin-top: 10px;
87
  padding: 10px;
88
- border: 1px solid #ccc;
89
  border-radius: 5px;
90
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
91
  font-family: monospace;
92
  resize: vertical;
 
93
  }
94
  #output {
95
  margin-top: 10px;
96
  padding: 10px;
97
  max-height: 600px;
98
  overflow-y: auto;
99
- }
100
- #output h1, #output h2, #output h3 {
101
- color: #333;
102
  }
103
  #output code {
104
- background: #f4f4f4;
105
  padding: 2px 4px;
106
  border-radius: 3px;
107
  }
108
  #output pre {
109
- background: #f4f4f4;
110
  padding: 10px;
111
  border-radius: 5px;
112
  overflow-x: auto;
@@ -118,10 +205,69 @@
118
  from { opacity: 0; }
119
  to { opacity: 1; }
120
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  </style>
122
  </head>
123
- <body>
124
  <div class="container">
 
 
 
 
 
 
 
125
  <div class="input-section">
126
  <h1>Repository & Files to Markdown Converter</h1>
127
  <p>Enter a GitHub/Hugging Face Space URL (e.g., https://huggingface.co/spaces/username/space)</p>
@@ -149,6 +295,13 @@
149
  let currentMarkdown = '';
150
  let currentFilename = '';
151
 
 
 
 
 
 
 
 
152
  async function processRepo() {
153
  const repoUrl = document.getElementById('repoUrl').value;
154
  await processContent('/process', { repo_url: repoUrl });
 
6
  <style>
7
  body {
8
  font-family: 'Roboto', sans-serif;
 
9
  margin: 0;
10
  padding: 0;
11
+ transition: background 0.3s, color 0.3s;
12
+ }
13
+ /* Dark Mode (Default) */
14
+ body.dark-mode {
15
+ background: linear-gradient(to bottom right, #2C3E50, #34495E);
16
+ color: #ECF0F1;
17
+ }
18
+ body.dark-mode .input-section,
19
+ body.dark-mode .markdown-section,
20
+ body.dark-mode .preview-section {
21
+ background: #34495E;
22
+ box-shadow: 0 4px 6px rgba(93, 64, 55, 0.2);
23
+ }
24
+ body.dark-mode input[type="text"],
25
+ body.dark-mode input[type="file"] {
26
+ background: #3E5C76;
27
+ color: #ECF0F1;
28
+ border: 1px solid #4A6FA5;
29
+ }
30
+ body.dark-mode input[type="text"]:focus,
31
+ body.dark-mode input[type="file"]:focus {
32
+ border-color: #8D5524;
33
+ }
34
+ body.dark-mode button {
35
+ background: linear-gradient(to right, #2980B9, #7F8C8D);
36
+ }
37
+ body.dark-mode button:hover {
38
+ background: linear-gradient(to right, #7F8C8D, #2980B9);
39
+ }
40
+ body.dark-mode #downloadBtn {
41
+ background: linear-gradient(to right, #5D4037, #7F8C8D);
42
+ }
43
+ body.dark-mode #downloadBtn:hover {
44
+ background: linear-gradient(to right, #7F8C8D, #5D4037);
45
+ }
46
+ body.dark-mode textarea {
47
+ background: #3E5C76;
48
+ color: #ECF0F1;
49
+ border: 1px solid #4A6FA5;
50
+ }
51
+ body.dark-mode #output {
52
+ background: #3E5C76;
53
+ }
54
+ body.dark-mode #output h1, body.dark-mode #output h2, body.dark-mode #output h3 {
55
+ color: #FFFFFF;
56
+ }
57
+ body.dark-mode #output code,
58
+ body.dark-mode #output pre {
59
+ background: #2C3E50;
60
+ }
61
+ body.dark-mode .spinner {
62
+ border: 4px solid #34495E;
63
+ border-top: 4px solid #ECF0F1;
64
+ }
65
+
66
+ /* Light Mode */
67
+ body.light-mode {
68
+ background: linear-gradient(to bottom right, #f0f4f8, #d9e2ec);
69
+ color: #333;
70
+ }
71
+ body.light-mode .input-section,
72
+ body.light-mode .markdown-section,
73
+ body.light-mode .preview-section {
74
+ background: white;
75
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
76
+ }
77
+ body.light-mode input[type="text"],
78
+ body.light-mode input[type="file"] {
79
+ background: white;
80
+ color: #333;
81
+ border: 1px solid #ccc;
82
+ }
83
+ body.light-mode input[type="text"]:focus,
84
+ body.light-mode input[type="file"]:focus {
85
+ border-color: #4CAF50;
86
+ }
87
+ body.light-mode button {
88
+ background: linear-gradient(to right, #4CAF50, #45a049);
89
+ }
90
+ body.light-mode button:hover {
91
+ background: linear-gradient(to right, #45a049, #4CAF50);
92
+ }
93
+ body.light-mode #downloadBtn {
94
+ background: linear-gradient(to right, #3498db, #2980b9);
95
+ }
96
+ body.light-mode #downloadBtn:hover {
97
+ background: linear-gradient(to right, #2980b9, #3498db);
98
+ }
99
+ body.light-mode textarea {
100
+ background: white;
101
+ color: #333;
102
+ border: 1px solid #ccc;
103
+ }
104
+ body.light-mode #output {
105
+ background: white;
106
+ }
107
+ body.light-mode #output h1, body.light-mode #output h2, body.light-mode #output h3 {
108
+ color: #333;
109
+ }
110
+ body.light-mode #output code,
111
+ body.light-mode #output pre {
112
+ background: #f4f4f4;
113
+ }
114
+ body.light-mode .spinner {
115
+ border: 4px solid #f3f3f3;
116
+ border-top: 4px solid #3498db;
117
  }
118
+
119
+ /* Common Styles */
120
  .container {
121
  max-width: 1200px;
122
  margin: 20px auto;
123
  padding: 20px;
124
+ position: relative;
125
  }
126
  .input-section, .markdown-section, .preview-section {
 
127
  border-radius: 10px;
 
128
  padding: 20px;
129
  margin-bottom: 20px;
130
+ transition: background 0.3s, box-shadow 0.3s;
131
  }
132
  input[type="text"], input[type="file"] {
133
  width: 100%;
134
  padding: 10px;
135
  margin: 10px 0;
 
136
  border-radius: 5px;
137
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
138
  transition: border-color 0.3s;
139
  }
 
 
 
 
140
  button {
141
  padding: 10px 20px;
 
142
  color: white;
143
  border: none;
144
  border-radius: 5px;
 
146
  margin: 5px;
147
  transition: background 0.3s, transform 0.1s;
148
  }
 
 
 
149
  button:active {
150
  transform: scale(0.98);
151
  }
 
 
 
 
 
 
152
  .spinner {
153
  display: none;
 
 
154
  border-radius: 50%;
155
  width: 30px;
156
  height: 30px;
 
175
  height: 400px;
176
  margin-top: 10px;
177
  padding: 10px;
 
178
  border-radius: 5px;
179
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
180
  font-family: monospace;
181
  resize: vertical;
182
+ transition: background 0.3s, color 0.3s, border 0.3s;
183
  }
184
  #output {
185
  margin-top: 10px;
186
  padding: 10px;
187
  max-height: 600px;
188
  overflow-y: auto;
189
+ border-radius: 5px;
190
+ transition: background 0.3s;
 
191
  }
192
  #output code {
 
193
  padding: 2px 4px;
194
  border-radius: 3px;
195
  }
196
  #output pre {
 
197
  padding: 10px;
198
  border-radius: 5px;
199
  overflow-x: auto;
 
205
  from { opacity: 0; }
206
  to { opacity: 1; }
207
  }
208
+
209
+ /* Toggle Switch */
210
+ .mode-toggle {
211
+ position: absolute;
212
+ top: 20px;
213
+ right: 20px;
214
+ display: flex;
215
+ align-items: center;
216
+ }
217
+ .mode-toggle label {
218
+ margin-left: 10px;
219
+ font-size: 14px;
220
+ }
221
+ .switch {
222
+ position: relative;
223
+ display: inline-block;
224
+ width: 50px;
225
+ height: 24px;
226
+ }
227
+ .switch input {
228
+ opacity: 0;
229
+ width: 0;
230
+ height: 0;
231
+ }
232
+ .slider {
233
+ position: absolute;
234
+ cursor: pointer;
235
+ top: 0;
236
+ left: 0;
237
+ right: 0;
238
+ bottom: 0;
239
+ background: #7F8C8D;
240
+ transition: 0.3s;
241
+ border-radius: 24px;
242
+ }
243
+ .slider:before {
244
+ position: absolute;
245
+ content: "";
246
+ height: 18px;
247
+ width: 18px;
248
+ left: 3px;
249
+ bottom: 3px;
250
+ background: #ECF0F1;
251
+ transition: 0.3s;
252
+ border-radius: 50%;
253
+ }
254
+ input:checked + .slider {
255
+ background: #4CAF50;
256
+ }
257
+ input:checked + .slider:before {
258
+ transform: translateX(26px);
259
+ }
260
  </style>
261
  </head>
262
+ <body class="dark-mode">
263
  <div class="container">
264
+ <div class="mode-toggle">
265
+ <label class="switch">
266
+ <input type="checkbox" id="modeToggle" onchange="toggleMode()">
267
+ <span class="slider"></span>
268
+ </label>
269
+ <label for="modeToggle">Light Mode</label>
270
+ </div>
271
  <div class="input-section">
272
  <h1>Repository & Files to Markdown Converter</h1>
273
  <p>Enter a GitHub/Hugging Face Space URL (e.g., https://huggingface.co/spaces/username/space)</p>
 
295
  let currentMarkdown = '';
296
  let currentFilename = '';
297
 
298
+ function toggleMode() {
299
+ const body = document.body;
300
+ const toggle = document.getElementById('modeToggle');
301
+ body.classList.toggle('dark-mode', !toggle.checked);
302
+ body.classList.toggle('light-mode', toggle.checked);
303
+ }
304
+
305
  async function processRepo() {
306
  const repoUrl = document.getElementById('repoUrl').value;
307
  await processContent('/process', { repo_url: repoUrl });