From 6dff3357d95eaeaf550b036375481ef9feb1f40b Mon Sep 17 00:00:00 2001 From: bouncepaw Date: Sun, 24 Jan 2021 23:41:42 +0500 Subject: [PATCH] Move hypha tree to right, make hypha tabs look cuter --- http_readers.go | 3 +- templates/asset.qtpl.go | 33 ++++++---- templates/default.css | 33 ++++++---- templates/readers.qtpl | 11 ++-- templates/readers.qtpl.go | 133 +++++++++++++++++++------------------- 5 files changed, 117 insertions(+), 96 deletions(-) diff --git a/http_readers.go b/http_readers.go index 970200d..7978e69 100644 --- a/http_readers.go +++ b/http_readers.go @@ -106,7 +106,8 @@ func handlerPage(w http.ResponseWriter, rq *http.Request) { templates.PageHTML(rq, hyphaName, naviTitle(hyphaName), contents, - treeHTML, prevHypha, nextHypha, + treeHTML, + prevHypha, nextHypha, hasAmnt), u, openGraph)) diff --git a/templates/asset.qtpl.go b/templates/asset.qtpl.go index 95a984b..50bf182 100644 --- a/templates/asset.qtpl.go +++ b/templates/asset.qtpl.go @@ -25,26 +25,28 @@ func StreamDefaultCSS(qw422016 *qt422016.Writer) { //line templates/asset.qtpl:2 qw422016.N().S(`/* Layout stuff */ @media screen and (min-width: 800px) { - main { padding:1rem 2rem; margin: 0 auto; width: 800px; } - .hypha-tabs { padding: 1rem 2rem; margin: 0 auto; width: 800px; } - header { margin: 0 auto; width: 800px; } + main { padding:1rem 2rem; margin: 0 auto; min-width: 500px; max-width: 800px; border-radius: .25rem; } + .hypha-tabs { padding: 1rem 2rem; margin: 0 auto; min-width: 500px; max-width: 800px; } + header { width: 100%; } + .header-links { margin: 0 auto; min-width: 500px; max-width: 800px; } .header-links__entry { margin-right: 1.5rem; } .header-links__entry_user { margin: 0 2rem 0 auto; } .header-links__entry:nth-of-type(1), .hypha-tabs__tab:nth-of-type(1) { margin-left: 2rem; } - .hypha-tabs__tab { margin-right: 1.5rem; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2); border-bottom: 2px #ddd solid; padding: 0 .5rem; } + .hypha-tabs__tab { padding: 0 .5rem; border-radius: .25rem .25rem 0 0; border: 1px #ddd solid; border-bottom: 2px #ddd solid; } + .three-col { display: grid; grid-template-columns: 1fr auto 1fr; column-gap: 1rem; } + main { grid-column: 2 / span 1; grid-row: 1 / span 2; } + .relative-hyphae { grid-column: 3 / span 1; grid-row: 1 / span 1; min-width: 10rem; max-width: 20rem; } } @media screen and (max-width: 800px) { main { padding: 1rem; margin: 0; width: 100%; } .hypha-tabs{ padding: 1rem; margin: 0; width: 100%; } .hypha-tabs__tab { box-shadow: none; margin-right: .5rem; padding: .25rem .5rem; } - header { width: 100%; } .header-links__entry { margin-right: .5rem; } } *, *::before, *::after {box-sizing: border-box;} html { height:100%; padding:0; } body {height:100%; margin:0; font-size:16px; font-family: 'PT Sans', 'Liberation Sans', sans-serif;} -main {border-radius: 0 0 .25rem .25rem; } main > form {margin-bottom:1rem;} textarea {font-size:16px; font-family: 'PT Sans', 'Liberation Sans', sans-serif;} .edit_no-preview {height:100%;} @@ -142,9 +144,14 @@ article .codeblock, .prevnext__el, table { background-color: #eee; } +.hypha-tabs__tab { background-color: #eee; } +.hypha-tabs__tab { clip-path: inset(-20px -20px 0 -20px); } +.hypha-tabs__tab a { color: black; } +.hypha-tabs__tab_active { border-bottom: 2px white solid; background: white; } + @media screen and (max-width: 800px) { - .hypha-tabs { background-color: white; } - .hypha-tabs__tab { box-shadow: none; } + .hypha-tabs, + .hypha-tabs__tab { background-color: white; } } /* Other stuff */ @@ -154,11 +161,7 @@ background-image: url("data:image/svg+xml,%3Csvg width='42' height='44' viewBox= header { background-color: #bbb; } .header-links__link { color: black; } .header-links__link:hover { background-color: #eee; } - -main, .hypha-tabs__tab { background-color: white; } -.hypha-tabs__tab { clip-path: inset(-20px -20px 0 -20px); } -.hypha-tabs__tab a { color: black; } -.hypha-tabs__tab_active { border-bottom: 2px white solid; } +main { background-color: white; } blockquote { border-left: 4px black solid; } .wikilink_new {color:#a55858;} @@ -206,6 +209,10 @@ mark { background: rgba(130, 80, 30, 5); color: inherit; } } } +.layout-card { background-color: white; border-radius: .25rem; } +.layout-card__title { font-size: 1rem; margin: 0; padding: .25rem .5rem; background-color: #eee; border-radius: .25rem .25rem 0 0; } + + `) //line templates/asset.qtpl:2 qw422016.N().S(` diff --git a/templates/default.css b/templates/default.css index 0d1ccda..fc7e7e5 100644 --- a/templates/default.css +++ b/templates/default.css @@ -1,25 +1,27 @@ /* Layout stuff */ @media screen and (min-width: 800px) { - main { padding:1rem 2rem; margin: 0 auto; width: 800px; } - .hypha-tabs { padding: 1rem 2rem; margin: 0 auto; width: 800px; } - header { margin: 0 auto; width: 800px; } + main { padding:1rem 2rem; margin: 0 auto; min-width: 500px; max-width: 800px; border-radius: .25rem; } + .hypha-tabs { padding: 1rem 2rem; margin: 0 auto; min-width: 500px; max-width: 800px; } + header { width: 100%; } + .header-links { margin: 0 auto; min-width: 500px; max-width: 800px; } .header-links__entry { margin-right: 1.5rem; } .header-links__entry_user { margin: 0 2rem 0 auto; } .header-links__entry:nth-of-type(1), .hypha-tabs__tab:nth-of-type(1) { margin-left: 2rem; } - .hypha-tabs__tab { margin-right: 1.5rem; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2); border-bottom: 2px #ddd solid; padding: 0 .5rem; } + .hypha-tabs__tab { padding: 0 .5rem; border-radius: .25rem .25rem 0 0; border: 1px #ddd solid; border-bottom: 2px #ddd solid; } + .three-col { display: grid; grid-template-columns: 1fr auto 1fr; column-gap: 1rem; } + main { grid-column: 2 / span 1; grid-row: 1 / span 2; } + .relative-hyphae { grid-column: 3 / span 1; grid-row: 1 / span 1; min-width: 10rem; max-width: 20rem; } } @media screen and (max-width: 800px) { main { padding: 1rem; margin: 0; width: 100%; } .hypha-tabs{ padding: 1rem; margin: 0; width: 100%; } .hypha-tabs__tab { box-shadow: none; margin-right: .5rem; padding: .25rem .5rem; } - header { width: 100%; } .header-links__entry { margin-right: .5rem; } } *, *::before, *::after {box-sizing: border-box;} html { height:100%; padding:0; } body {height:100%; margin:0; font-size:16px; font-family: 'PT Sans', 'Liberation Sans', sans-serif;} -main {border-radius: 0 0 .25rem .25rem; } main > form {margin-bottom:1rem;} textarea {font-size:16px; font-family: 'PT Sans', 'Liberation Sans', sans-serif;} .edit_no-preview {height:100%;} @@ -117,9 +119,14 @@ article .codeblock, .prevnext__el, table { background-color: #eee; } +.hypha-tabs__tab { background-color: #eee; } +.hypha-tabs__tab { clip-path: inset(-20px -20px 0 -20px); } +.hypha-tabs__tab a { color: black; } +.hypha-tabs__tab_active { border-bottom: 2px white solid; background: white; } + @media screen and (max-width: 800px) { - .hypha-tabs { background-color: white; } - .hypha-tabs__tab { box-shadow: none; } + .hypha-tabs, + .hypha-tabs__tab { background-color: white; } } /* Other stuff */ @@ -129,11 +136,7 @@ background-image: url("data:image/svg+xml,%3Csvg width='42' height='44' viewBox= header { background-color: #bbb; } .header-links__link { color: black; } .header-links__link:hover { background-color: #eee; } - -main, .hypha-tabs__tab { background-color: white; } -.hypha-tabs__tab { clip-path: inset(-20px -20px 0 -20px); } -.hypha-tabs__tab a { color: black; } -.hypha-tabs__tab_active { border-bottom: 2px white solid; } +main { background-color: white; } blockquote { border-left: 4px black solid; } .wikilink_new {color:#a55858;} @@ -181,3 +184,7 @@ mark { background: rgba(130, 80, 30, 5); color: inherit; } } } +.layout-card { background-color: white; border-radius: .25rem; } +.layout-card__title { font-size: 1rem; margin: 0; padding: .25rem .5rem; background-color: #eee; border-radius: .25rem .25rem 0 0; } + + diff --git a/templates/readers.qtpl b/templates/readers.qtpl index a9d7304..7b8521c 100644 --- a/templates/readers.qtpl +++ b/templates/readers.qtpl @@ -28,8 +28,9 @@ {% endfunc %} If `contents` == "", a helpful message is shown instead. -{% func PageHTML(rq *http.Request, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName string, hasAmnt bool) %} +{% func PageHTML(rq *http.Request, hyphaName, naviTitle, contents, relatives, prevHyphaName, nextHyphaName string, hasAmnt bool) %} {%= navHTML(rq, hyphaName, "page") %} +
{%s= naviTitle %} @@ -60,8 +61,10 @@ If `contents` == "", a helpful message is shown instead. {% endif %} -
+ +
{% endfunc %} diff --git a/templates/readers.qtpl.go b/templates/readers.qtpl.go index e93927b..bb22baa 100644 --- a/templates/readers.qtpl.go +++ b/templates/readers.qtpl.go @@ -144,7 +144,7 @@ func RevisionHTML(rq *http.Request, hyphaName, naviTitle, contents, tree, revHas // If `contents` == "", a helpful message is shown instead. //line templates/readers.qtpl:31 -func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName string, hasAmnt bool) { +func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, relatives, prevHyphaName, nextHyphaName string, hasAmnt bool) { //line templates/readers.qtpl:31 qw422016.N().S(` `) @@ -152,105 +152,106 @@ func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, navi streamnavHTML(qw422016, rq, hyphaName, "page") //line templates/readers.qtpl:32 qw422016.N().S(` +
`) -//line templates/readers.qtpl:35 +//line templates/readers.qtpl:36 qw422016.N().S(naviTitle) -//line templates/readers.qtpl:35 +//line templates/readers.qtpl:36 qw422016.N().S(` `) -//line templates/readers.qtpl:36 +//line templates/readers.qtpl:37 if contents == "" { -//line templates/readers.qtpl:36 +//line templates/readers.qtpl:37 qw422016.N().S(`

This hypha has no text. Why not create it?

`) -//line templates/readers.qtpl:38 +//line templates/readers.qtpl:39 } else { -//line templates/readers.qtpl:38 +//line templates/readers.qtpl:39 qw422016.N().S(` `) -//line templates/readers.qtpl:39 +//line templates/readers.qtpl:40 qw422016.N().S(contents) -//line templates/readers.qtpl:39 +//line templates/readers.qtpl:40 qw422016.N().S(` `) -//line templates/readers.qtpl:40 +//line templates/readers.qtpl:41 } -//line templates/readers.qtpl:40 +//line templates/readers.qtpl:41 qw422016.N().S(`
`) -//line templates/readers.qtpl:43 +//line templates/readers.qtpl:44 if prevHyphaName != "" { -//line templates/readers.qtpl:43 +//line templates/readers.qtpl:44 qw422016.N().S(` `) -//line templates/readers.qtpl:45 +//line templates/readers.qtpl:46 } -//line templates/readers.qtpl:45 +//line templates/readers.qtpl:46 qw422016.N().S(` `) -//line templates/readers.qtpl:46 +//line templates/readers.qtpl:47 if nextHyphaName != "" { -//line templates/readers.qtpl:46 +//line templates/readers.qtpl:47 qw422016.N().S(` `) -//line templates/readers.qtpl:48 +//line templates/readers.qtpl:49 } -//line templates/readers.qtpl:48 +//line templates/readers.qtpl:49 qw422016.N().S(`
`) -//line templates/readers.qtpl:50 +//line templates/readers.qtpl:51 if u := user.FromRequest(rq); !user.AuthUsed || u.Group != "anon" { -//line templates/readers.qtpl:50 +//line templates/readers.qtpl:51 qw422016.N().S(`
`) -//line templates/readers.qtpl:54 +//line templates/readers.qtpl:55 if hasAmnt { -//line templates/readers.qtpl:54 +//line templates/readers.qtpl:55 qw422016.N().S(` Unattach current attachment? `) -//line templates/readers.qtpl:56 +//line templates/readers.qtpl:57 } -//line templates/readers.qtpl:56 +//line templates/readers.qtpl:57 qw422016.N().S(`
@@ -258,44 +259,46 @@ func StreamPageHTML(qw422016 *qt422016.Writer, rq *http.Request, hyphaName, navi
`) -//line templates/readers.qtpl:62 +//line templates/readers.qtpl:63 } -//line templates/readers.qtpl:62 +//line templates/readers.qtpl:63 qw422016.N().S(` -
+ +
`) -//line templates/readers.qtpl:67 +//line templates/readers.qtpl:70 } -//line templates/readers.qtpl:67 -func WritePageHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName string, hasAmnt bool) { -//line templates/readers.qtpl:67 +//line templates/readers.qtpl:70 +func WritePageHTML(qq422016 qtio422016.Writer, rq *http.Request, hyphaName, naviTitle, contents, relatives, prevHyphaName, nextHyphaName string, hasAmnt bool) { +//line templates/readers.qtpl:70 qw422016 := qt422016.AcquireWriter(qq422016) -//line templates/readers.qtpl:67 - StreamPageHTML(qw422016, rq, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName, hasAmnt) -//line templates/readers.qtpl:67 +//line templates/readers.qtpl:70 + StreamPageHTML(qw422016, rq, hyphaName, naviTitle, contents, relatives, prevHyphaName, nextHyphaName, hasAmnt) +//line templates/readers.qtpl:70 qt422016.ReleaseWriter(qw422016) -//line templates/readers.qtpl:67 +//line templates/readers.qtpl:70 } -//line templates/readers.qtpl:67 -func PageHTML(rq *http.Request, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName string, hasAmnt bool) string { -//line templates/readers.qtpl:67 +//line templates/readers.qtpl:70 +func PageHTML(rq *http.Request, hyphaName, naviTitle, contents, relatives, prevHyphaName, nextHyphaName string, hasAmnt bool) string { +//line templates/readers.qtpl:70 qb422016 := qt422016.AcquireByteBuffer() -//line templates/readers.qtpl:67 - WritePageHTML(qb422016, rq, hyphaName, naviTitle, contents, tree, prevHyphaName, nextHyphaName, hasAmnt) -//line templates/readers.qtpl:67 +//line templates/readers.qtpl:70 + WritePageHTML(qb422016, rq, hyphaName, naviTitle, contents, relatives, prevHyphaName, nextHyphaName, hasAmnt) +//line templates/readers.qtpl:70 qs422016 := string(qb422016.B) -//line templates/readers.qtpl:67 +//line templates/readers.qtpl:70 qt422016.ReleaseByteBuffer(qb422016) -//line templates/readers.qtpl:67 +//line templates/readers.qtpl:70 return qs422016 -//line templates/readers.qtpl:67 +//line templates/readers.qtpl:70 }