From 13a837b221f3a33494816bdbfe0768db9365410d Mon Sep 17 00:00:00 2001 From: Rogerio Chaves Date: Mon, 6 Apr 2020 08:26:31 +0200 Subject: [PATCH] Add style to header --- app/lib/express.js | 2 +- app/public/style.css | 48 +++++++++++++++++++++++++++++++++++++++++++ app/views/_header.ejs | 35 +++++++++++-------------------- app/views/search.ejs | 2 +- 4 files changed, 62 insertions(+), 25 deletions(-) create mode 100644 app/public/style.css diff --git a/app/lib/express.js b/app/lib/express.js index fdb2117..b466c1c 100644 --- a/app/lib/express.js +++ b/app/lib/express.js @@ -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) => { diff --git a/app/public/style.css b/app/public/style.css new file mode 100644 index 0000000..a871eb5 --- /dev/null +++ b/app/public/style.css @@ -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; +} diff --git a/app/views/_header.ejs b/app/views/_header.ejs index f6ccec8..e8005aa 100644 --- a/app/views/_header.ejs +++ b/app/views/_header.ejs @@ -4,40 +4,29 @@ Social - + <% if (context.profile.name) { %>
-
- <%= context.profile.name %> (<%= context.profile.id.slice(0, 8) %>) + -
- - -
+
+
+ <%= context.profile.name %> (<%= context.profile.id.slice(0, 8) %>) +
+
+
🔎
+ +
+
<% } %>
diff --git a/app/views/search.ejs b/app/views/search.ejs index c810bdd..519185f 100644 --- a/app/views/search.ejs +++ b/app/views/search.ejs @@ -1,6 +1,6 @@ <%- include('_header') %> -

Results

+

Results for "<%= query %>"