Add style to header

This commit is contained in:
Rogerio Chaves 2020-04-06 08:26:31 +02:00
parent 867f019d82
commit 13a837b221
No known key found for this signature in database
GPG Key ID: E6AF5440509B1D94
4 changed files with 62 additions and 25 deletions

View File

@ -145,7 +145,7 @@ router.get("/search", async (req, res) => {
const people = await queries.searchPeople(ssbServer, query);
res.render("search", { people });
res.render("search", { people, query });
});
router.get("/blob/*", (req, res) => {

48
app/public/style.css Normal file
View File

@ -0,0 +1,48 @@
body {
font-family: sans-serif;
margin: 0;
}
header {
padding: 0 30px;
border-bottom: 1px solid #666;
background: linear-gradient(180deg, #000 0%, #2a2a2a 5%, #222 95%, #000 100%);
color: #fff;
display: flex;
align-items: center;
}
nav a {
display: inline-block;
line-height: 60px;
padding: 0 10px;
color: #fff;
text-decoration: none;
}
nav a:hover {
background: #000;
}
.logo {
text-transform: uppercase;
font-weight: bold;
padding-right: 20px;
}
.right-items {
display: flex;
margin-left: auto;
align-items: center;
}
main {
padding: 10px;
}
.input-search {
color: #fff;
background: #444;
border-radius: 20px;
padding: 5px 5px 5px 27px;
border: 1px solid #666;
width: 150px;
}
.search-icon {
position: absolute;
margin-top: 5px;
margin-left: 7px;
}

View File

@ -4,40 +4,29 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Social</title>
<style>
body {
font-family: sans-serif;
margin: 0;
}
header {
padding: 20px 10px;
border-bottom: 1px solid #666;
}
header a {
display: inline-block;
padding: 0 10px;
}
main {
padding: 10px;
}
</style>
<link rel="stylesheet" href="/style.css">
</head>
<body>
<% if (context.profile.name) { %>
<header>
<div style="float: right">
<%= context.profile.name %> (<%= context.profile.id.slice(0, 8) %>)
<div class="logo">
Social
</div>
<form action="/search" method="GET" style="float: right; padding-right: 10px">
<input type="text" name="query" placeholder="Search for people...">
<input type="submit" value="Search" />
</form>
<nav>
<a href="/">Home</a>
<a href="/about">About me</a>
<a href="/pubs">Pubs</a>
<a href="/debug">Debug</a>
</nav>
<div class="right-items">
<div style="padding-right: 10px">
<%= context.profile.name %> (<%= context.profile.id.slice(0, 8) %>)
</div>
<form action="/search" method="GET">
<div class="search-icon">🔎</div>
<input type="search" class="input-search" name="query" placeholder="Search for people...">
</form>
</div>
</header>
<% } %>
<main>

View File

@ -1,6 +1,6 @@
<%- include('_header') %>
<h2>Results</h2>
<h2>Results for "<%= query %>"</h2>
<ul>
<% people.map(person => { %>