From afd92d3654df08586892c831ac58f75350b0e54b Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Tue, 25 Jun 2019 14:24:13 +0200 Subject: Minor design improvements --- assets/style.css | 2 +- css/main.scss | 39 ++++++++++++++++++++++++++++++++------- template.go | 9 +++++---- 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/assets/style.css b/assets/style.css index f02e070..5289287 100644 --- a/assets/style.css +++ b/assets/style.css @@ -1 +1 @@ -@font-face{font-family:'Iosevka Term SS03';font-style:normal;font-weight:normal;src:url("/iosevka-term-ss03-regular.woff2") format("woff2"),url("/iosevka-term-ss03-regular.woff") format("woff")}body{margin:0;padding:0;background-color:#14171a;color:#cad1d8;font-family:"Iosevka Term SS03","IBM Plex Mono","Fira Code","Fira Mono","Roboto Mono","Droid Sans Mono",Monaco,Consolas,Courier,monospace;font-size:1.0625em;line-height:1.5}h1,h2,h3,h4,h5,h6{font:inherit;color:#fff;margin:0}button{background:none;border:0;padding:0;color:#fff;font:inherit;text-decoration:underline;cursor:pointer}button:focus{outline:1px dotted currentColor}img{display:inline-block;vertical-align:top;max-width:8em;margin:.1em 0}img::selection{background-color:rgba(239,198,138,0.35)}img.expanded{max-width:40em;max-width:80ch}img.faded{opacity:.5}strong{font-weight:normal}::selection{color:#000;background-color:rgba(239,198,138,0.996)}:link{color:#fff}:visited{color:#cad1d8}:link:hover,:visited:hover{color:#fff}.novisit{color:#fff}.header-base{display:flex;flex-flow:row wrap;align-items:center;justify-content:space-between;border-bottom:1px solid #353a3f}.header{padding:.9em 1em;color:#5d646a}.location{color:#5d646a}.location__prefix{color:#5d646a}.location__prefix:hover{color:#fff}.location__uripart{color:#fff}.location__uripart+.location__slash+.location__uripart{color:#cad1d8}.location__uripart:link:hover,.location__uripart:visited:hover{color:#fff}.wrap{text-align:center}.content{display:inline-block;min-width:50em;min-width:85ch;margin:0;padding:2em 1em;text-align:left;font:inherit}.type-annotation{color:#929ba3}.modal{position:fixed;top:0;left:0;z-index:100;display:none;width:100%;height:100%;box-sizing:border-box;padding:2em;background-color:rgba(0,0,0,0.75)}.modal--visible{display:block}.modal__content{max-width:30em;padding:1.5em 1.8em;margin:0 auto;background-color:#14171a;box-shadow:0 .3em 2em #000;text-align:left}.modal__head{padding-bottom:.75em;margin-bottom:1.5em}.modal__title{padding-right:1em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-transform:uppercase}.setting{display:flex;flex-direction:row;align-items:baseline;justify-content:space-between}.setting::after{order:2;flex:0 99999 auto;display:block;width:100%;height:0;margin:0 .5em;border-bottom:2px dotted #353a3f;content:''}.setting__label{order:1}.setting__value{order:3}#none{position:fixed;top:0;left:0;width:0;height:0}@media screen and (max-width: 800px){.location__uripart ~ *{display:none}.modal{padding:1em}.modal__content{padding:1em 1.3em}} +@font-face{font-family:'Iosevka Term SS03';font-style:normal;font-weight:normal;src:url("/iosevka-term-ss03-regular.woff2") format("woff2"),url("/iosevka-term-ss03-regular.woff") format("woff")}body{margin:0;padding:0;background-color:#14171a;color:#cad1d8;font-family:"Iosevka Term SS03","IBM Plex Mono","Fira Code","Fira Mono","Roboto Mono","Droid Sans Mono",Monaco,Consolas,Courier,monospace;font-size:1.0625em;line-height:1.5}h1,h2,h3,h4,h5,h6{font:inherit;color:#fff;margin:0}button{background:none;border:0;padding:0;color:#fff;font:inherit;text-decoration:underline;cursor:pointer}button:focus{outline:1px dotted currentColor}img{display:inline-block;vertical-align:top;max-width:8em;margin:.1em 0}img::selection{background-color:rgba(239,198,138,0.35)}img.expanded{max-width:40em;max-width:80ch}img.faded{opacity:.5}strong{font-weight:normal}::selection{color:#000;background-color:rgba(239,198,138,0.996)}:link{color:#fff}:visited{color:#cad1d8}:link:hover,:visited:hover{color:#fff}.novisit{color:#fff}.header-base{display:flex;flex-direction:row;align-items:center;justify-content:space-between;border-bottom:1px solid #353a3f}.header{padding:.9em 1em;color:#5d646a}.location{flex:0 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-right:.5em;color:#5d646a}.location__prefix{margin-right:.3em;color:#5d646a}.location__prefix:hover{color:#fff}.location__slash{margin:0 .3em}.location__uripart{color:#fff}.location__uripart+.location__slash+.location__uripart{color:#cad1d8}.location__uripart:link:hover,.location__uripart:visited:hover{color:#fff}.actions{flex:0 0 auto}.actions :visited{color:#fff}.wrap{text-align:center}.content{display:inline-block;min-width:50em;min-width:85ch;margin:0;padding:2em 1em;text-align:left;font:inherit}.type-annotation{color:#929ba3}.modal{position:fixed;top:0;left:0;z-index:100;display:none;width:100%;height:100%;box-sizing:border-box;padding:2em;background-color:rgba(0,0,0,0.75)}.modal--visible{display:block}.modal__content{max-width:30em;padding:1.5em 1.8em;margin:0 auto;background-color:#14171a;box-shadow:0 .3em 2em #000;text-align:left}.modal__head{padding-bottom:.75em;margin-bottom:1.5em}.modal__title{padding-right:1em;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;text-transform:uppercase}.setting{display:flex;flex-direction:row;align-items:baseline;justify-content:space-between}.setting::after{order:2;flex:1 1 auto;display:block;height:0;margin:0 .5em;border-bottom:2px dotted #353a3f;content:''}.setting__label{order:1}.setting__value{order:3}#none{position:fixed;top:0;left:0;width:0;height:0}@media screen and (max-width: 800px){body{font-size:1em}.modal{padding:1em}.modal__content{padding:1em 1.3em}}@media screen and (max-width: 500px){.location__prefix{display:none}} diff --git a/css/main.scss b/css/main.scss index 7d673f6..72500d2 100644 --- a/css/main.scss +++ b/css/main.scss @@ -112,7 +112,7 @@ strong { .header-base { display: flex; - flex-flow: row wrap; + flex-direction: row; align-items: center; justify-content: space-between; border-bottom: 1px solid $border; @@ -128,16 +128,26 @@ strong { // .location { - color: $text-faint; + flex: 0 1 auto; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + margin-right: .5em; + color: $text-faint; &__prefix { - color: $text-faint; + margin-right: .3em; + color: $text-faint; &:hover { color: $text-plus; } } + &__slash { + margin: 0 .3em; + } + &__uripart { color: $text-plus; @@ -156,6 +166,16 @@ strong { // +.actions { + flex: 0 0 auto; + + :visited { + color: $link-idle; + } +} + +// + .wrap { text-align: center; } @@ -227,9 +247,8 @@ strong { &::after { order: 2; - flex: 0 99999 auto; + flex: 1 1 auto; display: block; - width: 100%; height: 0; margin: 0 .5em; border-bottom: 2px dotted $border; @@ -258,8 +277,8 @@ strong { // @media screen and (max-width: 800px) { - .location__uripart ~ * { - display: none; + body { + font-size: 1em; } .modal { @@ -270,3 +289,9 @@ strong { padding: 1em 1.3em; } } + +@media screen and (max-width: 500px) { + .location__prefix { + display: none; + } +} diff --git a/template.go b/template.go index ac7f674..cdef279 100644 --- a/template.go +++ b/template.go @@ -27,11 +27,12 @@ var tpltext = ` {{- $uriParts = $uriParts | pop -}} {{- end -}} - {{ range $i, $part := $uriParts -}} + + {{- range $i, $part := $uriParts -}} {{- if ne $i 1 -}} {{- $href = printf "%s/%s" $href . -}} {{- if ne $i 0 -}} - / + / {{- end -}} {{ . }} {{- else -}} @@ -39,11 +40,11 @@ var tpltext = ` {{- end -}} {{- end -}} {{- if ne (len $uriParts) 0 -}} - / + / {{- end -}} {{ $uriLast -}} -
+
{{- if not .Lines }}View raw | {{ end -}}
-- cgit v1.2.3-70-g09d2