added a CLI and css styling

This commit is contained in:
2025-12-01 20:22:10 +01:00
parent 46c889be59
commit 16c83711a1
5 changed files with 266 additions and 55 deletions
+87 -28
View File
@@ -1,51 +1,110 @@
body {
font-family: system-ui, -apple-system, Roboto, "Segoe UI", Arial;
padding: 2rem;
max-width: 800px;
margin: auto;
html {
font-size: 15px;
}
h1 {
color: #333;
body {
font-family: 'Inter', system-ui, -apple-system, Roboto, "Segoe UI", Arial, sans-serif;
padding: 20px;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
background-color: #fff;
overflow-x: hidden;
}
h2 {
font-size: 1.8rem;
margin-bottom: 15px;
}
.form-container {
display: flex;
flex-direction: row;
text-align: left;
justify-content: center;
align-items: center;
background: #fff;
border-radius: 16px;
padding: 2rem;
max-width: 720px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.form-container img {
display: block;
margin: 0 auto;
}
.desc {
font-size: 1.2rem;
margin-bottom: 0.5rem;
color: #999;
}
label {
font-weight: 600;
display: block;
margin-bottom: 0.2rem;
}
.field {
margin-bottom: 1.5rem;
}
.desc {
color: #666;
font-size: 0.9rem;
margin-bottom: 0.4rem;
margin-bottom: 0.25rem;
font-size: 1.35rem;
color: #222;
}
input,
textarea,
select {
width: 100%;
padding: 0.4rem;
margin-top: 0.2rem;
padding: 0.6rem 0.75rem;
margin-bottom: 1rem;
border: none;
border-radius: 8px;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
color: #333333aa;
background-color: #e0f0ff; /* light blue */
border: 1px solid #88c1ff; /* medium blue */
transition: all 0.2s ease-in-out;
}
input:focus,
textarea:focus,
select:focus {
outline: #66aaffaa; /* soft blue focus */
background-color: #cce5ff; /* slightly darker blue on focus */
}
textarea {
resize: none;
}
button {
padding: 0.6rem 1rem;
font-size: 1rem;
background-color: #007acc;
color: white;
padding: 0.5rem 1rem;
font-size: 1.3rem;
border: none;
border-radius: 4px;
border-radius: 0.25rem;
cursor: pointer;
background-color: #66aaff; /* medium blue */
color: #fff;
transition: background-color 0.2s;
transition: color 0.2s;
}
button:hover {
background-color: #005fa3;
background-color: #3390ff; /* darker blue on hover */
}
.submit-container {
text-align: center;
margin-top: 1rem;
}
@media (max-width: 720px) {
html {
font-size: 20px;
}
.form-container {
max-width: 100%;
width: 100%;
}
}
+26 -23
View File
@@ -3,27 +3,30 @@
{% block title %}Form{% endblock %}
{% block content %}
<form action="/submit" method="POST" autocomplete="off">
{% for f in fields %}
{% if f.html_before.is_some() %}
{{ f.html_before.as_ref().unwrap() | safe }}
{% endif %}
<div class="field">
<label>{{ f.title }}</label>
<div class="desc">{{ f.description }}</div>
{% if f.answer_type == "textarea" %}
<textarea id="{{ f.name }}" name="{{ f.name }}" rows="5"></textarea>
{% elif f.answer_type == "select" %}
<select id="{{ f.name }}" name="{{ f.name }}"><option value="">(no options)</option></select>
{% else %}
<input id="{{ f.name }}" name="{{ f.name }}" type="{{ f.answer_type }}">
{% endif %}
</div>
{% if f.html_after.is_some() %}
{{ f.html_after.as_ref().unwrap() | safe }}
{% endif %}
{% endfor %}
<div><button type="submit">{{ submit_button }}</button></div>
</form>
<div class="form-container">
<form action="/submit" method="POST" autocomplete="off">
{% for f in fields %}
{% if f.html_before.is_some() %}
{{ f.html_before.as_ref().unwrap() | safe }}
{% endif %}
<div class="field">
<label for="{{ f.name }}">{{ f.title }}</label>
<div class="desc">{{ f.description }}</div>
{% if f.answer_type == "textarea" %}
<textarea id="{{ f.name }}" name="{{ f.name }}" rows="10" placeholder="{{ f.title|lower }}"></textarea>
{% elif f.answer_type == "select" %}
<select id="{{ f.name }}" name="{{ f.name }}">
<option value="">Select an option</option>
</select>
{% else %}
<input id="{{ f.name }}" name="{{ f.name }}" type="{{ f.answer_type }}" placeholder="{{ f.title|lower }}">
{% endif %}
</div>
{% if f.html_after.is_some() %}
{{ f.html_after.as_ref().unwrap() | safe }}
{% endif %}
{% endfor %}
<div class="submit-container"><button type="submit">{{ submit_button }}</button></div>
</form>
</div>
{% endblock %}