Spaces:
Sleeping
Sleeping
File size: 8,364 Bytes
de65732 b3d5028 cc05330 de65732 cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e cc05330 c1faa54 8e5785e c1faa54 cc05330 b3d5028 e30e5b7 cc05330 c1faa54 cc05330 8e5785e cc05330 233f364 cc05330 b653af0 cc05330 233f364 cc05330 b653af0 cc05330 b653af0 cc05330 b653af0 cc05330 233f364 cc05330 b653af0 cc05330 b653af0 cc05330 b653af0 cc05330 b653af0 cc05330 b653af0 cc05330 b653af0 cc05330 b653af0 233f364 8e5785e c1faa54 8e5785e c1faa54 cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e cc05330 8e5785e 233f364 cc05330 233f364 c1faa54 8e5785e cc05330 b653af0 de65732 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | import gradio as gr
import urllib.parse
import time
def ejecutar_protocolo_shanghai(tipo_proyecto, objetivo, foto, nombre, telefono, descripcion):
if not nombre or not telefono:
return (
"🚨 [ERROR DE AUTENTICACIÓN] Por favor ingresa Nombre y WhatsApp para activar el escáner.",
"<div style='text-align:center; color:#EF4444;'>Falta información de contacto.</div>"
)
# 🏎️ SIMULACIÓN DE PROCESAMIENTO ASIÁTICO (Genera el efecto WOW de espera técnica)
time.sleep(2.5)
# Lógica de cálculo dinámico "juguetón" estilo app china
material_estimado = "85 kg de Microcemento Nanotech + Base Polimérica" if "Microcemento" in tipo_proyecto else "Kits de Anclaje Estructural + Aditivos"
if "Baño" in tipo_proyecto: material_estimado = "Sistemas de Impermeabilización Avanzada + Acabados Epóxicos"
if "Cocina" in tipo_proyecto: material_estimado = "Módulos de Alta Resistencia Térmica y Superficies de Cuarzo"
# Consola técnica para la interfaz
informe_ui = f"""⚡ EN CONSTRUCCIÓN LAB · AUTOMATION TOKYO-ENGINE
======================================================
[NIVEL DE USUARIO]: S-RANK CONSTRUCTOR 🔥
[ID PROYECTO]: CN-MED-{int(time.time())}
► MATRIZ SELECCIONADA: {tipo_proyecto}
► VECTOR DE OPERACIÓN: {objetivo}
► CÁLCULO DE MATERIALES PREDICTIVO:
{material_estimado}
► ESTADO GLOBAL: ¡PROCESADO CON ÉXITO!
======================================================
¡Felicidades {nombre}! Has desbloqueado un beneficio exclusivo."""
# Mensaje persuasivo y ultra-comercial para WhatsApp
mensaje_wa = f"""*¡ALERTA DE PROYECTO PREMIUM - EN CONSTRUCCIÓN LAB!* 🧪🔥
_Ecosistema de Conversión Rápida de Construfull_
👤 *Constructor:* {nombre}
📞 *Línea Directa:* {telefono}
📐 *Matriz:* {tipo_proyecto}
🎯 *Meta:* {objetivo}
📦 *Sustratos e Insumos Estimados:*
_{material_estimado}_
🎁 *RECOMPENSA ACTIVA:* Ha reclamado el *Bono de Auditoría Express* + Muestra Física de Microcemento en ExpoCamaCol.
---
🚀 _Enviado desde el Laboratorio del Futuro_"""
mensaje_codificado = urllib.parse.quote(mensaje_wa)
link = f"https://wa.me/573233476985?text={mensaje_codificado}"
# RECOMPENSA ESTILO CUUPÓN CHINO (Llamativo, con urgencia y botones de acción)
cupon_html = f"""
<div class="china-coupon-card">
<div class="coupon-left">
<h2>RECOMPENSA</h2>
<p>CONSTRUFULL SAS</p>
</div>
<div class="coupon-right">
<h3>AUDITORÍA TÉCNICA 100% GRATIS</h3>
<p style="color: #94A3B8; font-size: 11px;">Válido por las próximas 2 horas para {nombre}</p>
<a href="{link}" target="_blank" style="text-decoration: none;">
<button class="btn-china-claim">🎯 RECLAMAR BENEFICIO EN WHATSAPP</button>
</a>
</div>
</div>
"""
return informe_ui, cupon_html
# 🧧 CSS AL ESTILO SUPER-APP (Neón, Contraste Alto, Efectos Táctiles Masivos)
custom_css = """
body, .gradio-container { background-color: #060814 !important; color: #F1F5F9 !important; font-family: 'Inter', sans-serif !important; }
.tabs, .box, .input-container, input, textarea, select { background-color: #0B0F19 !important; border: 2px solid #1E293B !important; color: white !important; }
label { color: #10B981 !important; font-weight: 900 !important; font-family: monospace !important; font-size: 13px !important; }
/* 🎮 CASILLAS DE SELECCIÓN GAMIFICADAS */
.gradio-container .gr-input-label {
background: linear-gradient(135deg, #111827 0%, #0F172A 100%) !important;
border: 2px solid #1F2937 !important;
border-radius: 14px !important;
padding: 16px !important;
font-weight: bold !important;
transition: all 0.2s ease-in-out !important;
}
.gradio-container .gr-input-label:hover {
border-color: #10B981 !important; /* Verde Neón de éxito financiero */
transform: scale(1.03) !important;
background: #064E3B !important;
box-shadow: 0 0 15px rgba(16, 185, 129, 0.3) !important;
}
/* BOTÓN DE DISPARO INMEDIATO */
button.primary {
background: linear-gradient(90deg, #F59E0B 0%, #EF4444 100%) !important; /* Degradado de energía asiático */
border: none !important;
color: white !important;
font-weight: 900 !important;
font-size: 16px !important;
letter-spacing: 1px !important;
border-radius: 50px !important;
padding: 18px !important;
box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4) !important;
}
button.primary:hover {
transform: translateY(-2px) scale(1.02);
box-shadow: 0 6px 25px rgba(239, 68, 68, 0.6) !important;
}
/* 🧧 DISEÑO DEL CUPÓN CHINO DE CONVERSIÓN RÁPIDA */
.china-coupon-card {
display: flex;
background: #111827;
border: 2px dashed #EF4444;
border-radius: 12px;
overflow: hidden;
max-width: 500px;
margin: 15px auto;
box-shadow: 0 10px 25px rgba(239, 68, 68, 0.15);
}
.coupon-left {
background: linear-gradient(135deg, #EF4444 0%, #991B1B 100%);
color: white;
padding: 20px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-width: 130px;
}
.coupon-left h2 { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: 1px; }
.coupon-left p { margin: 5px 0 0 0; font-size: 10px; opacity: 0.8; font-family: monospace; }
.coupon-right {
padding: 20px;
text-align: left;
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: center;
}
.coupon-right h3 { margin: 0; color: #10B981; font-size: 16px; font-weight: 800; }
.btn-china-claim {
background: #10B981;
color: white;
border: none;
padding: 10px 15px;
font-weight: bold;
border-radius: 6px;
cursor: pointer;
width: 100%;
margin-top: 10px;
transition: background 0.2s;
}
.btn-china-claim:hover { background: #059669; }
footer { display: none !important; }
"""
with gr.Blocks(theme=gr.themes.Base(), css=custom_css) as demo:
# Banner superior estilo transmisión en vivo / Gamificado
gr.Markdown("""
# 🧪 EN CONSTRUCCIÓN | INTERACTIVE LAB
### 🚀 PROTOCOLO ACELERADO DE TRANSFORMACIÓN · CONSTRUFULL MEDELLÍN SAS
---
🔴 **USUARIOS ACTIVOS EN MEDELLÍN:** 42 diagnosticando ahora mismo... ¡Completa el tuyo y asegura beneficios!
""")
with gr.Row():
with gr.Column(scale=1):
gr.Markdown("### [PASO 01] SELECCIONA EL NÚCLEO DE LA OBRA")
tipo_proyecto = gr.Radio(
choices=["🛁 Módulo Baño Inteligente", "🍳 Módulo Cocina de Lujo", "✨ Superficie de Microcemento", "🏢 Rediseño Comercial Completo"],
label="Matriz de Entrada", show_label=False
)
gr.Markdown("### [PASO 02] DEFINE EL IMPACTO")
objetivo = gr.Radio(
choices=["✨ Estética Disruptiva", "🔧 Reparación y Diagnóstico Clínico", "📈 Multiplicar Valor de Reventa"],
label="Impacto del Algoritmo", show_label=False
)
with gr.Column(scale=1):
gr.Markdown("### [PASO 03] REGISTRO Y MONITOREO")
foto = gr.Image(label="Escanear Espacio Actual (Opcional)", type="filepath")
nombre = gr.Textbox(label="Tu Nombre (Para asignar el Bono)", placeholder="Ej. Carlos Mendoza")
telefono = gr.Textbox(label="WhatsApp de Enlace Inmediato", placeholder="Ej. 3001234567")
descripcion = gr.Textbox(label="Especificaciones Técnicas Libres", placeholder="Añade detalles especiales aquí...", lines=2)
# El gran botón asiático de conversión masiva
boton_ejecutar = gr.Button("⚡ COMPILAR DATOS Y RECLAMAR PREMIO ⚡", variant="primary")
gr.Markdown("---")
with gr.Row():
with gr.Column(scale=1):
informe_salida = gr.Textbox(
label="🖥️ CORE CONSOLE (ALGORITMO PREDICTIVO DE MATERIALES)",
lines=8,
interactive=False
)
with gr.Column(scale=1):
whatsapp_salida = gr.HTML()
boton_ejecutar.click(
fn=ejecutar_protocolo_shanghai,
inputs=[tipo_proyecto, objetivo, foto, nombre, telefono, descripcion],
outputs=[informe_salida, whatsapp_salida]
)
demo.launch() |