MarkTheArtist commited on
Commit
9d4b0f9
·
verified ·
1 Parent(s): d73d609

undefined - Initial Deployment

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +351 -19
  3. prompts.txt +0 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Text Line Parser
3
- emoji: 🚀
4
- colorFrom: red
5
- colorTo: yellow
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: text-line-parser
3
+ emoji: 🐳
4
+ colorFrom: pink
5
+ colorTo: purple
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,351 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Text Line Copier</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ body {
15
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
16
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
17
+ min-height: 100vh;
18
+ padding: 20px;
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ }
23
+
24
+ .container {
25
+ background: rgba(255, 255, 255, 0.95);
26
+ backdrop-filter: blur(10px);
27
+ border-radius: 20px;
28
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
29
+ padding: 40px;
30
+ width: 100%;
31
+ max-width: 600px;
32
+ border: 1px solid rgba(255, 255, 255, 0.2);
33
+ }
34
+
35
+ h1 {
36
+ text-align: center;
37
+ color: #333;
38
+ margin-bottom: 30px;
39
+ font-size: 2.2em;
40
+ font-weight: 600;
41
+ background: linear-gradient(135deg, #667eea, #764ba2);
42
+ -webkit-background-clip: text;
43
+ -webkit-text-fill-color: transparent;
44
+ background-clip: text;
45
+ }
46
+
47
+ .input-section {
48
+ margin-bottom: 30px;
49
+ }
50
+
51
+ label {
52
+ display: block;
53
+ margin-bottom: 10px;
54
+ color: #555;
55
+ font-weight: 500;
56
+ font-size: 1.1em;
57
+ }
58
+
59
+ textarea {
60
+ width: 100%;
61
+ height: 200px;
62
+ padding: 15px;
63
+ border: 2px solid #e0e0e0;
64
+ border-radius: 12px;
65
+ font-size: 16px;
66
+ font-family: 'Courier New', monospace;
67
+ resize: vertical;
68
+ transition: all 0.3s ease;
69
+ background: #fafafa;
70
+ }
71
+
72
+ textarea:focus {
73
+ outline: none;
74
+ border-color: #667eea;
75
+ box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
76
+ background: white;
77
+ }
78
+
79
+ .control-section {
80
+ text-align: center;
81
+ margin-bottom: 20px;
82
+ }
83
+
84
+ .parse-btn {
85
+ background: linear-gradient(135deg, #667eea, #764ba2);
86
+ color: white;
87
+ border: none;
88
+ padding: 12px 30px;
89
+ border-radius: 10px;
90
+ font-size: 16px;
91
+ font-weight: 600;
92
+ cursor: pointer;
93
+ transition: all 0.3s ease;
94
+ margin-bottom: 20px;
95
+ }
96
+
97
+ .parse-btn:hover {
98
+ transform: translateY(-2px);
99
+ box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
100
+ }
101
+
102
+ .copy-section {
103
+ text-align: center;
104
+ margin-top: 20px;
105
+ }
106
+
107
+ .current-line {
108
+ background: #f8f9ff;
109
+ border: 2px solid #e0e8ff;
110
+ border-radius: 10px;
111
+ padding: 15px;
112
+ margin-bottom: 20px;
113
+ font-family: 'Courier New', monospace;
114
+ font-size: 16px;
115
+ min-height: 60px;
116
+ display: flex;
117
+ flex-direction: column;
118
+ justify-content: center;
119
+ align-items: flex-start;
120
+ color: #333;
121
+ word-break: break-word;
122
+ text-align: left;
123
+ }
124
+
125
+ .next-btn {
126
+ background: linear-gradient(135deg, #4CAF50, #45a049);
127
+ color: white;
128
+ border: none;
129
+ padding: 20px 50px;
130
+ border-radius: 15px;
131
+ font-size: 20px;
132
+ font-weight: bold;
133
+ cursor: pointer;
134
+ transition: all 0.3s ease;
135
+ text-transform: uppercase;
136
+ letter-spacing: 1px;
137
+ margin-bottom: 15px;
138
+ }
139
+
140
+ .next-btn:hover:not(:disabled) {
141
+ transform: translateY(-3px);
142
+ box-shadow: 0 10px 25px rgba(76, 175, 80, 0.4);
143
+ }
144
+
145
+ .next-btn:disabled {
146
+ background: #ccc;
147
+ cursor: not-allowed;
148
+ transform: none;
149
+ box-shadow: none;
150
+ }
151
+
152
+ .status {
153
+ margin-top: 15px;
154
+ font-size: 16px;
155
+ color: #666;
156
+ font-weight: 500;
157
+ }
158
+
159
+ .success {
160
+ color: #4CAF50;
161
+ }
162
+
163
+ .error {
164
+ color: #f44336;
165
+ }
166
+
167
+ .info {
168
+ background: #e3f2fd;
169
+ border: 1px solid #bbdefb;
170
+ border-radius: 8px;
171
+ padding: 15px;
172
+ margin-bottom: 20px;
173
+ color: #1976d2;
174
+ font-size: 14px;
175
+ }
176
+
177
+ .hidden {
178
+ display: none;
179
+ }
180
+
181
+ @media (max-width: 480px) {
182
+ .container {
183
+ padding: 20px;
184
+ margin: 10px;
185
+ }
186
+
187
+ h1 {
188
+ font-size: 1.8em;
189
+ }
190
+
191
+ .next-btn {
192
+ padding: 15px 35px;
193
+ font-size: 18px;
194
+ }
195
+ }
196
+ </style>
197
+ </head>
198
+ <body>
199
+ <div class="container">
200
+ <h1>📋 Text Line Copier</h1>
201
+
202
+ <div class="info">
203
+ Paste your text below, click "Parse Text", then use the "Next" button to copy each line to your clipboard. Blank lines are used as delimiters but are not copied.
204
+ </div>
205
+
206
+ <div class="input-section">
207
+ <label for="textInput">Paste your text here:</label>
208
+ <textarea id="textInput" placeholder="Paste your multi-line text here..."></textarea>
209
+ </div>
210
+
211
+ <div class="control-section">
212
+ <button class="parse-btn" onclick="parseText()">Parse Text</button>
213
+ </div>
214
+
215
+ <div id="copySection" class="copy-section hidden">
216
+ <div id="currentLine" class="current-line">Ready to copy first line...</div>
217
+ <button id="nextBtn" class="next-btn" onclick="copyNextLine()">Next</button>
218
+ <div id="status" class="status"></div>
219
+ </div>
220
+ </div>
221
+
222
+ <script>
223
+ let lines = [];
224
+ let currentIndex = -1;
225
+
226
+ function parseText() {
227
+ const text = document.getElementById('textInput').value;
228
+
229
+ if (!text) {
230
+ updateStatus('Please enter some text first.', 'error');
231
+ return;
232
+ }
233
+
234
+ // Split by lines and filter out blank lines
235
+ lines = text.split('\n').filter(line => line.trim() !== '');
236
+ currentIndex = 0; // Start at 0 to show first entry
237
+
238
+ if (lines.length === 0) {
239
+ updateStatus('No non-blank lines found in the text.', 'error');
240
+ return;
241
+ }
242
+
243
+ // Show copy section and display first line
244
+ document.getElementById('copySection').classList.remove('hidden');
245
+ document.getElementById('nextBtn').disabled = false;
246
+
247
+ // Copy the first line immediately after parsing
248
+ copyFirstLine();
249
+ }
250
+
251
+ async function copyFirstLine() {
252
+ const lineToCopy = lines[0];
253
+
254
+ try {
255
+ await navigator.clipboard.writeText(lineToCopy);
256
+
257
+ // Display with item count and text on separate lines, left-aligned and bold header
258
+ document.getElementById('currentLine').innerHTML = `<strong>Copied item 1 of ${lines.length}:</strong><br>${lineToCopy}`;
259
+ updateStatus(`Copied item 1 of ${lines.length}`, 'success');
260
+
261
+ // Show next line preview or completion message
262
+ if (lines.length > 1) {
263
+ // Don't change the display here, wait for next button
264
+ } else {
265
+ // If only one item, prepare for finish
266
+ setTimeout(() => {
267
+ document.getElementById('currentLine').textContent = 'Click Next to finish';
268
+ }, 1000);
269
+ }
270
+ } catch (err) {
271
+ updateStatus('Failed to copy to clipboard. Please try again.', 'error');
272
+ console.error('Copy failed:', err);
273
+ }
274
+ }
275
+
276
+ async function copyNextLine() {
277
+ currentIndex++;
278
+
279
+ if (currentIndex >= lines.length) {
280
+ document.getElementById('currentLine').textContent = 'No more text to copy';
281
+ document.getElementById('nextBtn').disabled = true;
282
+ updateStatus('Finished! Resetting form in 3 seconds...', 'info');
283
+
284
+ // Reset form after 3 seconds
285
+ setTimeout(() => {
286
+ resetForm();
287
+ }, 3000);
288
+ return;
289
+ }
290
+
291
+ const lineToCopy = lines[currentIndex];
292
+
293
+ try {
294
+ await navigator.clipboard.writeText(lineToCopy);
295
+
296
+ // Display with item count and text on separate lines, left-aligned and bold header
297
+ document.getElementById('currentLine').innerHTML = `<strong>Copied item ${currentIndex + 1} of ${lines.length}:</strong><br>${lineToCopy}`;
298
+ updateStatus(`Copied item ${currentIndex + 1} of ${lines.length}`, 'success');
299
+
300
+ // No preview of next line, just show current copied item
301
+ } catch (err) {
302
+ updateStatus('Failed to copy to clipboard. Please try again.', 'error');
303
+ console.error('Copy failed:', err);
304
+ }
305
+ }
306
+
307
+ function resetForm() {
308
+ // Clear the textarea
309
+ document.getElementById('textInput').value = '';
310
+
311
+ // Hide the copy section
312
+ document.getElementById('copySection').classList.add('hidden');
313
+
314
+ // Reset variables
315
+ lines = [];
316
+ currentIndex = -1;
317
+
318
+ // Clear status
319
+ document.getElementById('status').textContent = '';
320
+
321
+ // Reset current line display
322
+ document.getElementById('currentLine').textContent = 'Ready to copy first line...';
323
+
324
+ // Re-enable next button
325
+ document.getElementById('nextBtn').disabled = false;
326
+ }
327
+
328
+ function updateStatus(message, type) {
329
+ const statusEl = document.getElementById('status');
330
+ statusEl.textContent = message;
331
+ statusEl.className = `status ${type}`;
332
+ }
333
+
334
+ // Allow Enter key to parse text when in textarea
335
+ document.getElementById('textInput').addEventListener('keydown', function(e) {
336
+ if (e.ctrlKey && e.key === 'Enter') {
337
+ parseText();
338
+ }
339
+ });
340
+
341
+ // Allow spacebar or Enter to trigger next button
342
+ document.addEventListener('keydown', function(e) {
343
+ const nextBtn = document.getElementById('nextBtn');
344
+ if ((e.code === 'Space' || e.key === 'Enter') && !nextBtn.disabled && !nextBtn.classList.contains('hidden')) {
345
+ e.preventDefault();
346
+ copyNextLine();
347
+ }
348
+ });
349
+ </script>
350
+ </body>
351
+ </htmla
prompts.txt ADDED
File without changes