Refactor CSS, small style updates

This commit is contained in:
Alexey Yerin 2021-01-18 21:59:14 +03:00
parent 03cb53d0a3
commit 9c754f8fea
2 changed files with 41 additions and 30 deletions

View File

@ -6,43 +6,42 @@ body {
text-align: center;
}
.form {
display: flex;
flex-direction: column;
.main-section {
max-width: 90rem;
margin: 5px auto;
}
.form__item {
margin: 4px;
font-size: 1.2rem;
.form {
display: flex;
flex-direction: column;
}
.form__field {
display: flex;
align-items: center;
margin: 4px;
}
.form__input {
.form__field .form__label {
margin-right: 8px;
}
.form__input,
.textarea,
.translation {
font-size: 1rem;
padding: 4px;
font-size: 1.1rem;
}
.form__field .form__input {
margin-left: 8px;
}
.form__button {
padding: 5px;
padding: 4px 10px;
}
.textarea {
resize: vertical;
}
height: 5rem;
.textarea, .translation {
font-size: 1.2rem
/* Stretch to form width */
width: 100%;
}

View File

@ -10,21 +10,33 @@
<body>
<h1 class="title">Translate</h1>
<section class="main-section">
<form action="/" method="POST" class="form">
<label class="form__item form__field">
Source language: <input class="form__input" name="from" placeholder="en,de" value="{{.From}}">
<div class="form__field">
<label for="from" class="item form__label">
Source language:
</label>
<input class="form__input" name="from" placeholder="en,de" value="{{.From}}">
</div>
<label class="form__item form__field">
Translate to: <input class="form__input" name="to" placeholder="fr,ru" value="{{.To}}">
<div class="form__field">
<label for="to" class="item form__label">
Translate to:
</label>
<input class="form__input" name="to" placeholder="fr,ru" value="{{.To}}">
</div>
<textarea name="text" class="form__item form__input textarea" placeholder="Text to translate">{{.Text}}</textarea>
<div class="form__field">
<textarea name="text" class="textarea" placeholder="Text to translate">{{.Text}}</textarea>
</div>
<button type="submit" class="form__item form__button">Translate!</button>
<pre class="form__item translation">{{.Translation}}</pre>
<div class="form__field">
<button type="submit" class="form__button">Translate!</button>
</div>
</form>
<pre class="translation">{{.Translation}}</pre>
</section>
</body>
</html>
{{end}}