From 823dc85b17e80f3b40156c9e745f75c6892053ce Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Thu, 23 Nov 2023 22:49:42 -0600 Subject: [PATCH] totally new site design --- src/app.onyx | 21 ++- www/static/css/new_style.css | 175 +++++++++++------- www/static/robots.txt | 5 + www/static/vendor/highlight.min.css | 84 ++++++++- www/templates/pages/base.html | 6 +- www/templates/pages/docs/env_setup.html | 41 ++-- www/templates/pages/docs/getting_started.html | 8 +- www/templates/pages/docs/install.html | 33 ++-- www/templates/pages/homepage.html | 68 ++++--- www/templates/partials/footer.html | 4 +- www/templates/partials/navbar.html | 6 +- www/templates/partials/news_listing.html | 8 +- 12 files changed, 311 insertions(+), 148 deletions(-) create mode 100644 www/static/robots.txt diff --git a/src/app.onyx b/src/app.onyx index 8734e06..15712ce 100644 --- a/src/app.onyx +++ b/src/app.onyx @@ -8,6 +8,7 @@ use core.encoding.json #inject runtime.vars { Enable_Heap_Debug :: true // Debug :: true + CGI_MODE :: true } reg: otmp.TemplateRegistry; @@ -49,6 +50,13 @@ reg: otmp.TemplateRegistry; @route.{.GET, "/docs/getting_started"} (req: &Req, res: &Res) => res->render("pages/docs/getting_started", null); +@route.{.GET, "/robots.txt"} +(req: &Req, res: &Res) { + res->file("./www/static/robots.txt"); + res->status(200); + res->end(); +} + Article :: struct { name, description, path, date: str } news_articles: Cached_Resource([] Article); @@ -143,12 +151,17 @@ main :: () { logger := http.server.logger(style=.V2); pipes->pipe(&logger); - app := http.server.tcp(pipes, .{ thread_count = 0 }); + #if #defined(runtime.vars.CGI_MODE) { + http.server.cgi(pipes); - port := conv.parse_int(os.env("SERVER_PORT") ?? "8000"); + } else { + app := http.server.tcp(pipes, .{ thread_count = 8 }); + + port := conv.parse_int(os.env("SERVER_PORT") ?? "8000"); - app->serve(~~port); - println("Server stopping..."); + app->serve(~~port); + println("Server stopping..."); + } } diff --git a/www/static/css/new_style.css b/www/static/css/new_style.css index 384e11d..32a7946 100644 --- a/www/static/css/new_style.css +++ b/www/static/css/new_style.css @@ -5,21 +5,19 @@ } .ui-theme { - --terminal-background-color: #303033; - --terminal-foreground-color: #ffffff; - - --background-color: #f0f0f5; - --light-background-color: #e0e0e6; - --dark-background-color: var(--header-color); - --active-color: #cccccc; - - --header-color: #303033; + --header-color: linear-gradient(var(--accent-background) 0, var(--background) 70%); --header-text: #ffffff; - --header-accent: #505055; + --header-accent: #606080; - --link-color: #448; - --visited-link-color: #669; - --foreground-color: #000000; + --footer-color: linear-gradient(var(--background), var(--accent-background)); + + --text: #ffffff; + --background: #060609; + --accent-background: #181824; + --primary: #45476e; + --secondary: #494957; + --accent: #00fffb; + --accent-text: #000000; } @media (min-width: 800px) { @@ -37,31 +35,54 @@ } body { - background: var(--background-color); - color: var(--foreground-color); + background: var(--background); + color: var(--text); - font-family: "system-ui", sans-serif; + font-family: 'Oxanium', sans-serif; } a { - color: var(--link-color); + color: var(--text); text-decoration: none; } a.link-button { padding: 8px; + border-radius: 4px; text-decoration: none; - background-color: var(--light-background-color); + background-color: var(--primary); transition: all 300ms; + position: relative; + top: 0; } a.link-button:hover { - background-color: var(--active-color); + top: -6px; + box-shadow: 0 6px 15px 8px rgba(200, 200, 230, 0.2); cursor: pointer; } a:visited { - color: var(--visited-link-color); + color: var(--text); +} + +a.cta-button { + flex: 1; + border-radius: 8px; + padding: 16px; + font-size: 16pt; + background-color: var(--secondary); + color: var(--text); + box-shadow: 0px 3px 12px 2px rgba(200, 200, 230, 0.2); + position: relative; + top: 0; + transition: all 0.2s; +} + +a.cta-button:hover { + top: -6px; + box-shadow: 0 6px 15px 8px rgba(200, 200, 230, 0.2); + cursor: pointer; } .container { @@ -94,13 +115,22 @@ a:visited { text-align: center; } -.container.dark { - background: var(--dark-background-color); - color: var(--header-text); +.container.card > * { + background: #000; + box-shadow: 0px 7px 41px 30px rgba(200, 200, 230, 0.2); + border-radius: 8px; + border: 1px solid var(--primary); + padding: 8px; } -.container.light { - background: var(--light-background-color); +.container .title:after { + content: ""; + height: 2px; + background: linear-gradient(to right, var(--primary), var(--background)); + display: block; + max-width: 1200px; + margin: 0 auto; + margin-bottom: 32px; /* This is large because of margin collapse. */ } .container.header { @@ -166,19 +196,25 @@ code { } p code { - background: var(--terminal-background-color); - color: var(--terminal-foreground-color); border-radius: 4px; padding: 2px; } +@font-face { + font-family: fira; + src: url(../font/FiraCode-Regular.woff); +} + /* Navigation */ @media screen and (min-width: 800px) { .navbar-container { - background: var(--header-color); - color: var(--header-text); + position: sticky; + top: 0; + z-index: 1000; + background-color: var(--accent-background); + color: var(--text); width: 100%; } @@ -191,7 +227,7 @@ p code { @media screen and (max-width: 799px) { .navbar-container { - background: var(--header-color); + background-color: var(--accent-background); color: var(--header-text); width: 100%; @@ -201,7 +237,7 @@ p code { navbar { - background: var(--header-color); + background: none; color: var(--header-text); padding: 0 12px; @@ -274,7 +310,7 @@ navbar a { } .hamburger-piece { - background-color: var(--foreground-color); + background-color: var(--text); margin-bottom: 4px; height: 4px; width: 32px; @@ -285,6 +321,10 @@ navbar a { /* Footer */ +.container:has(.footer-container) { + background: var(--footer-color); +} + .footer-container { display: flex; flex-direction: var(--default-flex-direction); @@ -302,40 +342,14 @@ navbar a { -.panel-container { - display: flex; - flex-direction: var(--default-flex-direction); - justify-content: space-between; - width: 100%; - gap: 24px; -} - -.panel-container div { - flex-basis: 0; - flex-grow: 1; - - padding: 12px 0; -/* background-color: var(--background-color);*/ -} - -.panel-container div h3 { - margin-bottom: 4px; -} - -.panel-container div p { - width: 100%; - text-align: justify; -} - - main { min-height: 100vh; } main pre { - border: 0px solid var(--dark-background-color); + border: 1px solid var(--primary); border-radius: 6px; - box-shadow: 0px 1px 6px 1px rgba(0, 0, 0, 0.2); + box-shadow: 0px 7px 41px 30px rgba(200, 200, 230, 0.2); padding: 8px; display: block; overflow-y: auto; @@ -370,12 +384,13 @@ main li { display: none; } - #desktop_logo:hover #path67 { transform: matrix(0.147954, 0, 0, 0.147954, 35, 9); } + /* #desktop_logo:hover #path67 { transform: matrix(0.147954, 0, 0, 0.147954, 35, 9); } */ #desktop_logo:hover #path31 { transform: translate(21.5px, -2.5px) rotate(60deg); } #desktop_logo:hover #path1180 { transform: translate(34.25px, 7px) rotate(120deg); } #desktop_logo:hover #path537 { transform-origin: center; transform: rotate(150deg) translate(17px, -4.3px); } #desktop_logo:hover #path1062 { transform: translate(36px, 2px) rotate(90deg); } - #desktop_logo :not(#layer2) path { transition: all 1s ease-in-out; } + #desktop_logo:hover path {fill: white !important;} + #desktop_logo path { transition: all 1s ease-in-out; } } @media (max-width: 799px) { @@ -391,7 +406,37 @@ main li { } } -@font-face { - font-family: fira; - src: url(../font/FiraCode-Regular.woff); +#install-command .copy-button { + opacity: 0; + display: inline; + width: 20px; + border-radius: 4px; + background: var(--accent); + color: var(--accent-text); + padding: 0px 4px; + cursor: pointer; + transition: all 0.2s; + font-family: 'Oxanium', sans-serif; +} + +#install-command:hover .copy-button { + opacity: 1; } + +::-webkit-scrollbar{ + width: 8px; +} + +::-webkit-scrollbar-track-piece{ + background-color: var(--background); +} + +::-webkit-scrollbar-thumb{ + background-color: var(--secondary); + border-radius: 5px; +} + +::-webkit-scrollbar-thumb:hover{ + background-color: var(--primary); +} + diff --git a/www/static/robots.txt b/www/static/robots.txt new file mode 100644 index 0000000..48d737c --- /dev/null +++ b/www/static/robots.txt @@ -0,0 +1,5 @@ +User-agent: Googlebot +Disallow: /nogooglebot/ + +User-agent: * +Allow: / diff --git a/www/static/vendor/highlight.min.css b/www/static/vendor/highlight.min.css index 3ced357..79db195 100644 --- a/www/static/vendor/highlight.min.css +++ b/www/static/vendor/highlight.min.css @@ -68,7 +68,7 @@ * Author: Nicolas LLOBERA */ -.hljs { +/* .hljs { background: #1E1E1E; color: #DCDCDC; } @@ -151,10 +151,6 @@ font-weight: bold; } -/*.hljs-code { - font-family:'Monospace'; -}*/ - .hljs-bullet, .hljs-selector-tag, .hljs-selector-id, @@ -174,4 +170,82 @@ background-color: #600; display: inline-block; width: 100%; +} */ + +/*! + Theme: a11y-dark + Author: @ericwbailey + Maintainer: @ericwbailey + + Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css +*/ +/* + IR_Black style (c) Vasily Mikhailitchenko +*/ + +.hljs { + background: #000; + color: #f8f8f8; +} + +.hljs-comment, +.hljs-quote, +.hljs-meta { + color: #7c7c7c; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-tag, +.hljs-name { + color: #96cbfe; +} + +.hljs-attribute, +.hljs-selector-id { + color: #ffffb6; +} + +.hljs-string, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-addition { + color: #a8ff60; +} + +.hljs-subst { + color: #daefa3; } + +.hljs-regexp, +.hljs-link { + color: #e9c062; +} + +.hljs-title, +.hljs-section, +.hljs-type, +.hljs-doctag { + color: #ffffb6; +} + +.hljs-symbol, +.hljs-bullet, +.hljs-variable, +.hljs-template-variable, +.hljs-literal { + color: #c6c5fe; +} + +.hljs-number, +.hljs-deletion { + color:#ff73fd; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} \ No newline at end of file diff --git a/www/templates/pages/base.html b/www/templates/pages/base.html index dd5329c..24cbf29 100644 --- a/www/templates/pages/base.html +++ b/www/templates/pages/base.html @@ -1,5 +1,5 @@ - + {% block "title" %} @@ -12,6 +12,10 @@ + + + + {{endblock}} diff --git a/www/templates/partials/footer.html b/www/templates/partials/footer.html index 1e8635d..c32c740 100644 --- a/www/templates/partials/footer.html +++ b/www/templates/partials/footer.html @@ -1,8 +1,8 @@ -