Update app.py
Browse files
app.py
CHANGED
|
@@ -128,7 +128,44 @@ def create_prompt_blocks(count, user_input):
|
|
| 128 |
|
| 129 |
return blocks_ui
|
| 130 |
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
gr.Markdown("""
|
| 133 |
# 🎨 BATUTO - Generador de Prompts Hiperrealistas
|
| 134 |
Genera prompts detallados para crear imágenes hiperrealistas con IA
|
|
@@ -162,17 +199,18 @@ with gr.Blocks(title="BATUTO - Generador de Prompts Hiperrealistas", theme=gr.th
|
|
| 162 |
html_blocks = ""
|
| 163 |
for i, prompt in enumerate(prompts, 1):
|
| 164 |
html_blocks += f"""
|
| 165 |
-
<div
|
| 166 |
-
<h3
|
| 167 |
<div style="position: relative;">
|
| 168 |
<textarea
|
| 169 |
id="prompt-{i}"
|
| 170 |
-
style="width: 100%; height: 200px; padding: 1rem; border
|
| 171 |
readonly
|
| 172 |
>{prompt}</textarea>
|
| 173 |
<button
|
| 174 |
onclick="copyPrompt({i})"
|
| 175 |
-
|
|
|
|
| 176 |
>
|
| 177 |
📋 Copiar
|
| 178 |
</button>
|
|
@@ -193,11 +231,11 @@ with gr.Blocks(title="BATUTO - Generador de Prompts Hiperrealistas", theme=gr.th
|
|
| 193 |
const button = event.target;
|
| 194 |
const originalText = button.textContent;
|
| 195 |
button.textContent = '✅ Copiado!';
|
| 196 |
-
button.style.background = '#
|
| 197 |
|
| 198 |
setTimeout(() => {
|
| 199 |
button.textContent = originalText;
|
| 200 |
-
button.style.background = '#
|
| 201 |
}, 2000);
|
| 202 |
}
|
| 203 |
</script>
|
|
|
|
| 128 |
|
| 129 |
return blocks_ui
|
| 130 |
|
| 131 |
+
# Tema personalizado con colores oscuros y azules
|
| 132 |
+
custom_css = """
|
| 133 |
+
.dark-box textarea {
|
| 134 |
+
background-color: #1a1a1a !important;
|
| 135 |
+
color: #4fc3f7 !important;
|
| 136 |
+
border: 1px solid #1565c0 !important;
|
| 137 |
+
font-family: monospace;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
.dark-box {
|
| 141 |
+
background: #2d3748 !important;
|
| 142 |
+
padding: 1.5rem;
|
| 143 |
+
border-radius: 10px;
|
| 144 |
+
border: 1px solid #4a5568;
|
| 145 |
+
margin-bottom: 1rem;
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
.dark-box h3 {
|
| 149 |
+
color: #90caf9 !important;
|
| 150 |
+
margin-top: 0 !important;
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
.copy-btn {
|
| 154 |
+
background: #1976d2 !important;
|
| 155 |
+
color: white !important;
|
| 156 |
+
border: none !important;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
.copy-btn:hover {
|
| 160 |
+
background: #1565c0 !important;
|
| 161 |
+
}
|
| 162 |
+
"""
|
| 163 |
+
|
| 164 |
+
with gr.Blocks(
|
| 165 |
+
title="BATUTO - Generador de Prompts Hiperrealistas",
|
| 166 |
+
theme=gr.themes.Soft(),
|
| 167 |
+
css=custom_css
|
| 168 |
+
) as demo:
|
| 169 |
gr.Markdown("""
|
| 170 |
# 🎨 BATUTO - Generador de Prompts Hiperrealistas
|
| 171 |
Genera prompts detallados para crear imágenes hiperrealistas con IA
|
|
|
|
| 199 |
html_blocks = ""
|
| 200 |
for i, prompt in enumerate(prompts, 1):
|
| 201 |
html_blocks += f"""
|
| 202 |
+
<div class="dark-box">
|
| 203 |
+
<h3>Prompt #{i}</h3>
|
| 204 |
<div style="position: relative;">
|
| 205 |
<textarea
|
| 206 |
id="prompt-{i}"
|
| 207 |
+
style="width: 100%; height: 200px; padding: 1rem; border-radius: 8px; font-family: monospace; resize: vertical; background: #1a1a1a; color: #4fc3f7; border: 1px solid #1565c0;"
|
| 208 |
readonly
|
| 209 |
>{prompt}</textarea>
|
| 210 |
<button
|
| 211 |
onclick="copyPrompt({i})"
|
| 212 |
+
class="copy-btn"
|
| 213 |
+
style="position: absolute; top: 0.5rem; right: 0.5rem; padding: 0.5rem 1rem; background: #1976d2; color: white; border: none; border-radius: 6px; cursor: pointer;"
|
| 214 |
>
|
| 215 |
📋 Copiar
|
| 216 |
</button>
|
|
|
|
| 231 |
const button = event.target;
|
| 232 |
const originalText = button.textContent;
|
| 233 |
button.textContent = '✅ Copiado!';
|
| 234 |
+
button.style.background = '#388e3c';
|
| 235 |
|
| 236 |
setTimeout(() => {
|
| 237 |
button.textContent = originalText;
|
| 238 |
+
button.style.background = '#1976d2';
|
| 239 |
}, 2000);
|
| 240 |
}
|
| 241 |
</script>
|