Browse Source

add assets + start to make it look pretty

Getty Ritter 4 years ago
parent
commit
97c06a6b3a

File diff suppressed because it is too large
+ 107 - 0
assets/lc_logo.svg


+ 16 - 4
lc/app.py

@@ -26,7 +26,11 @@ def handle_errors(func):
             return func(*args, **kwargs)
         except e.LCException as exn:
             return (
-                render("main", title="error", content=f"shit's fucked yo: {exn}"),
+                render("main",
+                       title="error",
+                       content=f"shit's fucked yo: {exn}",
+                       user=None
+                ),
                 500,
             )
 
@@ -37,7 +41,7 @@ def handle_errors(func):
 @app.route("/")
 @handle_errors
 def index():
-    return render("main", title="main", content="whoo")
+    return render("main", title="main", content="whoo", u=None)
 
 
 @app.route("/auth", methods=["POST"])
@@ -62,7 +66,10 @@ def get_user(user: str):
     pg = int(flask.request.args.get("page", 0))
     links = u.get_links(page=pg)
     return render(
-        "main", title=f"user {u.name}", content=render("linklist", links=links),
+        "main",
+        title=f"user {u.name}",
+        content=render("linklist", links=links),
+        user=u,
     )
 
 
@@ -85,4 +92,9 @@ def get_tagged_links(user: str, tag: str):
     pg = int(flask.request.args.get("page", 0))
     t = u.get_tag(tag)
     links = t.get_links(page=pg)
-    return render("main", title=f"tag {tag}", content=render("linklist", links=links),)
+    return render(
+        "main",
+        title=f"tag {tag}",
+        content=render("linklist", links=links),
+        user=u,
+    )

BIN
lc/static/lc_128.png


BIN
lc/static/lc_16.png


BIN
lc/static/lc_32.png


BIN
lc/static/lc_64.png


BIN
lc/static/leaguespartan-bold.ttf


+ 59 - 7
lc/static/main.css

@@ -1,19 +1,35 @@
+@font-face {
+    font-family: league-spartan;
+    src: url("/static/leaguespartan-bold.ttf");
+}
+
 body {
     font-family: "Arial", "Helvetica", sans-serif;
 }
 
+.linklist {
+    padding: 1em 2em;
+}
+
+.user {
+    padding: 0em 1em;
+}
+
+.user a {
+    text-decoration: none;
+}
+
 .link {
-    padding: 2em;
-    display: flex;
-    flex-wrap: wrap;
+    padding: 0.4em 1em;
 }
 
 .link .text {
     padding-right: 1em;
+    display: block;
 }
 
 .link .url {
-    flex: 1;
+    padding-left: 0.5em;
 }
 
 .link .url a {
@@ -21,11 +37,47 @@ body {
     font-size: small;
 }
 
-.link taglist {
-    color: #900;
+a {
+    color: #8800aaff;
+}
+
+.taglist { display: flex; }
+.tag {
+    padding-right: 0.4em;
 }
 
-.link .datetime {
+.tag::before {
+    color: #8800aaff;
+    content: "#";
+}
+
+.link .datetime a {
     color: #999;
     font-size: small;
+    text-decoration: none;
+}
+
+.header {
+    display: flex;
+    align-items: center;
+    border-bottom: solid black;
+    padding: 0.2em 2em;
+    margin: 0em 1em;
+}
+
+.logo {
+    padding: 0.5em;
+}
+
+.sitename {
+    padding-left: 0.5em;
+    font-size: large;
+    font-family: league-spartan;
+    text-transform: uppercase;
+    letter-spacing: 0.2em;
+}
+
+.sitename a {
+    color: #000;
+    text-decoration: none;
 }

+ 11 - 1
templates/main.mustache

@@ -6,7 +6,17 @@
     <link rel="stylesheet" type="text/css" href="/static/main.css" />
   </head>
   <body>
-    <h1>{{title}}</h1>
+    <div class="header">
+      <span class="logo">
+        <a href="/"><img src="/static/lc_32.png" alt="Lament Configuration" /></a></span>
+      <span class="sitename"><a href="/">Lament Configuration</a></span>
+      {{#user}}
+        <span class="user">(<a href="/u/{{name}}">@{{name}}</a>)</span>
+      {{/user}}
+      {{^user}}
+        <span class="user">not logged in</span>
+      {{/user}}
+    </div>
     <div class="content">
       {{{ content }}}
     </div>