minor improvements to the site look and feel
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 25 Mar 2024 20:40:42 +0000 (15:40 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 25 Mar 2024 20:40:42 +0000 (15:40 -0500)
onyx-pkg.kdl
www/static/css/new_style.css
www/static/images/header-background.png
www/templates/pages/homepage.html
www/templates/partials/logo_svg.html

index 229a4627bcc4fdbbd5f921388dadcdecb3cb4f85..003aa8b359ad563470d40ece258ef5fa65c9e0b6 100644 (file)
@@ -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" 
     }
 }
index bdc10ec632001a2eccff77a7172670643404de0f..08f8ae88a6179dfad4936120e3fee712736d72d0 100644 (file)
@@ -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;
 }
 
index 0a114f7018b8401ec4dd6d2bd4cd99e2f909a7f8..61300e91e7d98c45e45c18c3eecd998878fbab0c 100644 (file)
Binary files a/www/static/images/header-background.png and b/www/static/images/header-background.png differ
index 6be55b1abaf473475684fff534c0456493592dae..0becada77b057e3fad3eaf7943de8c392dcd4e9c 100644 (file)
@@ -20,7 +20,7 @@
                 <h1>The <b>Onyx</b> Programming Language</h1>
             </div>
             <div style="font-size: 20pt; text-align: center; margin-top: 8px">
-                <p>A data-oriented, expressive, and modern programming language</p>
+                <p>A type-safe, expressive, and data-oriented programming language</p>
             </div>
         </div>
 
@@ -76,12 +76,6 @@ factorial :: (n: i32) -> i32 {
 </div>
 
 <div>
-    <div>
-        <h2>Type Safety</h2>
-        <br />
-        <p>Onyx is <b>strictly</b> type-checked. However, the type-inference systems in Onyx usually allow you to omit types.</p>
-    </div>
-
     <pre class="hljs"><code class="language-onyx">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));
 }
 </code></pre>
 
+    <div>
+        <h2>Type Safety</h2>
+        <br />
+        <p>Onyx is <b>strictly</b> type-checked. However, the type-inference systems in Onyx usually allow you to omit types.</p>
+    </div>
+
 </div>
 
 <div>
@@ -105,7 +106,8 @@ main :: () {
         <p>Onyx's compiler is written entirely in C and features incredibly fast compilation. The web-server for this website was compiled in <b>47 milliseconds</b>.</p>
     </div>
 
-    <pre class="hljs"><code class="language-sh">$ onyx build -V -r wasi -DWASIX -o site.wasm build.onyx
+    <pre class="hljs"><code class="language-sh">$ 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</code></pre>
 </div>
 
 <div>
-    <div>
-        <h2>WebAssembly</h2>
-        <br />
-        <p>Onyx compiles solely to <a href="https://webassembly.org">WebAssembly</a>. You can use a builtin WebAssembly runtime using <code>onyx run</code>, or compile to WASM and run using a WebAssembly runner, like Wasmer or Wasmtime.</p>
-    </div>
-
     <pre class="hljs"><code># 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!
 </code></pre>
+
+    <div>
+        <h2>WebAssembly</h2>
+        <br />
+        <p>Onyx compiles solely to <a href="https://webassembly.org">WebAssembly</a>. You can use a builtin WebAssembly runtime using <code>onyx run</code>, or compile to WASM and run using a WebAssembly runner, like Wasmer or Wasmtime.</p>
+    </div>
+
 </div>
 
 <div>
     <div>
         <h2>C-FFI</h2>
         <br />
-        <p>Onyx features built-in support for linking to native C-libraries.</p>
+        <p>Onyx features built-in support for linking to native C-libraries on Linux and MacOS.</p>
     </div>
 
     <pre class="hljs"><code class="language-onyx">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);
 }</code></pre>
 </div>
+</div>
 
-<div>
-    <div>
-        <h2>More examples</h2>
-        <br />
-        <p>See more complete examples on the <a href="/examples">Examples</a> page.</p>
+<div class="container">
+    <div class="title">
+        <h2>Examples</h2>
     </div>
