diff --git a/.github/workflows/deploy-production.yaml b/.github/workflows/deploy-production.yaml index 90de9ae..ed3b219 100644 --- a/.github/workflows/deploy-production.yaml +++ b/.github/workflows/deploy-production.yaml @@ -27,5 +27,5 @@ jobs: sudo git config pull.ff only sudo git reset --hard sudo git pull - sudo ${TMP}/hugo -d /var/www/dimension.sh --gc -b https://dimension.sh/ + sudo ${TMP}/hugo --gc --minify --cleanDestinationDir --logLevel INFO -d /var/www/dimension.sh -b https://dimension.sh/ rm -rf ${TMP} diff --git a/Makefile b/Makefile index b6500a2..87298e4 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,15 @@ -serve: - hugo serve -D --gc -w -F +.PHONY: serve +serve: + hugo serve -D --gc -w -F --disableFastRender --printUnusedTemplates --printPathWarnings --bind 0.0.0.0 + +.PHONY: build +build: + HUGO_ENVIRONMENT=production HUGO_ENV=production hugo --gc --minify --cleanDestinationDir --logLevel INFO + +.PHONY: themedev +themedev: + hugo serve -D --gc -w -F --disableFastRender --bind 0.0.0.0 + +.PHONY: clean +clean: + rm -rf public resources \ No newline at end of file diff --git a/config.toml b/config.toml index 9a34043..26ebcfa 100644 --- a/config.toml +++ b/config.toml @@ -4,7 +4,7 @@ title = "dimension.sh" theme = "dimension" [params] -style = "nord" +style = "forest" [[params.styles]] name = "greenscreen" @@ -21,6 +21,15 @@ shortcode = "ND" [[params.styles]] name = "purple" shortcode = "PU" +[[params.styles]] +name = "tuna" +shortcode = "TU" +[[params.styles]] +name = "forest" +shortcode = "FO" +[[params.styles]] +name = "twine" +shortcode = "TW" [[params.links]] name = "HOME" diff --git a/themes/dimension/assets/scss/main.scss b/themes/dimension/assets/scss/main.scss new file mode 100644 index 0000000..29e70d5 --- /dev/null +++ b/themes/dimension/assets/scss/main.scss @@ -0,0 +1,180 @@ +:root { + --logo: var(--link); + --link-shadow: var(--bar); + --logo-shadow: var(--logo); +} + +html { + font-family: monospace; + font-size: 1.3em; + line-height: 1.2em; + background-color: var(--background); + color: var(--primary); +} + +div#logo { + text-align: center; + + pre { + display: inline-block; + text-align: left; + line-height: 1.1em; + margin-bottom: 0; + color: var(--logo); + text-shadow: 0 0 20px var(--logo-shadow), 0 0 30px var(--logo-shadow), 0 0 40px var(--logo-shadow), 0 0 55px var(--logo-shadow), 0 0 75px var(--logo-shadow); + } +} + +div.bar { + padding: 5px; + padding-left: 15px; + border-radius: 3px; +} + +div#footer { + margin-top: 10px; +} + +h1 { + text-transform: uppercase; +} + +hr { + border: 0; + height: 2px; +} + +div#main { + width: 100ch; + margin: 0 auto; +} + +div#body { + padding: 10px pre { + padding: 10px; + border-radius: 5px; + } +} + +li { + position: relative; + list-style: none; +} + +li:before { + content: "*"; + position: absolute; + left: -1.25em; +} + +ul.user-list { + display: flex; + flex-flow: row wrap; + list-style: none; + padding: 0; + + li { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + flex: 0 0 15%; + } + + li:before { + content: ""; + } +} + +input, +textarea { + font-family: input-mono, monospace; + font-size: 0.75em; + width: 100%; + border: 0; + border-radius: 3px; + padding: 5px; +} + +table { + text-align: left; + width: 100%; + padding: 5px; + border-radius: 5px; +} + +div.news h3 { + margin-bottom: 1px; +} + +/* Homepage Boxes */ +div.container { + display: flex; +} + +div#home-left { + width: 80%; + margin-right: 10px; +} + +/* Patchlog */ +div#patchlog { + font-size: 0.75em; + + p { + margin-top: 0px; + } +} + + + +b, +strong, +a, +a:link, +a:visited, +a:active, +h1, +h2, +h3, +h4, +h5, +label { + color: var(--link); +} + + + +a:hover { + color: var(--primary); +} + +hr, +div.bar { + background: var(--bar); + color: var(--primary); + box-shadow: 2px 2px var(--shadow); +} + +h1, +h2, +h3, +h4, +h5, +th, +label { + text-shadow: 2px 2px var(--link-shadow); +} + +input, +textarea { + background-color: var(--background); + color: var(--primary); + border: 1px solid var(--bar); +} + +table, +div#body pre { + border: 1px solid var(--bar); +} + +@import 'themes'; \ No newline at end of file diff --git a/themes/dimension/assets/scss/themes.scss b/themes/dimension/assets/scss/themes.scss new file mode 100644 index 0000000..432b17c --- /dev/null +++ b/themes/dimension/assets/scss/themes.scss @@ -0,0 +1,107 @@ +html[data-theme='dracula'] { + --background: #282936; + --shadow: #3a3c4e; + --bar: #4d4f68; + --primary: #e9e9f4; + --link: #00f769; + --logo: var(--link); +} + +html[data-theme='greenscreen'] { + --background: #001100; + --shadow: #003300; + --bar: #005500; + --link: #00ff00; + --primary: #00bb00; +} + +html[data-theme='nord'] { + --background: #2E3440; + --shadow: #3B4252; + --bar: #434C5E; + --primary: #E5E9F0; + --link: #8FBCBB; +} + +html[data-theme='palenight'] { + --background: #292D3E; + --shadow: #444267; + --bar: #32374D; + --logo: #676E95; + --primary: #959DCB; + --link: #FFFFFF; +} + +html[data-theme='purple'] { + --background: #001100; + --primary: #8575fb; + --link: #a296ff; + --shadow: #1a1153; + --bar: #3c3573; +} + +/* New Themes */ +html[data-theme='tuna'] { + $back: #35333B; + $for: #06B7AA; + + --background: #{$back}; + --primary: #{$for}; + --link: #{scale-color($for, $lightness: 25%)}; + --bar: #{scale-color($for, $lightness: -30%)}; + --shadow: #{scale-color($for, $lightness: -50%)}; + --link-shadow: #{scale-color($back, $lightness: 25%)}; + --logo-shadow: #{scale-color($for, $lightness: -25%)}; +} + +html[data-theme='twine'] { + $back: #371F03; + $for: #C9945B; + + --background: #{$back}; + --primary: #{$for}; + --link: #{scale-color($for, $lightness: 25%)}; + --bar: #{scale-color($for, $lightness: -30%)}; + --shadow: #{scale-color($for, $lightness: -50%)}; + --link-shadow: #{scale-color($back, $lightness: 25%)}; + --logo-shadow: #{scale-color($for, $lightness: -25%)}; +} + +html[data-theme='cerulean'] { + $for: #22AAD3; + $back: #0B2A4B; + + --background: #{$back}; + --primary: #{$for}; + --link: #{scale-color($for, $lightness: 25%)}; + --bar: #{scale-color($for, $lightness: -30%)}; + --shadow: #{scale-color($for, $lightness: -50%)}; + --link-shadow: #{scale-color($back, $lightness: 25%)}; + --logo-shadow: #{scale-color($for, $lightness: -25%)}; +} + +html[data-theme='razz'] { + $for: #FA1B67; + $back: #0E020E; + + --background: #{$back}; + --primary: #{$for}; + --link: #{scale-color($for, $lightness: 25%)}; + --bar: #{scale-color($for, $lightness: -30%)}; + --shadow: #{scale-color($for, $lightness: -50%)}; + --link-shadow: #{scale-color($back, $lightness: 25%)}; + --logo-shadow: #{scale-color($for, $lightness: -25%)}; +} + +html[data-theme='forest'] { + $for: #178D50; + $back: #090203; + + --background: #{$back}; + --primary: #{$for}; + --link: #{scale-color($for, $lightness: 25%)}; + --bar: #{scale-color($for, $lightness: -30%)}; + --shadow: #{scale-color($for, $lightness: -50%)}; + --link-shadow: var(--shadow); + --logo-shadow: #{scale-color($for, $lightness: 5%)}; +} \ No newline at end of file diff --git a/themes/dimension/layouts/_default/baseof.html b/themes/dimension/layouts/_default/baseof.html index 4178f61..fefbcd7 100644 --- a/themes/dimension/layouts/_default/baseof.html +++ b/themes/dimension/layouts/_default/baseof.html @@ -1,5 +1,5 @@ - + {{- partial "header.html" . -}}
diff --git a/themes/dimension/layouts/partials/css.html b/themes/dimension/layouts/partials/css.html new file mode 100644 index 0000000..77e9742 --- /dev/null +++ b/themes/dimension/layouts/partials/css.html @@ -0,0 +1,16 @@ +{{ $opts := dict +"transpiler" "libsass" +"targetPath" "css/dimension.css" +"enableSourceMap" (not hugo.IsProduction) +}} +{{- with resources.Get "scss/main.scss" }} +{{- if eq hugo.Environment "development" }} +{{- with . | toCSS $opts }} + +{{- end }} +{{- else }} +{{- with . | toCSS $opts | minify | fingerprint }} + +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/themes/dimension/layouts/partials/footer.html b/themes/dimension/layouts/partials/footer.html index d097aef..8d240b2 100644 --- a/themes/dimension/layouts/partials/footer.html +++ b/themes/dimension/layouts/partials/footer.html @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/themes/dimension/layouts/partials/header.html b/themes/dimension/layouts/partials/header.html index 64e40d1..1d8f4e1 100644 --- a/themes/dimension/layouts/partials/header.html +++ b/themes/dimension/layouts/partials/header.html @@ -23,7 +23,5 @@ {{ end -}} - - - + {{ partialCached "css.html" . }} \ No newline at end of file diff --git a/themes/dimension/static/css/campbell.css b/themes/dimension/static/css/campbell.css deleted file mode 100644 index 1820fd6..0000000 --- a/themes/dimension/static/css/campbell.css +++ /dev/null @@ -1,37 +0,0 @@ -html, body, tr, td { - background-color: #0C0C0C; - color: #CCCCCC; -} - -b, strong, a, a:link, a:visited, a:active, h3 { - color: #F2F2F2; -} - -div#logo pre { - color: #F2F2F2; - text-shadow: 0 0 5px white; -} - -a:hover { - color: #F9F1A5; -} - -hr, div.bar { - background: #767676; - color: #0C0C0C; - box-shadow: 2px 2px #3f435a; -} - -h1, h2, h3, h4, h5, th, label { - text-shadow: 2px 2px #616161; -} - -input, textarea { - background-color: #0C0C0C; - color: #CCCCCC; - border: 1px solid #767676; -} - -table, div#body pre { - border: 1px solid #767676; -} \ No newline at end of file diff --git a/themes/dimension/static/css/dracula.css b/themes/dimension/static/css/dracula.css deleted file mode 100644 index 9b9d5c3..0000000 --- a/themes/dimension/static/css/dracula.css +++ /dev/null @@ -1,56 +0,0 @@ -:root { - --base00: #282936; - --base01: #3a3c4e; - --base02: #4d4f68; - --base03: #626483; - --base04: #62d6e8; - --base05: #e9e9f4; - --base06: #f1f2f8; - --base07: #f7f7fb; - --base08: #ea51b2; - --base09: #b45bcf; - --base0A: #00f769; - --base0B: #ebff87; - --base0C: #a1efe4; - --base0D: #62d6e8; - --base0E: #b45bcf; - --base0F: #00f769; -} - -html, body, tr, td { - background-color: var(--base00); - color: var(--base05); -} - -b, strong, a, a:link, a:visited, a:active, h1, h2, h3, h4, h5, label { - color: var(--base0A); -} - -div#logo pre { - color: var(--base0A); - text-shadow: 0 0 20px var(--base07); -} - -a:hover { - color: var(--base05); -} - -hr, div.bar { - background: var(--base02); - color: var(--base05); - box-shadow: 2px 2px var(--base01); -} - -h1, h2, h3, h4, h5, th, label { - text-shadow: 2px 2px var(--base02); -} - -input, textarea { - background-color: var(--base00); - color: var(--base05); - border: 1px solid var(--base03); -} - -table, div#body pre { - border: 1px solid var(--base03); -} \ No newline at end of file diff --git a/themes/dimension/static/css/greenscreen.css b/themes/dimension/static/css/greenscreen.css deleted file mode 100644 index b66b688..0000000 --- a/themes/dimension/static/css/greenscreen.css +++ /dev/null @@ -1,56 +0,0 @@ -:root { - --base00: #001100; - --base01: #003300; - --base02: #005500; - --base03: #007700; - --base04: #009900; - --base05: #00bb00; - --base06: #00dd00; - --base07: #00ff00; - --base08: #007700; - --base09: #009900; - --base0A: #007700; - --base0B: #00bb00; - --base0C: #005500; - --base0D: #009900; - --base0E: #00bb00; - --base0F: #005500; -} - -html, body, tr, td { - background-color: var(--base00); - color: var(--base05); -} - -b, strong, a, a:link, a:visited, a:active, h1, h2, h3, h4, h5, label { - color: var(--base07); -} - -div#logo pre { - color: var(--base05); - text-shadow: 0 0 20px var(--base03), 0 0 30px var(--base03), 0 0 40px var(--base03), 0 0 55px var(--base03), 0 0 75px var(--base03); -} - -a:hover { - color: var(--base05); -} - -hr, div.bar { - background: var(--base02); - color: var(--base05); - box-shadow: 2px 2px var(--base01); -} - -h1, h2, h3, h4, h5, th, label { - text-shadow: 2px 2px var(--base02); -} - -input, textarea { - background-color: var(--base00); - color: var(--base05); - border: 1px solid var(--base03); -} - -table, div#body pre { - border: 1px solid var(--base03); -} \ No newline at end of file diff --git a/themes/dimension/static/css/icy.css b/themes/dimension/static/css/icy.css deleted file mode 100644 index 0af0e33..0000000 --- a/themes/dimension/static/css/icy.css +++ /dev/null @@ -1,57 +0,0 @@ -:root { - --base00: #021012; - --base01: #031619; - --base02: #041f23; - --base03: #052e34; - --base04: #064048; - --base05: #095b67; - --base06: #0c7c8c; - --base07: #109cb0; - --base08: #16c1d9; - --base09: #b3ebf2; - --base0A: #80deea; - --base0B: #4dd0e1; - --base0C: #26c6da; - --base0D: #00bcd4; - --base0E: #00acc1; - --base0F: #0097a7; -} - - -html, body, tr, td { - background-color: var(--base00); - color: var(--base05); -} - -b, strong, a, a:link, a:visited, a:active, h1, h2, h3, h4, h5, label { - color: var(--base0A); -} - -div#logo pre { - color: var(--base05); - text-shadow: 0 0 20px var(--base03), 0 0 30px var(--base03), 0 0 40px var(--base03), 0 0 55px var(--base03), 0 0 75px var(--base03); -} - -a:hover { - color: var(--base05); -} - -hr, div.bar { - background: var(--base02); - color: var(--base05); - box-shadow: 2px 2px var(--base01); -} - -h1, h2, h3, h4, h5, th, label { - text-shadow: 2px 2px var(--base02); -} - -input, textarea { - background-color: var(--base00); - color: var(--base05); - border: 1px solid var(--base03); -} - -table, div#body pre { - border: 1px solid var(--base03); -} \ No newline at end of file diff --git a/themes/dimension/static/css/nord.css b/themes/dimension/static/css/nord.css deleted file mode 100644 index 6339b30..0000000 --- a/themes/dimension/static/css/nord.css +++ /dev/null @@ -1,56 +0,0 @@ -:root { - --base00: #2E3440; - --base01: #3B4252; - --base02: #434C5E; - --base03: #4C566A; - --base04: #D8DEE9; - --base05: #E5E9F0; - --base06: #ECEFF4; - --base07: #8FBCBB; - --base08: #88C0D0; - --base09: #81A1C1; - --base0A: #5E81AC; - --base0B: #BF616A; - --base0C: #D08770; - --base0D: #EBCB8B; - --base0E: #A3BE8C; - --base0F: #B48EAD; -} - -html, body, tr, td { - background-color: var(--base00); - color: var(--base05); -} - -b, strong, a, a:link, a:visited, a:active, h1, h2, h3, h4, h5, label { - color: var(--base07); -} - -div#logo pre { - color: var(--base08); - text-shadow: 0 0 20px var(--base07); -} - -a:hover { - color: var(--base05); -} - -hr, div.bar { - background: var(--base02); - color: var(--base05); - box-shadow: 2px 2px var(--base01); -} - -h1, h2, h3, h4, h5, th, label { - text-shadow: 2px 2px var(--base02); -} - -input, textarea { - background-color: var(--base00); - color: var(--base05); - border: 1px solid var(--base03); -} - -table, div#body pre { - border: 1px solid var(--base03); -} \ No newline at end of file diff --git a/themes/dimension/static/css/palelight.css b/themes/dimension/static/css/palelight.css deleted file mode 100644 index 7c8a6ca..0000000 --- a/themes/dimension/static/css/palelight.css +++ /dev/null @@ -1,37 +0,0 @@ -html, body, tr, td { - background-color: #292D3E; - color: #676E95; -} - -b, strong, a, a:link, a:visited, a:active, h3 { - color: #959DCB; -} - -div#logo pre { - color: #959DCB; - text-shadow: 0 0 5px #C8C8C8; -} - -a:hover { - color: white; -} - -hr, div.bar { - background: #676E95; - color: #292D3E; - box-shadow: 2px 2px #3f435a; -} - -h1, h2, h3, h4, h5, th, label { - text-shadow: 2px 2px #3f435a; -} - -input, textarea { - background-color: #292D3E; - color: #676E95; - border: 1px solid #676E95; -} - -table, div#body pre { - border: 1px solid #676E95; -} \ No newline at end of file diff --git a/themes/dimension/static/css/palenight.css b/themes/dimension/static/css/palenight.css deleted file mode 100644 index 07edac1..0000000 --- a/themes/dimension/static/css/palenight.css +++ /dev/null @@ -1,57 +0,0 @@ - -:root { - --base00: #292D3E; - --base01: #444267; - --base02: #32374D; - --base03: #676E95; - --base04: #8796B0; - --base05: #959DCB; - --base06: #959DCB; - --base07: #FFFFFF; - --base08: #F07178; - --base09: #F78C6C; - --base0A: #FFCB6B; - --base0B: #C3E88D; - --base0C: #89DDFF; - --base0D: #82AAFF; - --base0E: #C792EA; - --base0F: #FF5370; -} - -html, body, tr, td { - background-color: var(--base00); - color: var(--base05); -} - -b, strong, a, a:link, a:visited, a:active, h1, h2, h3, h4, h5, label { - color: var(--base07); -} - -div#logo pre { - color: var(--base05); - text-shadow: 0 0 20px var(--base03), 0 0 30px var(--base03), 0 0 40px var(--base03), 0 0 55px var(--base03), 0 0 75px var(--base03); -} - -a:hover { - color: var(--base05); -} - -hr, div.bar { - background: var(--base02); - color: var(--base05); - box-shadow: 2px 2px var(--base01); -} - -h1, h2, h3, h4, h5, th, label { - text-shadow: 2px 2px var(--base02); -} - -input, textarea { - background-color: var(--base00); - color: var(--base05); - border: 1px solid var(--base03); -} - -table, div#body pre { - border: 1px solid var(--base03); -} \ No newline at end of file diff --git a/themes/dimension/static/css/purple.css b/themes/dimension/static/css/purple.css deleted file mode 100644 index d6b935b..0000000 --- a/themes/dimension/static/css/purple.css +++ /dev/null @@ -1,46 +0,0 @@ -:root { - --base00: #001100; - --base01: #181147; - --base02: #3c3573; - --base03: #8575fb; - --base05: #8575fb; - --base07: #a296ff; -} - -html, body, tr, td { - background-color: var(--base00); - color: var(--base05); -} - -b, strong, a, a:link, a:visited, a:active, h1, h2, h3, h4, h5, label { - color: var(--base07); -} - -div#logo pre { - color: var(--base05); - text-shadow: 0 0 20px var(--base03), 0 0 30px var(--base03), 0 0 40px var(--base03), 0 0 55px var(--base03), 0 0 75px var(--base03); -} - -a:hover { - color: var(--base05); -} - -hr, div.bar { - background: var(--base02); - color: var(--base05); - box-shadow: 2px 2px var(--base01); -} - -h1, h2, h3, h4, h5, th, label { - text-shadow: 2px 2px var(--base02); -} - -input, textarea { - background-color: var(--base00); - color: var(--base05); - border: 1px solid var(--base03); -} - -table, div#body pre { - border: 1px solid var(--base03); -} \ No newline at end of file diff --git a/themes/dimension/static/css/site.css b/themes/dimension/static/css/site.css deleted file mode 100644 index 58e8872..0000000 --- a/themes/dimension/static/css/site.css +++ /dev/null @@ -1,124 +0,0 @@ -html, body, tr, td { - font-family: input-mono, monospace; - font-size: 1em; -} - -@font-face { - font-family: Glass; - src: url(/font/glass.ttf) format("truetype"); -} - -div#logo { - text-align: center; -} - -div#logo pre { - font-family: Glass, input-mono, monospace; - display: inline-block; - text-align: left; - font-size: 1.3em; - line-height: 1; - margin-bottom: 0; -} - -div.bar { - padding: 5px; - padding-left: 15px; - border-radius: 3px; -} - -div#footer { - margin-top: 10px; -} - -h1 { - text-transform: uppercase; -} - -hr { - border: 0; - height: 2px; -} - -div#main { - width: 100ch; - margin: 0 auto; -} - -div#body { - padding: 10px -} - -div#body pre { - padding: 10px; - border-radius: 5px; -} - -li { - position: relative; - list-style: none; -} - -li:before { - content: "*"; - position: absolute; - left: -1.25em; - top: 0.15em; -} - -ul.user-list { - display: flex; - flex-flow: row wrap; - list-style: none; - padding: 0; -} - -ul.user-list li { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - flex: 0 0 15%; -} - -ul.user-list li:before { - content: ""; -} - -input, textarea { - font-family: input-mono, monospace; - font-size: 0.75em; - width: 100%; - border: 0; - border-radius: 3px; - padding: 5px; -} - -table { - text-align: left; - width: 100%; - padding: 5px; - border-radius: 5px; -} - -div.news h3 { - margin-bottom: 1px; -} - -/* Homepage Boxes */ -div.container { - display: flex; -} - -div#home-left { - width: 80%; - margin-right: 10px; -} - -/* Patchlog */ -div#patchlog { - font-size: 0.75em; -} - -div#patchlog p { - margin-top: 0px; -} \ No newline at end of file diff --git a/themes/dimension/static/font/glass.ttf b/themes/dimension/static/font/glass.ttf deleted file mode 100644 index ed8fd85..0000000 Binary files a/themes/dimension/static/font/glass.ttf and /dev/null differ diff --git a/themes/dimension/static/js/theme.js b/themes/dimension/static/js/theme.js index 0d8a9bf..4ed794e 100644 --- a/themes/dimension/static/js/theme.js +++ b/themes/dimension/static/js/theme.js @@ -3,7 +3,7 @@ // 1. Define a CSS document as a link with a id of 'theme' // 2. Call change_theme(name) from wherever -document.addEventListener('DOMContentLoaded', function(){ +document.addEventListener('DOMContentLoaded', function () { var prev_theme = localStorage.getItem("theme"); if (prev_theme != null) { change_theme(prev_theme); @@ -11,6 +11,6 @@ document.addEventListener('DOMContentLoaded', function(){ }, false); function change_theme(name) { - document.getElementById('theme').href = '/css/' + name + '.css'; + document.documentElement.setAttribute('data-theme', name) localStorage.setItem("theme", name); } \ No newline at end of file