AmitJ82 commited on
Commit
cfb4511
·
verified ·
1 Parent(s): 63912e9

Put a paste button also near the clear text button - Follow Up Deployment

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +171 -19
  3. prompts.txt +2 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Simple Text Notes Downloader
3
- emoji: 🌖
4
- colorFrom: gray
5
- colorTo: blue
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: simple-text-notes-downloader
3
+ emoji: 🐳
4
+ colorFrom: purple
5
+ colorTo: yellow
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,171 @@
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 to TXT Downloader</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .text-area {
11
+ min-height: 300px;
12
+ transition: all 0.3s ease;
13
+ }
14
+ .text-area:focus {
15
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
16
+ }
17
+ .download-btn {
18
+ transition: all 0.2s ease;
19
+ }
20
+ .download-btn:hover {
21
+ transform: translateY(-2px);
22
+ }
23
+ .download-btn:active {
24
+ transform: translateY(0);
25
+ }
26
+ </style>
27
+ </head>
28
+ <body class="bg-gradient-to-br from-blue-50 to-gray-100 min-h-screen">
29
+ <div class="container mx-auto px-4 py-12">
30
+ <div class="max-w-3xl mx-auto">
31
+ <!-- Header -->
32
+ <div class="text-center mb-10">
33
+ <h1 class="text-4xl font-bold text-gray-800 mb-2">TEXT to TXT</h1>
34
+ <p class="text-gray-600 text-lg">Paste your text below and download it as a .txt file</p>
35
+ </div>
36
+
37
+ <!-- Main Card -->
38
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden">
39
+ <!-- Text area -->
40
+ <div class="p-6">
41
+ <div class="mb-4">
42
+ <label for="textInput" class="block text-gray-700 text-sm font-medium mb-2">
43
+ Your Text (Character count: <span id="charCount">0</span>)
44
+ </label>
45
+ <textarea
46
+ id="textInput"
47
+ class="text-area w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:border-blue-500"
48
+ placeholder="Start typing or paste your text here..."
49
+ ></textarea>
50
+ </div>
51
+
52
+ <div class="flex flex-col sm:flex-row items-center justify-between gap-4">
53
+ <div class="flex items-center gap-2">
54
+ <button id="pasteBtn" class="px-4 py-2 bg-gray-200 hover:bg-gray-300 text-gray-700 rounded-lg transition-colors">
55
+ <i class="fas fa-paste mr-2"></i> Paste
56
+ </button>
57
+ <button id="clearBtn" class="px-4 py-2 bg-gray-200 hover:bg-gray-300 text-gray-700 rounded-lg transition-colors">
58
+ <i class="fas fa-trash mr-2"></i> Clear Text
59
+ </button>
60
+ </div>
61
+
62
+ <button id="downloadBtn" class="download-btn px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg shadow-md flex items-center gap-2">
63
+ <i class="fas fa-download"></i>
64
+ Download as TXT
65
+ </button>
66
+ </div>
67
+ </div>
68
+
69
+ <!-- Features Section -->
70
+ <div class="bg-gray-50 px-6 py-4 border-t border-gray-200">
71
+ <h3 class="font-medium text-gray-700 mb-2">Features:</h3>
72
+ <ul class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-2 text-sm text-gray-600">
73
+ <li class="flex items-center gap-2">
74
+ <i class="fas fa-check text-green-500"></i> Unlimited text length
75
+ </li>
76
+ <li class="flex items-center gap-2">
77
+ <i class="fas fa-check text-green-500"></i> Simple interface
78
+ </li>
79
+ <li class="flex items-center gap-2">
80
+ <i class="fas fa-check text-green-500"></i> Fast downloading
81
+ </li>
82
+ <li class="flex items-center gap-2">
83
+ <i class="fas fa-check text-green-500"></i> Cross-platform
84
+ </li>
85
+ <li class="flex items-center gap-2">
86
+ <i class="fas fa-check text-green-500"></i> No data collection
87
+ </li>
88
+ <li class="flex items-center gap-2">
89
+ <i class="fas fa-check text-green-500"></i> Works offline
90
+ </li>
91
+ </ul>
92
+ </div>
93
+ </div>
94
+
95
+ <!-- Footer -->
96
+ <div class="text-center mt-8 text-gray-500 text-sm">
97
+ <p>Created with <i class="fas fa-heart text-red-500"></i> - All data stays on your device</p>
98
+ </div>
99
+ </div>
100
+ </div>
101
+
102
+ <script>
103
+ document.addEventListener('DOMContentLoaded', function() {
104
+ const textInput = document.getElementById('textInput');
105
+ const downloadBtn = document.getElementById('downloadBtn');
106
+ const clearBtn = document.getElementById('clearBtn');
107
+ const pasteBtn = document.getElementById('pasteBtn');
108
+ const charCount = document.getElementById('charCount');
109
+
110
+ // Handle paste from clipboard
111
+ pasteBtn.addEventListener('click', async function() {
112
+ try {
113
+ const text = await navigator.clipboard.readText();
114
+ textInput.value = text;
115
+ charCount.textContent = text.length;
116
+ } catch (err) {
117
+ alert('Failed to read clipboard. Make sure you have granted clipboard permissions.');
118
+ }
119
+ });
120
+
121
+ // Update character count
122
+ textInput.addEventListener('input', function() {
123
+ charCount.textContent = textInput.value.length;
124
+ });
125
+
126
+ // Download as TXT file
127
+ downloadBtn.addEventListener('click', function() {
128
+ const text = textInput.value.trim();
129
+
130
+ if (!text) {
131
+ alert('Please enter some text to download.');
132
+ return;
133
+ }
134
+
135
+ const blob = new Blob([text], { type: 'text/plain' });
136
+ const url = URL.createObjectURL(blob);
137
+ const a = document.createElement('a');
138
+ a.href = url;
139
+
140
+ // Generate filename with current date and time
141
+ const now = new Date();
142
+ const formattedDate = `${now.getFullYear()}-${(now.getMonth()+1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')}_${now.getHours().toString().padStart(2, '0')}-${now.getMinutes().toString().padStart(2, '0')}`;
143
+ a.download = `text_file_${formattedDate}.txt`;
144
+
145
+ document.body.appendChild(a);
146
+ a.click();
147
+ document.body.removeChild(a);
148
+ URL.revokeObjectURL(url);
149
+
150
+ // Animation feedback
151
+ downloadBtn.innerHTML = '<i class="fas fa-check-circle mr-2"></i> Downloaded!';
152
+ downloadBtn.classList.remove('bg-blue-600', 'hover:bg-blue-700');
153
+ downloadBtn.classList.add('bg-green-600', 'hover:bg-green-700');
154
+
155
+ setTimeout(() => {
156
+ downloadBtn.innerHTML = '<i class="fas fa-download mr-2"></i> Download as TXT';
157
+ downloadBtn.classList.remove('bg-green-600', 'hover:bg-green-700');
158
+ downloadBtn.classList.add('bg-blue-600', 'hover:bg-blue-700');
159
+ }, 2000);
160
+ });
161
+
162
+ // Clear text
163
+ clearBtn.addEventListener('click', function() {
164
+ textInput.value = '';
165
+ charCount.textContent = '0';
166
+ textInput.focus();
167
+ });
168
+ });
169
+ </script>
170
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=AmitJ82/simple-text-notes-downloader" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
171
+ </html>
prompts.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ Make a simple website where user can paste unlimited number of characters words in the textbox area and then click on download button to download that file in txt format, simple
2
+ Put a paste button also near the clear text button