-</div>
+    <p>Learn more from complete examples on the <a href="/examples">Examples</a> page.</p>
 </div>
 
 <div class="container">
@@ -254,7 +257,7 @@ for(var PERLIN_YWRAPB=4,PERLIN_YWRAP=1<<PERLIN_YWRAPB,PERLIN_ZWRAPB=8,PERLIN_ZWR
 
         canvas.width = rect.width;
         canvas.height = rect.height;
-        ctx.fillStyle = '#060609';
+        ctx.fillStyle = '#0b0b12';
         ctx.fillRect(0, 0, rect.width, rect.height);
     }
 
@@ -290,7 +293,8 @@ for(var PERLIN_YWRAPB=4,PERLIN_YWRAP=1<<PERLIN_YWRAPB,PERLIN_ZWRAPB=8,PERLIN_ZWR
 
                 if (y > 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)`);
             }
         }
index fec6d7eaec4913adc5e94cff187844c80256d81b..9e2cfed57747a2084b591a7cfad28538b29977d5 100644 (file)
@@ -8,22 +8,22 @@
 <g id="layer1">
 <path
    id="path31"
-   style="fill:#4d4d4d;fill-rule:evenodd;stroke-width:0.0293746"
+   style="fill:#40404d;fill-rule:evenodd;stroke-width:0.0293746"
    d="M 11.763289,3.914572 1.3881028,9.8522703 a 0.10746311,0.10746311 90.000426 0 0 -1.4e-6,0.1865377 l 4.9883072,2.854897 A 0.32624697,0.32624697 164.99998 0 0 6.8203814,12.774742 L 11.900221,4.0525466 A 0.10062399,0.10062399 45.217132 0 0 11.763289,3.914572 Z" />
 <path
    id="path537"
-   style="fill:#333333;fill-rule:evenodd;stroke-width:0.029419"
+   style="fill:#2d2d33;fill-rule:evenodd;stroke-width:0.029419"
    d="M 12.162827,4.0018649 6.9729475,12.886067 a 0.0504192,0.0504192 45.290639 0 0 0.068524,0.06922 l 5.1227994,-2.923284 a 0.32119605,0.32119605 120.14455 0 0 0.162004,-0.2789709 l 0,-5.7069276 a 0.08771164,0.08771164 15.146085 0 0 -0.163448,-0.044243 z" />
 <path
    id="path1180"
-   style="fill:#999999;fill-rule:evenodd;stroke-width:0.0295315"
+   style="fill:#929299;fill-rule:evenodd;stroke-width:0.0295315"
    d="m 1.0890783,3.6985577 v 5.6525366 a 0.22068576,0.22068576 30.240095 0 0 0.329423,0.1920375 L 11.783187,3.6743435 a 0.08679074,0.08679074 75.240095 0 0 -0.04276,-0.1623148 l -10.4648157,0 a 0.18652896,0.18652896 135 0 0 -0.186529,0.186529 z" />
 <path
    id="path1062"
-   style="fill:#4d4d4d;fill-rule:evenodd;stroke-width:0.029571"
+   style="fill:#40404d;fill-rule:evenodd;stroke-width:0.029571"
    d="M 6.4864206,0.28046515 1.4340775,3.1336232 a 0.08682156,0.08682156 75.272862 0 0 0.042693,0.1624213 H 11.967016 a 0.04985456,0.04985456 104.72714 0 0 0.02452,-0.093265 L 6.8167272,0.28046515 a 0.33586257,0.33586257 6.6844583e-7 0 0 -0.3303066,0 z" />
 <path
-   style="fill:#ffffff;stroke-width:0.109606"
+   style="fill:#ddddff;stroke-width:0.109606"
    id="path67"
    d="m 46.304138,13.61792 -1.100363,0.615114 -1.082886,-0.645386 0.01748,-1.2605 1.100363,-0.615113 1.082886,0.645385 z"
    transform="matrix(0.14795386,0,0,0.14795386,5.4827192,1.6710591)" />