Responsive UI

Implements: https://todo.sr.ht/~sircmpwn/searchhut/20
This commit is contained in:
Umar Getagazov 2022-07-10 08:35:28 +07:00 committed by Drew DeVault
parent f449fe8a32
commit 3bc5cd9689
2 changed files with 49 additions and 15 deletions

View file

@ -8,12 +8,27 @@ html, body {
body {
font-family: sans-serif;
padding: 0;
padding: 0 1rem;
margin: 0;
display: flex;
flex-direction: column;
}
header {
font-size: 1.5rem;
font-size: min(max(1.5rem, 4vw), 2rem);
}
@media (min-width: 800px) {
header {
font-size: 2rem;
}
}
header h1 {
font-size: 1em;
}
footer {
display: flex;
flex-grow: 1;
@ -27,8 +42,8 @@ footer .infolinks {
.icon svg {
vertical-align: -.17em;
width: 30px;
height: 30px;
width: 0.9375em; /* 30px / 32px */
height: 0.9375em;
}
input[type="text"] {
@ -75,15 +90,13 @@ button:hover {
align-items: center;
}
.search header {
display: flex;
justify-content: center;
align-items: center;
.index form {
width: 100%;
}
.search main {
max-width: 800px;
width: 800px;
width: 100%;
margin: 1rem auto 0;
}
@ -119,15 +132,37 @@ ol {
}
.input-group {
display: flex;
width: 100%;
max-width: 600px;
margin: 0 auto;
}
.input-group input[type="text"] {
width: 500px;
width: 100%;
}
.input-group button {
margin-left: 0.5rem;
width: 100%;
height: 2.5em;
margin-top: 0.5rem;
}
@media (min-width: 320px) {
.input-group {
display: flex;
}
.input-group input[type="text"] {
width: 0;
flex: 1;
}
.input-group button {
width: auto;
height: auto;
margin-top: 0;
margin-left: 0.5rem;
}
}
.infolinks {
@ -137,10 +172,8 @@ ol {
.infolinks a {
color: gray;
}
.infolinks a:not(:last-child) {
margin-right: 1.5rem;
margin: 0 0.75rem;
white-space: nowrap;
}
.alert {

View file

@ -1,6 +1,7 @@
<!doctype html>
<html lang="en" class="{{.Page}}">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="/static/main.css" />
<link rel="shortcut icon" type="image/png" href="/static/favicon.png" />
<title>{{.Title}}</title>