Lukeetah commited on
Commit
caa5404
verified
1 Parent(s): 710f037

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +97 -86
main.py CHANGED
@@ -1,93 +1,104 @@
1
  import streamlit as st
 
2
 
3
- # Configuraci贸n inicial
4
- st.set_page_config(page_title="HUMANOPS - Automatizaci贸n con Alma", layout="wide")
5
-
6
- # CSS custom para un look moderno y atractivo
7
- st.markdown(
8
- """
9
- <style>
10
- body {
11
- background: linear-gradient(135deg, #74ebd5, #ACB6E5);
12
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
13
- color: #fff;
14
- }
15
- .header {
16
- text-align: center;
17
- padding: 80px 0;
18
- }
19
- .header h1 {
20
- font-size: 4rem;
21
- margin: 0;
22
- }
23
- .header p {
24
- font-size: 1.5rem;
25
- margin: 20px 0;
26
- }
27
- .cta-button {
28
- background-color: #fff;
29
- color: #4a90e2;
30
- border: none;
31
- padding: 15px 30px;
32
- font-size: 1.2rem;
33
- border-radius: 8px;
34
- cursor: pointer;
35
- text-decoration: none;
36
- transition: background 0.3s;
37
- }
38
- .cta-button:hover {
39
- background-color: #f0f0f0;
40
- }
41
- .form-container {
42
- background: rgba(255,255,255,0.2);
43
- padding: 30px;
44
- border-radius: 12px;
45
- max-width: 500px;
46
- margin: auto;
47
- margin-bottom: 50px;
48
- }
49
- .form-container input, .form-container textarea {
50
- width: 100%;
51
- padding: 12px;
52
- margin: 10px 0;
53
- border-radius: 6px;
54
- border: none;
55
- }
56
- .form-container input[type="submit"] {
57
- background: #fff;
58
- color: #4a90e2;
59
- border: none;
60
- cursor: pointer;
61
- font-weight: bold;
62
- }
63
- .form-container input[type="submit"]:hover {
64
- background: #e0e0e0;
65
- }
66
- </style>
67
- """,
68
- unsafe_allow_html=True,
69
  )
70
 
71
- # Secci贸n de encabezado
72
- st.markdown("""
73
- <div class="header">
74
- <h1>HUMANOPS</h1>
75
- <p>Automatizaci贸n con alma para tu empresa</p>
76
- <a class="cta-button" href="#contacto">隆Quiero probarlo!</a>
77
- </div>
78
- """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
- st.markdown("<div id='contacto'></div>", unsafe_allow_html=True)
 
 
81
 
82
- # Secci贸n de formulario
83
  with st.container():
84
- st.markdown("""
85
- <div class="form-container">
86
- <form action="https://hook.us2.make.com/f5q1azqgpjaoaf1wdo5o2phe093csrbr" method="POST">
87
- <input type="text" name="nombre" placeholder="Tu nombre" required>
88
- <input type="email" name="email" placeholder="Tu email" required>
89
- <textarea name="mensaje" placeholder="Cu茅ntanos sobre tu empresa" rows="4"></textarea>
90
- <input type="submit" value="Enviar">
91
- </form>
92
- </div>
93
- """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
+ import requests
3
 
4
+ # Configuraci贸n inicial de la p谩gina
5
+ st.set_page_config(
6
+ page_title="HUMANOPS - Automatizaci贸n con Alma",
7
+ layout="centered",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  )
9
 
10
+ # Estilos CSS para mejorar la apariencia
11
+ page_bg_img = """
12
+ <style>
13
+ body {
14
+ background: linear-gradient(135deg, #74ebd5, #ACB6E5);
15
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
16
+ color: #ffffff;
17
+ }
18
+ h1, h2, h3 {
19
+ text-align: center;
20
+ margin-top: 1.5rem;
21
+ margin-bottom: 1rem;
22
+ }
23
+ .form-container {
24
+ background: rgba(255,255,255,0.15);
25
+ padding: 30px;
26
+ border-radius: 12px;
27
+ max-width: 500px;
28
+ margin: 2rem auto;
29
+ }
30
+ label {
31
+ font-weight: bold;
32
+ margin-top: 1rem;
33
+ display: block;
34
+ }
35
+ .stTextInput, .stTextArea {
36
+ margin-top: 0.5rem;
37
+ }
38
+ .submit-button {
39
+ margin-top: 1.5rem;
40
+ background-color: #ffffff;
41
+ color: #4a90e2;
42
+ padding: 0.7rem 1.5rem;
43
+ font-size: 1rem;
44
+ font-weight: bold;
45
+ border: none;
46
+ border-radius: 8px;
47
+ cursor: pointer;
48
+ transition: background 0.3s;
49
+ }
50
+ .submit-button:hover {
51
+ background-color: #f0f0f0;
52
+ }
53
+ .success {
54
+ text-align: center;
55
+ margin-top: 1rem;
56
+ font-weight: bold;
57
+ color: #fdfdfd;
58
+ }
59
+ </style>
60
+ """
61
+ st.markdown(page_bg_img, unsafe_allow_html=True)
62
 
63
+ # T铆tulo principal
64
+ st.title("HUMANOPS")
65
+ st.subheader("Automatizaci贸n con alma para tu empresa")
66
 
67
+ # Contenedor para el formulario
68
  with st.container():
69
+ st.markdown("<div class='form-container'>", unsafe_allow_html=True)
70
+ st.write("Complet谩 tus datos y descubr铆 c贸mo HUMANOPS puede transformar tu organizaci贸n.")
71
+
72
+ # Creamos un formulario en Streamlit
73
+ with st.form(key="contact_form"):
74
+ nombre = st.text_input("Nombre")
75
+ email = st.text_input("Email")
76
+ mensaje = st.text_area("Mensaje (contanos sobre tu empresa)")
77
+
78
+ # Bot贸n de env铆o
79
+ submit_button = st.form_submit_button(label="Enviar", help="Env铆a tus datos")
80
+
81
+ st.markdown("</div>", unsafe_allow_html=True)
82
+
83
+ # L贸gica de env铆o al webhook
84
+ if submit_button:
85
+ if nombre and email and mensaje:
86
+ # Datos a enviar al webhook
87
+ data = {
88
+ "nombre": nombre,
89
+ "email": email,
90
+ "mensaje": mensaje
91
+ }
92
+ # Hacemos la petici贸n POST
93
+ webhook_url = "https://hook.us2.make.com/f5q1azqgpjaoaf1wdo5o2phe093csrbr" # REEMPLAZ脕 ESTA L脥NEA
94
+ try:
95
+ response = requests.post(webhook_url, data=data)
96
+ if response.status_code == 200:
97
+ st.success("隆Gracias! Tus datos se enviaron correctamente.")
98
+ else:
99
+ st.error(f"Error al enviar los datos. C贸digo de estado: {response.status_code}")
100
+ except Exception as e:
101
+ st.error(f"Ocurri贸 un error al enviar la informaci贸n: {e}")
102
+ else:
103
+ st.warning("Por favor, complet谩 todos los campos antes de enviar.")
104
+