SoftDisquiet commited on
Commit
fcb260f
·
verified ·
1 Parent(s): 9cc41a4

undefined - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +159 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Fast Simple Txt
3
- emoji: 📉
4
- colorFrom: blue
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: fast-simple-txt
3
+ emoji: 🐳
4
+ colorFrom: gray
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,159 @@
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 File Saver</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
+ .gradient-bg {
11
+ background: linear-gradient(135deg, #6b73ff 0%, #000dff 100%);
12
+ }
13
+ .file-input-label:hover {
14
+ background-color: rgba(255, 255, 255, 0.1);
15
+ }
16
+ textarea {
17
+ min-height: 200px;
18
+ }
19
+ @media (max-width: 640px) {
20
+ textarea {
21
+ min-height: 150px;
22
+ }
23
+ }
24
+ </style>
25
+ </head>
26
+ <body class="gradient-bg min-h-screen flex items-center justify-center p-4">
27
+ <div class="w-full max-w-2xl bg-white rounded-xl shadow-2xl overflow-hidden">
28
+ <!-- Header -->
29
+ <div class="bg-indigo-600 text-white p-6">
30
+ <div class="flex items-center justify-between">
31
+ <div>
32
+ <h1 class="text-2xl font-bold">Text File Saver</h1>
33
+ <p class="text-indigo-100">Save your content to a .txt file</p>
34
+ </div>
35
+ <div class="text-4xl text-indigo-300">
36
+ <i class="fas fa-file-alt"></i>
37
+ </div>
38
+ </div>
39
+ </div>
40
+
41
+ <!-- Main Content -->
42
+ <div class="p-6">
43
+ <!-- File Name Input -->
44
+ <div class="mb-6">
45
+ <label for="filename" class="block text-gray-700 font-medium mb-2">File Name</label>
46
+ <div class="relative">
47
+ <input type="text" id="filename" placeholder="my-document"
48
+ class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500">
49
+ <div class="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-gray-500">
50
+ .txt
51
+ </div>
52
+ </div>
53
+ </div>
54
+
55
+ <!-- Content Textarea -->
56
+ <div class="mb-6">
57
+ <label for="content" class="block text-gray-700 font-medium mb-2">Content</label>
58
+ <textarea id="content"
59
+ class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-indigo-500"
60
+ placeholder="Type or paste your content here..."></textarea>
61
+ </div>
62
+
63
+ <!-- Buttons -->
64
+ <div class="flex flex-col sm:flex-row gap-4">
65
+ <button id="saveBtn"
66
+ class="flex-1 bg-indigo-600 hover:bg-indigo-700 text-white font-medium py-3 px-6 rounded-lg transition duration-200 flex items-center justify-center gap-2">
67
+ <i class="fas fa-save"></i> Save to File
68
+ </button>
69
+ <button id="clearBtn"
70
+ class="flex-1 bg-gray-200 hover:bg-gray-300 text-gray-800 font-medium py-3 px-6 rounded-lg transition duration-200 flex items-center justify-center gap-2">
71
+ <i class="fas fa-trash-alt"></i> Clear
72
+ </button>
73
+ </div>
74
+
75
+ <!-- Status Message -->
76
+ <div id="status" class="mt-6 hidden p-4 rounded-lg"></div>
77
+ </div>
78
+
79
+ <!-- Footer -->
80
+ <div class="bg-gray-50 px-6 py-4 text-center text-gray-500 text-sm">
81
+ <p>Your data remains private - files are saved directly to your device</p>
82
+ </div>
83
+ </div>
84
+
85
+ <script>
86
+ document.addEventListener('DOMContentLoaded', function() {
87
+ const filenameInput = document.getElementById('filename');
88
+ const contentInput = document.getElementById('content');
89
+ const saveBtn = document.getElementById('saveBtn');
90
+ const clearBtn = document.getElementById('clearBtn');
91
+ const statusDiv = document.getElementById('status');
92
+
93
+ // Save to file function
94
+ saveBtn.addEventListener('click', function() {
95
+ const filename = filenameInput.value.trim() || 'untitled';
96
+ const content = contentInput.value;
97
+
98
+ if (!content) {
99
+ showStatus('Please enter some content to save', 'error');
100
+ return;
101
+ }
102
+
103
+ // Create a Blob with the content
104
+ const blob = new Blob([content], { type: 'text/plain' });
105
+
106
+ // Create a download link
107
+ const url = URL.createObjectURL(blob);
108
+ const a = document.createElement('a');
109
+ a.href = url;
110
+ a.download = `${filename}.txt`;
111
+
112
+ // Trigger the download
113
+ document.body.appendChild(a);
114
+ a.click();
115
+
116
+ // Clean up
117
+ setTimeout(() => {
118
+ document.body.removeChild(a);
119
+ URL.revokeObjectURL(url);
120
+ }, 100);
121
+
122
+ showStatus('File saved successfully!', 'success');
123
+ });
124
+
125
+ // Clear inputs
126
+ clearBtn.addEventListener('click', function() {
127
+ filenameInput.value = '';
128
+ contentInput.value = '';
129
+ hideStatus();
130
+ });
131
+
132
+ // Show status message
133
+ function showStatus(message, type) {
134
+ statusDiv.textContent = message;
135
+ statusDiv.className = `mt-6 p-4 rounded-lg ${type === 'error' ? 'bg-red-100 text-red-800' : 'bg-green-100 text-green-800'}`;
136
+ statusDiv.classList.remove('hidden');
137
+
138
+ // Auto-hide after 5 seconds
139
+ setTimeout(hideStatus, 5000);
140
+ }
141
+
142
+ // Hide status message
143
+ function hideStatus() {
144
+ statusDiv.classList.add('hidden');
145
+ }
146
+
147
+ // Add animation to buttons on click
148
+ [saveBtn, clearBtn].forEach(btn => {
149
+ btn.addEventListener('click', function() {
150
+ this.classList.add('transform', 'scale-95');
151
+ setTimeout(() => {
152
+ this.classList.remove('transform', 'scale-95');
153
+ }, 150);
154
+ });
155
+ });
156
+ });
157
+ </script>
158
+ <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=SoftDisquiet/fast-simple-txt" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
159
+ </html>