From fe6340e6df5ee15736cef11cc7d15cdbb2e5dad9 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Tue, 26 Jul 2022 13:39:26 +0100 Subject: [PATCH] Add about displaying support. --- base.css | 53 +++++++++++++++++++++++--------- dark.css | 13 ++++++-- index.go.html | 24 ++++++++++++++- pageHandler/pages/index/about.go | 4 ++- 4 files changed, 75 insertions(+), 19 deletions(-) diff --git a/base.css b/base.css index aafc438..12f33ef 100644 --- a/base.css +++ b/base.css @@ -14,7 +14,6 @@ main{ list-style: none; } .header{ - box-shadow: 1px 1px 5px 0px; position: fixed; top: 0; width: 100%; @@ -48,7 +47,6 @@ main{ height: 2px; position: relative; width: 24px; - } .hmb-line::before, .hmb-line::after{ content: ''; @@ -78,15 +76,43 @@ main{ transform: rotate(45deg); top:0; } -.flex-main{ - display: flex; - flex-direction: column; +.main-table{ + display: table; + width: 100%; } -.box-main{ - display: table; - width: 100%; - margin: 1px; - align-self: center; +.main-table > div{ + display: table-row; + background-color: transparent; +} +.main-table > div > div{ + display: table-cell; + padding: 3px 0; + border-style: solid; + border-width: 1px; +} +.item-table{ + display: table; + width: 100%; + background-color: transparent; +} +.item-table > div{ + display: table-row; + background-color: transparent; +} +.item-table-full, .item-table-half, .item-table-480{ + display: table-cell; + border-style: solid; + border-width: 1px; + background-color: transparent; +} +.item-table-full{ + width: 100%; +} +.item-table-half{ + width: 50%; +} +.item-table-480{ + width: 480px; } @media (min-width: 480px){ .nav{ @@ -101,12 +127,11 @@ main{ } .menu a:hover{ background-color: transparent; - } .hmb{ display: none; } - .box-main{ - margin: 5px 10px; - } + .main-table > div > div{ + padding: 5px; + } } \ No newline at end of file diff --git a/dark.css b/dark.css index bd03de0..3d1b1a8 100644 --- a/dark.css +++ b/dark.css @@ -12,9 +12,6 @@ body{ .home-button:hover{ background-color: #606061; } -.header{ - box-shadow-color: #696969; -} .menu a{ color: #e0e0e0; } @@ -26,4 +23,14 @@ body{ } .hmb-line, .hmb-line::before, .hmb-line::after{ background: #e0e0e0; +} +.main-table{ + border-color: wheat; + background-color: #1d1d1e; +} +.main-table > div > div{ + border-color: wheat; +} +.item-table > div > div{ + border-color: whitesmoke; } \ No newline at end of file diff --git a/index.go.html b/index.go.html index 70e44d2..4386a12 100644 --- a/index.go.html +++ b/index.go.html @@ -26,7 +26,29 @@ -
+
+
+
+
+
+
+

{{ .Data.About.Title }}

+
+ +
+
+
+ {{ .Data.About.GetContent }} +
+
+ Image of Me. +
+
+
+
+
\ No newline at end of file diff --git a/pageHandler/pages/index/about.go b/pageHandler/pages/index/about.go index 4379299..fa31baa 100644 --- a/pageHandler/pages/index/about.go +++ b/pageHandler/pages/index/about.go @@ -2,6 +2,8 @@ package index import ( "html/template" + "strconv" + "strings" "time" ) @@ -15,7 +17,7 @@ type AboutYaml struct { } func (ay AboutYaml) GetContent() template.HTML { - return template.HTML(ay.Content) + return template.HTML(strings.ReplaceAll(strings.ReplaceAll(ay.Content, "#age#", strconv.Itoa(ay.GetAge())), "#birth#", strconv.Itoa(ay.BirthYear))) } func (ay AboutYaml) GetAge() int {