From 2ea85a86a9e99e65d51492aa22d93a8e2d49b614 Mon Sep 17 00:00:00 2001
From: Adam Piontek <adam@73k.us>
Date: Tue, 6 Apr 2021 19:17:24 -0400
Subject: [PATCH] added copyright footer

---
 assets/css/app.scss                             | 7 +++++++
 lib/home73k_web/templates/home/resume.html.eex  | 2 +-
 lib/home73k_web/templates/layout/root.html.leex | 7 +++++++
 lib/home73k_web/views/layout_view.ex            | 9 ++++++++-
 4 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/assets/css/app.scss b/assets/css/app.scss
index 7caabe9..689a384 100644
--- a/assets/css/app.scss
+++ b/assets/css/app.scss
@@ -99,6 +99,13 @@ a {
 .fs-smaller {
   font-size: smaller;
 }
+.footer73k {
+  position: fixed !important;
+  font-size: 10px !important;
+  border-top-left-radius: 0.3rem !important;
+  padding-top: 2px;
+  padding-bottom: 2px;
+}
 
 /* social icons */
 #social-icons .link-light {
diff --git a/lib/home73k_web/templates/home/resume.html.eex b/lib/home73k_web/templates/home/resume.html.eex
index 9fd8227..210589c 100644
--- a/lib/home73k_web/templates/home/resume.html.eex
+++ b/lib/home73k_web/templates/home/resume.html.eex
@@ -1,6 +1,6 @@
 <main class="container-fluid d-flex justify-content-center align-items-center">
 
-  <div class="d-flex flex-column mt-5">
+  <div class="d-flex flex-column mt-5 pb-3 mb-5">
 
     <div class="col-auto justify-content-start">
 
diff --git a/lib/home73k_web/templates/layout/root.html.leex b/lib/home73k_web/templates/layout/root.html.leex
index d60c11c..815eb20 100644
--- a/lib/home73k_web/templates/layout/root.html.leex
+++ b/lib/home73k_web/templates/layout/root.html.leex
@@ -29,5 +29,12 @@
 
       <%= @inner_content %>
 
+      <%#= if footer_absolute?(@conn) do %>
+      <footer class="footer73k footer bottom-0 end-0 bg-dark">
+        <div class="px-2 px-sm-3">
+          <span class="text-gray-400">&copy; Copyright <%= Date.utc_today |> Map.get(:year) %> Adam Piontek</span>
+        </div>
+      </footer>
+
   </body>
 </html>
diff --git a/lib/home73k_web/views/layout_view.ex b/lib/home73k_web/views/layout_view.ex
index 50737ca..a4c5d6f 100644
--- a/lib/home73k_web/views/layout_view.ex
+++ b/lib/home73k_web/views/layout_view.ex
@@ -2,7 +2,14 @@ defmodule Home73kWeb.LayoutView do
   use Home73kWeb, :view
 
   def navbar_fixed?(conn) do
-    [Routes.home_path(conn, :index), Routes.home_path(conn, :folio)]
+    [:index, :folio]
+    |> Enum.map(&Routes.home_path(conn, &1))
+    |> Enum.member?(Phoenix.Controller.current_path(conn))
+  end
+
+  def footer_absolute?(conn) do
+    [:index, :folio, :resume]
+    |> Enum.map(&Routes.home_path(conn, &1))
     |> Enum.member?(Phoenix.Controller.current_path(conn))
   end