From: Brendan Hansen Date: Mon, 25 Mar 2024 20:40:42 +0000 (-0500) Subject: minor improvements to the site look and feel X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=fc4c2f9cbca0dabfc98294f3a2b7da5167b9de22;p=onyxlang.io.git minor improvements to the site look and feel --- diff --git a/onyx-pkg.kdl b/onyx-pkg.kdl index 229a462..003aa8b 100644 --- a/onyx-pkg.kdl +++ b/onyx-pkg.kdl @@ -12,7 +12,7 @@ config { } dependencies { - http-server "0.3.1" git="https://github.com/onyx-lang/pkg-http-server" + http-server "0.3.5" git="https://github.com/onyx-lang/pkg-http-server" otmp "0.0.36" git="https://github.com/onyx-lang/pkg-otmp" } @@ -26,6 +26,7 @@ build { target "site.wasm" runtime "wasi" source "build.onyx" + args "--multi-threaded" define "WASIX" "CGI_MODE" } } diff --git a/www/static/css/new_style.css b/www/static/css/new_style.css index bdc10ec..08f8ae8 100644 --- a/www/static/css/new_style.css +++ b/www/static/css/new_style.css @@ -12,7 +12,7 @@ --footer-color: linear-gradient(var(--background), var(--accent-background)); --text: #ffffff; - --background: #060609; + --background: #0b0b12; --accent-background: #181824; --primary: #45476e; --secondary: #494957; @@ -118,8 +118,8 @@ a.cta-button:hover { } .container.card > * { - background: linear-gradient(135deg, #000, var(--accent-background)); - box-shadow: 0px 5px 24px 12px rgba(150, 150, 230, 0.2); + background: linear-gradient(135deg, var(--background), var(--accent-background)); + box-shadow: 0px 3px 16px 8px rgba(150, 150, 230, 0.2); border-radius: 8px; border: 1px solid var(--primary); padding: 8px; @@ -170,6 +170,10 @@ h1 { font-size: 3rem; } +h2:not(:first-child) { + padding-top: 3rem; +} + h2 { font-size: 2rem; } @@ -267,8 +271,10 @@ navbar div { navbar a span { display: inline-block; - padding: 12px 24px; + margin: 4px; + padding: 8px 20px; transition: all 0.3s; + border-radius: 4px; } navbar a span.active { @@ -278,6 +284,7 @@ navbar a span.active { navbar a span:hover { cursor: pointer; background-color: var(--header-accent); + box-shadow: 0px 3px 16px 8px rgba(150, 150, 230, 0.2); } navbar a:visited { @@ -362,10 +369,10 @@ main { } main pre { - background: linear-gradient(135deg, #000, var(--accent-background)); + background: linear-gradient(135deg, var(--background), var(--accent-background)); border: 1px solid var(--primary); border-radius: 6px; - box-shadow: 0px 5px 24px 12px rgba(150, 150, 230, 0.2); + box-shadow: 0px 3px 16px 8px rgba(150, 150, 230, 0.2); padding: 8px; display: block; overflow-y: auto; @@ -473,37 +480,27 @@ main li { } .scrollport > * { - margin-top: 6em; + margin-top: 4em; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: center; + align-items: center; + gap: 32px; } -/* -@media screen and (min-width: 800px) { - .scrollport { - mask-image: linear-gradient(to right, #0000 0, #000 10%, #000 90%, #0000 100%); - -webkit-mask-image: linear-gradient(to right, #0000 0, #000 10%, #000 90%, #0000 100%); - - overflow-x: auto; - overscroll-behavior-x: contain; - - display: flex; - gap: 100px; - align-items: start; - padding: 0 100px; - padding-bottom: 32px; - } - - .scrollport > div { - min-width: 1000px; - } +.scrollport > * > * { + min-width: 500px; + flex: 1; } -*/ + table { border-radius: 8px; border: 1px solid var(--accent); width: 100%; background: linear-gradient(135deg, #000, var(--accent-background)); - box-shadow: 0px 5px 24px 12px rgba(150, 150, 230, 0.2); + box-shadow: 0px 3px 16px 8px rgba(150, 150, 230, 0.2); margin-top: 24px !important; } diff --git a/www/static/images/header-background.png b/www/static/images/header-background.png index 0a114f7..61300e9 100644 Binary files a/www/static/images/header-background.png and b/www/static/images/header-background.png differ diff --git a/www/templates/pages/homepage.html b/www/templates/pages/homepage.html index 6be55b1..0becada 100644 --- a/www/templates/pages/homepage.html +++ b/www/templates/pages/homepage.html @@ -20,7 +20,7 @@

