Spaces:
Sleeping
Sleeping
style: improved card alignment and responsiveness in templates
Browse files- static/style.css +28 -30
- templates/chat.html +12 -9
- templates/profile.html +1 -1
- templates/start.html +10 -6
static/style.css
CHANGED
@@ -1,27 +1,23 @@
|
|
1 |
body {
|
2 |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
3 |
background-color: #f0f2f5;
|
4 |
-
display:
|
5 |
-
|
6 |
-
align-items: center;
|
7 |
min-height: 100vh;
|
8 |
-
margin: 0;
|
9 |
-
}
|
10 |
-
|
11 |
-
form {
|
12 |
-
background-color: #fff;
|
13 |
-
padding: 30px 40px;
|
14 |
-
margin: 30px 40px;
|
15 |
-
border-radius: 10px;
|
16 |
-
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
|
17 |
-
max-width: 400px;
|
18 |
-
width: 45%;
|
19 |
}
|
20 |
|
21 |
h1 {
|
22 |
text-align: left;
|
23 |
color: black;
|
24 |
-
margin-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
label {
|
@@ -69,9 +65,8 @@ button:hover {
|
|
69 |
|
70 |
.chat-container {
|
71 |
display: flex;
|
72 |
-
justify-
|
73 |
-
|
74 |
-
gap: 2rem;
|
75 |
}
|
76 |
|
77 |
.chat-box,
|
@@ -83,6 +78,20 @@ button:hover {
|
|
83 |
width: 45%;
|
84 |
font-size: 16px;
|
85 |
line-height: 1.6;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
|
88 |
.chat-container:has(.chat-box):not(:has(.response-box)) .chat-box,
|
@@ -91,6 +100,7 @@ button:hover {
|
|
91 |
}
|
92 |
|
93 |
.resposta-formatada {
|
|
|
94 |
line-height: 1.6;
|
95 |
}
|
96 |
|
@@ -116,15 +126,3 @@ button:hover {
|
|
116 |
gap: 0.5rem;
|
117 |
margin-bottom: 1rem;
|
118 |
}
|
119 |
-
|
120 |
-
@media (max-width: 1100px) {
|
121 |
-
.chat-container {
|
122 |
-
display: flex;
|
123 |
-
flex-direction: column;
|
124 |
-
gap: 2rem;
|
125 |
-
}
|
126 |
-
|
127 |
-
.chat-box, .response-box {
|
128 |
-
width: 100%;
|
129 |
-
}
|
130 |
-
}
|
|
|
1 |
body {
|
2 |
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
3 |
background-color: #f0f2f5;
|
4 |
+
display: block;
|
5 |
+
padding-top: 50px;
|
|
|
6 |
min-height: 100vh;
|
7 |
+
margin: 0 auto;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
}
|
9 |
|
10 |
h1 {
|
11 |
text-align: left;
|
12 |
color: black;
|
13 |
+
margin-top: 10px;
|
14 |
+
}
|
15 |
+
|
16 |
+
.info-modelo {
|
17 |
+
font-size: 10px;
|
18 |
+
color: #666;
|
19 |
+
margin-top: -20px;
|
20 |
+
margin-bottom: 20px;
|
21 |
}
|
22 |
|
23 |
label {
|
|
|
65 |
|
66 |
.chat-container {
|
67 |
display: flex;
|
68 |
+
justify-self: center;
|
69 |
+
width: 80%
|
|
|
70 |
}
|
71 |
|
72 |
.chat-box,
|
|
|
78 |
width: 45%;
|
79 |
font-size: 16px;
|
80 |
line-height: 1.6;
|
81 |
+
align-self: flex-start;
|
82 |
+
margin: 40px;
|
83 |
+
justify-self: center;
|
84 |
+
}
|
85 |
+
|
86 |
+
@media (max-width: 1100px) {
|
87 |
+
.chat-container {
|
88 |
+
flex-direction: column;
|
89 |
+
}
|
90 |
+
|
91 |
+
.chat-box, .response-box {
|
92 |
+
width: 70%;
|
93 |
+
align-self: center;
|
94 |
+
}
|
95 |
}
|
96 |
|
97 |
.chat-container:has(.chat-box):not(:has(.response-box)) .chat-box,
|
|
|
100 |
}
|
101 |
|
102 |
.resposta-formatada {
|
103 |
+
font-size: 16px;
|
104 |
line-height: 1.6;
|
105 |
}
|
106 |
|
|
|
126 |
gap: 0.5rem;
|
127 |
margin-bottom: 1rem;
|
128 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/chat.html
CHANGED
@@ -6,22 +6,25 @@
|
|
6 |
</head>
|
7 |
<body>
|
8 |
<div class="chat-container">
|
9 |
-
<
|
10 |
|
11 |
-
<
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
|
18 |
-
<button type="submit">Enviar</button>
|
19 |
-
</form>
|
20 |
|
21 |
{% if response %}
|
22 |
<div class="response-box">
|
23 |
<h3>Resposta:</h3>
|
24 |
-
<
|
25 |
</div>
|
26 |
{% endif %}
|
27 |
</div>
|
|
|
6 |
</head>
|
7 |
<body>
|
8 |
<div class="chat-container">
|
9 |
+
<div class="chat-box">
|
10 |
|
11 |
+
<form method="post">
|
12 |
+
<h1>Chat com a IA</h1>
|
13 |
+
<p class="info-modelo"> (Você está conversando com um modelo gemini-1.5-flash)</p>
|
14 |
+
<p>Oi, {{ history.name }}, espero que esteja tendo um ótimo dia!<br>
|
15 |
+
Eu sei tudo sobre livros e estou aqui para te ajudar.<br>
|
16 |
+
O que você deseja saber?</p>
|
17 |
|
18 |
+
<input type="text" id="question" name="question" required>
|
19 |
+
<button type="submit">Enviar</button>
|
20 |
+
</form>
|
21 |
|
22 |
+
</div>
|
|
|
|
|
23 |
|
24 |
{% if response %}
|
25 |
<div class="response-box">
|
26 |
<h3>Resposta:</h3>
|
27 |
+
<p class="resposta-formatada">{{ response | safe }}</p>
|
28 |
</div>
|
29 |
{% endif %}
|
30 |
</div>
|
templates/profile.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
</head>
|
7 |
<body>
|
8 |
|
9 |
-
<form method="POST">
|
10 |
<h1>Gostaria de alterar algo?</h1>
|
11 |
<label for="name">Seu nome:</label><br>
|
12 |
<input type="text" id="name" name="name" value="{{ history.get('name', '') }}"><br><br>
|
|
|
6 |
</head>
|
7 |
<body>
|
8 |
|
9 |
+
<form class="chat-box" method="POST">
|
10 |
<h1>Gostaria de alterar algo?</h1>
|
11 |
<label for="name">Seu nome:</label><br>
|
12 |
<input type="text" id="name" name="name" value="{{ history.get('name', '') }}"><br><br>
|
templates/start.html
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
</head>
|
18 |
<body>
|
19 |
|
20 |
-
<form method="POST">
|
21 |
<h1 id="titulo-criar-perfil">Vamos criar seu perfil?</h1>
|
22 |
|
23 |
<div class="small-link" id="link-ja-tenho">
|
@@ -30,11 +30,15 @@
|
|
30 |
|
31 |
<div id="existing-profiles" class="hidden">
|
32 |
<h1>Selecione um perfil</h1>
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
38 |
</div>
|
39 |
|
40 |
<div id="formulario-perfil">
|
|
|
17 |
</head>
|
18 |
<body>
|
19 |
|
20 |
+
<form class="chat-box" method="POST">
|
21 |
<h1 id="titulo-criar-perfil">Vamos criar seu perfil?</h1>
|
22 |
|
23 |
<div class="small-link" id="link-ja-tenho">
|
|
|
30 |
|
31 |
<div id="existing-profiles" class="hidden">
|
32 |
<h1>Selecione um perfil</h1>
|
33 |
+
{% if profiles %}
|
34 |
+
<ul>
|
35 |
+
{% for id, data in profiles.items() %}
|
36 |
+
<li><a href="/perfil/{{ id }}">{{ data.name or "Usuário " ~ id }}</a></li>
|
37 |
+
{% endfor %}
|
38 |
+
</ul>
|
39 |
+
{% else %}
|
40 |
+
<p>Não há perfis cadastrados.</p>
|
41 |
+
{% endif %}
|
42 |
</div>
|
43 |
|
44 |
<div id="formulario-perfil">
|