ranemeo commited on
Commit
b0f709a
·
verified ·
1 Parent(s): c2e05f2

.generator-container { max-width: 500px; margin: 40px auto; padding: 20px; background: white; border-radius: 12px; box-shadow: 0 0 15px rgba(0,0,0,0.1); text-align: center; } #prompt-input { width: 100%; padding: 12px; margin-bottom: 12px; border: 1px solid #ccc; border-radius: 8px; resize: vertical; font-family: inherit; } #generate-btn { background-color: #6366f1; color: white; padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; } #generate-btn:hover { background-color: #4f46e5; } #result-container img { margin-top: 20px; max-width: 100%; border-radius: 8px; } - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +246 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Roro
3
- emoji: 🚀
4
  colorFrom: gray
5
- colorTo: pink
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: roro
3
+ emoji: 🐳
4
  colorFrom: gray
5
+ colorTo: blue
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,246 @@
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>AI Image Generator</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, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
12
+ }
13
+ .result-placeholder {
14
+ background: linear-gradient(45deg, #f3f4f6 25%, #e5e7eb 25%, #e5e7eb 50%, #f3f4f6 50%, #f3f4f6 75%, #e5e7eb 75%, #e5e7eb 100%);
15
+ background-size: 20px 20px;
16
+ }
17
+ .prompt-input:focus {
18
+ outline: none;
19
+ box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
20
+ }
21
+ .loading-spinner {
22
+ animation: spin 1s linear infinite;
23
+ }
24
+ @keyframes spin {
25
+ 0% { transform: rotate(0deg); }
26
+ 100% { transform: rotate(360deg); }
27
+ }
28
+ </style>
29
+ </head>
30
+ <body class="min-h-screen bg-gray-50">
31
+ <div class="container mx-auto px-4 py-8">
32
+ <div class="max-w-3xl mx-auto">
33
+ <!-- Header -->
34
+ <header class="text-center mb-10">
35
+ <h1 class="text-4xl font-bold text-gray-800 mb-2">AI Image Generator</h1>
36
+ <p class="text-gray-600">Transform your imagination into stunning visuals with AI</p>
37
+ </header>
38
+
39
+ <!-- Generator Card -->
40
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden transition-all duration-300 hover:shadow-xl">
41
+ <div class="gradient-bg p-4 text-white">
42
+ <h2 class="text-xl font-semibold flex items-center justify-center gap-2">
43
+ <i class="fas fa-magic"></i> Create Your Masterpiece
44
+ </h2>
45
+ </div>
46
+
47
+ <div class="p-6">
48
+ <!-- Prompt Input -->
49
+ <div class="mb-6">
50
+ <label for="prompt-input" class="block text-sm font-medium text-gray-700 mb-2">
51
+ Describe what you want to generate
52
+ </label>
53
+ <div class="relative">
54
+ <textarea
55
+ id="prompt-input"
56
+ rows="4"
57
+ class="w-full px-4 py-3 border border-gray-300 rounded-lg prompt-input focus:border-indigo-500 transition-all duration-200"
58
+ placeholder="A futuristic cityscape at sunset with flying cars and neon lights..."
59
+ ></textarea>
60
+ <div class="absolute bottom-3 right-3 text-gray-400 text-xs">
61
+ <span id="char-count">0</span>/200
62
+ </div>
63
+ </div>
64
+ </div>
65
+
66
+ <!-- Style Options -->
67
+ <div class="mb-6">
68
+ <label class="block text-sm font-medium text-gray-700 mb-2">Art Style</label>
69
+ <div class="grid grid-cols-2 sm:grid-cols-4 gap-3">
70
+ <button class="style-option bg-indigo-100 text-indigo-700 border-indigo-300" data-style="realistic">
71
+ <i class="fas fa-camera mr-2"></i> Realistic
72
+ </button>
73
+ <button class="style-option bg-pink-100 text-pink-700 border-pink-300" data-style="fantasy">
74
+ <i class="fas fa-dragon mr-2"></i> Fantasy
75
+ </button>
76
+ <button class="style-option bg-purple-100 text-purple-700 border-purple-300" data-style="anime">
77
+ <i class="fas fa-mask mr-2"></i> Anime
78
+ </button>
79
+ <button class="style-option bg-yellow-100 text-yellow-700 border-yellow-300" data-style="abstract">
80
+ <i class="fas fa-paint-brush mr-2"></i> Abstract
81
+ </button>
82
+ </div>
83
+ </div>
84
+
85
+ <!-- Generate Button -->
86
+ <div class="flex justify-center">
87
+ <button id="generate-btn" class="gradient-bg text-white px-8 py-3 rounded-lg font-medium flex items-center gap-2 transition-all duration-300 hover:opacity-90 hover:shadow-lg transform hover:-translate-y-1">
88
+ <i class="fas fa-sparkles"></i> Generate Image
89
+ </button>
90
+ </div>
91
+ </div>
92
+ </div>
93
+
94
+ <!-- Result Section -->
95
+ <div id="result-container" class="mt-10">
96
+ <div class="bg-white rounded-xl shadow-lg overflow-hidden">
97
+ <div class="gradient-bg p-4 text-white">
98
+ <h2 class="text-xl font-semibold flex items-center justify-center gap-2">
99
+ <i class="fas fa-image"></i> Your Generated Image
100
+ </h2>
101
+ </div>
102
+
103
+ <div class="p-6">
104
+ <!-- Placeholder/Result -->
105
+ <div id="result-content" class="result-placeholder rounded-lg flex items-center justify-center h-64 sm:h-96">
106
+ <div class="text-center text-gray-500">
107
+ <i class="fas fa-image fa-3x mb-3"></i>
108
+ <p>Your generated image will appear here</p>
109
+ </div>
110
+ </div>
111
+
112
+ <!-- Loading State -->
113
+ <div id="loading-state" class="hidden mt-6 text-center">
114
+ <div class="inline-block loading-spinner text-indigo-500 text-3xl mb-3">
115
+ <i class="fas fa-spinner"></i>
116
+ </div>
117
+ <p class="text-gray-600">Generating your image... This may take a moment</p>
118
+ </div>
119
+
120
+ <!-- Actions -->
121
+ <div id="result-actions" class="hidden mt-6 flex flex-col sm:flex-row gap-3 justify-center">
122
+ <button class="bg-indigo-500 text-white px-4 py-2 rounded-lg flex items-center justify-center gap-2 hover:bg-indigo-600 transition">
123
+ <i class="fas fa-download"></i> Download
124
+ </button>
125
+ <button class="bg-green-500 text-white px-4 py-2 rounded-lg flex items-center justify-center gap-2 hover:bg-green-600 transition">
126
+ <i class="fas fa-share-alt"></i> Share
127
+ </button>
128
+ <button class="bg-gray-200 text-gray-700 px-4 py-2 rounded-lg flex items-center justify-center gap-2 hover:bg-gray-300 transition">
129
+ <i class="fas fa-redo"></i> Regenerate
130
+ </button>
131
+ </div>
132
+ </div>
133
+ </div>
134
+ </div>
135
+
136
+ <!-- Tips Section -->
137
+ <div class="mt-10 bg-indigo-50 rounded-lg p-6">
138
+ <h3 class="text-lg font-semibold text-indigo-800 mb-3 flex items-center gap-2">
139
+ <i class="fas fa-lightbulb"></i> Tips for better results
140
+ </h3>
141
+ <ul class="space-y-2 text-gray-700">
142
+ <li class="flex items-start gap-2">
143
+ <i class="fas fa-check-circle text-indigo-500 mt-1"></i>
144
+ <span>Be specific with details (colors, objects, style)</span>
145
+ </li>
146
+ <li class="flex items-start gap-2">
147
+ <i class="fas fa-check-circle text-indigo-500 mt-1"></i>
148
+ <span>Include artistic styles (e.g., "in the style of Van Gogh")</span>
149
+ </li>
150
+ <li class="flex items-start gap-2">
151
+ <i class="fas fa-check-circle text-indigo-500 mt-1"></i>
152
+ <span>Add lighting conditions (sunset, neon, soft lighting)</span>
153
+ </li>
154
+ </ul>
155
+ </div>
156
+ </div>
157
+ </div>
158
+
159
+ <script>
160
+ document.addEventListener('DOMContentLoaded', function() {
161
+ // Elements
162
+ const promptInput = document.getElementById('prompt-input');
163
+ const generateBtn = document.getElementById('generate-btn');
164
+ const resultContent = document.getElementById('result-content');
165
+ const loadingState = document.getElementById('loading-state');
166
+ const resultActions = document.getElementById('result-actions');
167
+ const charCount = document.getElementById('char-count');
168
+ const styleOptions = document.querySelectorAll('.style-option');
169
+
170
+ let selectedStyle = 'realistic';
171
+
172
+ // Character count
173
+ promptInput.addEventListener('input', function() {
174
+ const count = this.value.length;
175
+ charCount.textContent = count;
176
+
177
+ if (count > 200) {
178
+ charCount.classList.add('text-red-500');
179
+ } else {
180
+ charCount.classList.remove('text-red-500');
181
+ }
182
+ });
183
+
184
+ // Style selection
185
+ styleOptions.forEach(option => {
186
+ option.addEventListener('click', function() {
187
+ // Remove active class from all options
188
+ styleOptions.forEach(opt => {
189
+ opt.classList.remove('border-2', 'font-semibold');
190
+ });
191
+
192
+ // Add active class to selected option
193
+ this.classList.add('border-2', 'font-semibold');
194
+ selectedStyle = this.dataset.style;
195
+ });
196
+ });
197
+
198
+ // Set first style as active by default
199
+ styleOptions[0].classList.add('border-2', 'font-semibold');
200
+
201
+ // Generate button click
202
+ generateBtn.addEventListener('click', function() {
203
+ const prompt = promptInput.value.trim();
204
+
205
+ if (!prompt) {
206
+ alert('Please enter a description for your image');
207
+ return;
208
+ }
209
+
210
+ if (prompt.length > 200) {
211
+ alert('Description should be 200 characters or less');
212
+ return;
213
+ }
214
+
215
+ // Show loading state
216
+ resultContent.innerHTML = '';
217
+ loadingState.classList.remove('hidden');
218
+ resultActions.classList.add('hidden');
219
+
220
+ // Simulate API call with timeout
221
+ setTimeout(() => {
222
+ // Hide loading state
223
+ loadingState.classList.add('hidden');
224
+
225
+ // Show result (in a real app, this would be the actual image from the API)
226
+ resultContent.innerHTML = `
227
+ <div class="relative w-full h-full">
228
+ <img src="https://source.unsplash.com/random/800x600/?${encodeURIComponent(prompt)}"
229
+ alt="Generated image of ${prompt}"
230
+ class="w-full h-full object-cover rounded-lg">
231
+ <div class="absolute inset-0 bg-black bg-opacity-20 flex items-center justify-center rounded-lg">
232
+ <span class="text-white bg-black bg-opacity-50 px-3 py-1 rounded-lg text-sm">
233
+ Example result - in a real app, this would be your AI-generated image
234
+ </span>
235
+ </div>
236
+ </div>
237
+ `;
238
+
239
+ // Show actions
240
+ resultActions.classList.remove('hidden');
241
+ }, 3000);
242
+ });
243
+ });
244
+ </script>
245
+ <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=ranemeo/roro" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
246
+ </html>