The Onyx Programming Language

-

A data-oriented, expressive, and modern programming language

+

A type-safe, expressive, and data-oriented programming language

@@ -76,12 +76,6 @@ factorial :: (n: i32) -> i32 {
-
-

Type Safety

-
-

Onyx is strictly type-checked. However, the type-inference systems in Onyx usually allow you to omit types.

-
-
use core { printf }
 
 main :: () {
@@ -91,11 +85,18 @@ main :: () {
     // Function with entirely inferred types.
     change_value :: x => x + 10;
 
-    // Onyx figures out the types of `change_value` when you call it.
+    // Onyx figures out the types of
+    // `change_value` when you call it.
     printf("The value is {}.\n", change_value(x));
 }
 
+
+

Type Safety

+
+

Onyx is strictly type-checked. However, the type-inference systems in Onyx usually allow you to omit types.

+
+
@@ -105,7 +106,8 @@ main :: () {

Onyx's compiler is written entirely in C and features incredibly fast compilation. The web-server for this website was compiled in 47 milliseconds.

-
$ onyx build -V -r wasi -DWASIX -o site.wasm build.onyx
+    
$ onyx build -V build.onyx
+
 File search path:
 	/home/brendan/.onyx
 	.
@@ -117,19 +119,13 @@ Tagged global size: 8 bytes.
 
 Statistics:
     Time taken: 47.000000 ms
-    Processed 22144 lines (471148.937500 lines/second).
-    Processed 115240 tokens (2451915.000000 tokens/second).
+    Processed 22144 lines
+    Processed 115240 tokens 
 
 Outputting to WASM file:   site.wasm
-
-

WebAssembly

-
-

Onyx compiles solely to WebAssembly. You can use a builtin WebAssembly runtime using onyx run, or compile to WASM and run using a WebAssembly runner, like Wasmer or Wasmtime.

-
-
# Compile and run directly.
 $ onyx run hello.onyx
 Hello, World!
@@ -141,36 +137,43 @@ $ onyx build -r wasi -o hello.wasm hello.onyx
 $ wasmer run hello.wasm
 Hello, World!
 
+ +
+

WebAssembly

+
+

Onyx compiles solely to WebAssembly. You can use a builtin WebAssembly runtime using onyx run, or compile to WASM and run using a WebAssembly runner, like Wasmer or Wasmtime.

+
+

C-FFI


-

Onyx features built-in support for linking to native C-libraries.

+

Onyx features built-in support for linking to native C-libraries on Linux and MacOS.

use core {*}
 
-// Using #dyncall dynamically loads the library at runtime.
+// Using #dyncall dynamically loads
+// the library at runtime using dlopen().
 #foreign #dyncall "libc.so" {
-    write :: (fd: i32, data: [&] u8, count: i32) -> i32 ---
+    write :: (fd: i32, msg: [] u8) -> i32 ---
 }
 
 main :: () {
     msg: [] u8 = "Hello, libc!";
 
-    write(1, msg.data, msg.length);
+    write(1, msg);
 }
+ -
-
-

More examples

-
-

See more complete examples on the Examples page.

+
+
+

Examples

-
+

Learn more from complete examples on the Examples page.

@@ -254,7 +257,7 @@ for(var PERLIN_YWRAPB=4,PERLIN_YWRAP=1< 11 && (y + x % 11 + x % 3) - 16 > x % 6) continue; let v = noise.get(x / 10, y / 10, Date.now() / 2500) * 3 - 1.5; - let r = 6 * (1 - v) + 56 * v; + let r = 12 * (1 - v) + 60 * v; + r = Math.max(12, Math.min(60, r)); drawHex(x, y, `rgba(${r}, ${r}, ${r * 1.5}, 1)`); } } diff --git a/www/templates/partials/logo_svg.html b/www/templates/partials/logo_svg.html index fec6d7e..9e2cfed 100644 --- a/www/templates/partials/logo_svg.html +++ b/www/templates/partials/logo_svg.html @@ -8,22 +8,22 @@