From 3183a3616b8afdb8eda2a5be11bb70786c74b98f Mon Sep 17 00:00:00 2001 From: Midou Date: Thu, 15 Jun 2023 17:28:21 +0100 Subject: [PATCH] Initial CSS work. This is somewhat different but it should be close to GitHub's layout. --- public/css/global.css | 51 +++++++++++++++++++++++++++++++++++++------ views/wiki.html | 38 ++++++++++++++++++++++---------- 2 files changed, 70 insertions(+), 19 deletions(-) diff --git a/public/css/global.css b/public/css/global.css index e4fd442..9fea7cf 100644 --- a/public/css/global.css +++ b/public/css/global.css @@ -6,12 +6,14 @@ --secondary-background: #353535; --background-darker: #151515; --accent: #00b7c3; - --yellow: #8B8000; + --yellow: #8b8000; color-scheme: dark; } body { - font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif; + font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, + helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, + sans-serif; color: var(--text); background-color: var(--background-darker); transition: ease-in-out 0.25s; @@ -32,6 +34,9 @@ main { margin: 0 24vw; } +#wrap { + display: flex; +} .navbar { display: flex; align-items: center; @@ -73,7 +78,9 @@ main { background-color: var(--background); padding: 8px; border-radius: 4px; - font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif; + font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, + helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, + sans-serif; color: var(--text); } @@ -95,7 +102,9 @@ a:hover { background-color: var(--yellow); padding: 8px; border-radius: 4px; - font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif; + font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, + helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, + sans-serif; color: var(--text); } @@ -111,7 +120,8 @@ a:hover { /* URI: /explore */ -.explore-card, .user-repo-card { +.explore-card, +.user-repo-card { background-color: var(--background); padding: 8px; border-radius: 4px; @@ -125,7 +135,8 @@ a:hover { transition: ease-in-out 0.25s; } -.explore-card:hover, .user-repo-card:hover { +.explore-card:hover, +.user-repo-card:hover { background-color: var(--secondary-background); color: var(--text); } @@ -267,6 +278,23 @@ a:hover { background-color: var(--secondary-background); } +/* Overwrite */ + +.no-margin { + margin: 0; +} + +.no-padding { + padding: 0; +} + +.float-right { + float: right; + display: grid; + flex: none; + align-self: flex-start; +} + @media screen and (prefers-color-scheme: light) { :root { --text: #000; @@ -294,6 +322,15 @@ a:hover { margin: 8px; } + #wrap { + display: inline-grid; + } + + .float-right { + float: none; + display: inline-grid; + } + .navbar-slogan { display: none; } @@ -313,5 +350,5 @@ a:hover { } } .cl { - padding-left: 8px + padding-left: 8px; } diff --git a/views/wiki.html b/views/wiki.html index 9485def..5a26d91 100644 --- a/views/wiki.html +++ b/views/wiki.html @@ -1,18 +1,32 @@ {{ template "header" .}} -
+ +
{{ if .wiki }} {{ range $key, $value := .wiki}} -

RepoUser: {{.RepoUser}}

-

RepoName: {{.RepoName}}

-

Title: {{.Title}}

-

LastEdit: {{.LastEdit}}

-

LastEditor: {{.LastEditor}}

-

RevisionNum: {{.RevisionNum}}

-

PageNum: {{.PageNum}}

-

Sidebar: {{.Sidebar}}

-

Content:

- {{ unescape .PageContent }} - {{ end }} {{ else }} +
+
+

{{.Title}}

+

{{.RepoUser}}/{{.RepoName}}

+

+ {{.LastEditor}} edited this page on {{.LastEdit}} ยท {{.RevisionNum}} revisions +

+
+
+ {{ unescape .PageContent }} +
+
+
+

{{.PageNum}} pages

+
+ {{ range $key, $value := .Sidebar }} +
+

{{.Name}}

+ {{end}} +
+
+
+ {{ end }} + {{ else }}

Wiki not found

That wiki doesn't exist.

{{ end }}