diff --git a/docs/system.dj b/docs/system.dj index 1f603f2..6402cc1 100644 --- a/docs/system.dj +++ b/docs/system.dj @@ -44,7 +44,9 @@ With that said, there are several types of values in haku that can be passed int - `fn` - a function, as returned by `(fn (x) x)` literals. - `list` - a list of values, where each value can have a different type (even `list` itself.) - `shape` - a mathematical shape. + - `shape-like` - anything that can be turned into a `shape` using `to-shape`. + - `scribble` - something that can be drawn on the wall. Additionally, the syntax `(type-a type-b ...)` may be used to signify that one of the listed types is accepted or returned. @@ -122,8 +124,10 @@ Whether two values are considered equal depends on their type: - If the type of the two values differs, `false` is returned. - If the two values are `number`s: + - If any of the values are `NaN`, `false` is returned. - Otherwise `true` is returned if the two numbers have the exact same bit representation. + - If the two values are `vec`s, `true` is returned if each of their `number` components is equal to each other using the rules above. - Likewise with `rgba`s. - All other types of values use _reference_ equality - `true` is returned only if `a` and `b` are located in the same place in memory. diff --git a/scripts/mkicon.fish b/scripts/mkicon.fish new file mode 100755 index 0000000..5fbca61 --- /dev/null +++ b/scripts/mkicon.fish @@ -0,0 +1,7 @@ +#!/usr/bin/env fish + +set filename $argv[1] +set icon_name (basename $filename .svg) +set icon_base64 (svgcleaner --stdout $filename 2>/dev/null | base64 -w0) + +printf "--icon-%s: url('data:image/svg+xml;base64,%s');" "$icon_name" "$icon_base64" diff --git a/static/base.css b/static/base.css index 3e7b62d..9f7a4a6 100644 --- a/static/base.css +++ b/static/base.css @@ -10,9 +10,6 @@ --color-panel-background: #fff; --color-shaded-background: rgba(0, 0, 0, 5%); - --panel-border-radius: 16px; - --panel-box-shadow: 0 0 0 1px var(--color-panel-border); - --panel-padding: 12px; --dialog-backdrop: rgba(255, 255, 255, 0.5); } @@ -102,7 +99,7 @@ input { } *:focus { - outline: 1px solid #40b1f4; + outline: 1px solid var(--color-brand-blue); outline-offset: 4px; } @@ -164,12 +161,15 @@ rkgk-throbber { /* Panels */ .rkgk-panel { + --panel-border-radius: 8px; + display: block; background: var(--color-panel-background); - padding: var(--panel-border-radius); border: none; - border-radius: 16px; - box-shadow: var(--panel-box-shadow); + border-radius: var(--panel-border-radius); + box-shadow: + 0 0 0 1px var(--color-panel-border); + /* 4px 4px 0 0 var(--color-panel-border); */ box-sizing: border-box; } @@ -194,3 +194,23 @@ pre:has(code) { padding: 1em 1em; } +/* Icons */ + +:root { + --icon-rkgk-grayscale: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHdpZHRoPSIxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBkPSJtMCAwaDE2djE2aC0xNnoiLz48L2NsaXBQYXRoPjxnIGNsaXAtcGF0aD0idXJsKCNhKSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjIiPjxwYXRoIGQ9Im0xMiAxNy00LjU1Mjc5LTkuMTA1NTdjLS42NjQ5LTEuMzI5ODEuMzAyMDktMi44OTQ0MyAxLjc4ODg2LTIuODk0NDNoOC43NjM5MyIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjxnIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0ibTUuNSAxMi0yLjUgNSIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW9wYWNpdHk9Ii41Ii8+PHBhdGggZD0ibTMgNWgxIi8+PC9nPjwvZz48L3N2Zz4='); + --icon-external-link: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHdpZHRoPSIxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBzdHJva2U9IiMwMDAiPjxwYXRoIGQ9Im0xMC41IDl2Mi41aC02di02aDIuNSIvPjxwYXRoIGQ9Im03IDkgNC41LTQuNW0wIDBoLTMuNW0zLjUgMHYzLjUiLz48L2c+PC9zdmc+'); +} + +.icon { + display: inline-block; + vertical-align: middle; + width: 16px; + height: 16px; + + background-repeat: no-repeat; + background-position: 50% 50%; + + &.icon-rkgk-grayscale { background-image: var(--icon-rkgk-grayscale); } + &.icon-external-link { background-image: var(--icon-external-link); } +} + diff --git a/static/brush-editor.js b/static/brush-editor.js index df8cffe..a36a174 100644 --- a/static/brush-editor.js +++ b/static/brush-editor.js @@ -31,6 +31,7 @@ export class BrushEditor extends HTMLElement { ); }); requestAnimationFrame(() => this.#resizeTextArea()); + document.fonts.addEventListener("loadingdone", () => this.#resizeTextArea()); this.errorHeader = this.appendChild(document.createElement("h1")); this.errorHeader.classList.add("error-header"); diff --git a/static/favicon/rkgk@16x.png b/static/favicon/rkgk@16x.png new file mode 100644 index 0000000..9689c5f Binary files /dev/null and b/static/favicon/rkgk@16x.png differ diff --git a/static/favicon/rkgk@1x.png b/static/favicon/rkgk@1x.png new file mode 100644 index 0000000..8f92483 Binary files /dev/null and b/static/favicon/rkgk@1x.png differ diff --git a/static/favicon/rkgk@2x.png b/static/favicon/rkgk@2x.png new file mode 100644 index 0000000..64e3477 Binary files /dev/null and b/static/favicon/rkgk@2x.png differ diff --git a/static/favicon/rkgk@32x.png b/static/favicon/rkgk@32x.png new file mode 100644 index 0000000..2512193 Binary files /dev/null and b/static/favicon/rkgk@32x.png differ diff --git a/static/favicon/rkgk@4x.png b/static/favicon/rkgk@4x.png new file mode 100644 index 0000000..0ec9078 Binary files /dev/null and b/static/favicon/rkgk@4x.png differ diff --git a/static/favicon/rkgk@8x.png b/static/favicon/rkgk@8x.png new file mode 100644 index 0000000..80e590d Binary files /dev/null and b/static/favicon/rkgk@8x.png differ diff --git a/static/icon/external-link.svg b/static/icon/external-link.svg new file mode 100644 index 0000000..120c573 --- /dev/null +++ b/static/icon/external-link.svg @@ -0,0 +1,4 @@ + + + + diff --git a/static/icon/rkgk-grayscale.svg b/static/icon/rkgk-grayscale.svg new file mode 100644 index 0000000..02feb5c --- /dev/null +++ b/static/icon/rkgk-grayscale.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/static/index.css b/static/index.css index a20c2a4..27e1918 100644 --- a/static/index.css +++ b/static/index.css @@ -123,6 +123,8 @@ rkgk-reticle-cursor { /* Brush editor */ rkgk-brush-editor { + padding: 12px; + &>.text-area { display: block; width: 100%; @@ -187,3 +189,50 @@ rkgk-connection-status { } } } + +/* Menu bar */ + +.menu-bar { + --border-radius: 4px; + + display: flex; + box-sizing: border-box; + + width: fit-content; + height: 24px; + border-radius: var(--border-radius); + + &>a { + display: block; + + color: var(--color-text); + padding: 4px 8px; + text-decoration: none; + + &:hover { + background-color: var(--color-shaded-background); + } + + &.icon { + padding: 4px 4px; + } + + &:first-child { + border-top-left-radius: var(--border-radius); + border-bottom-left-radius: var(--border-radius); + } + + &:last-child { + border-top-right-radius: var(--border-radius); + border-bottom-right-radius: var(--border-radius); + } + } + + &>hr { + height: 100%; + margin: 0; + border: none; + border-right: 1px solid var(--color-panel-border); + } +} + diff --git a/static/index.html b/static/index.html index ad4fd92..c39a0ea 100644 --- a/static/index.html +++ b/static/index.html @@ -24,6 +24,19 @@ + + + + + + + + + + + + + @@ -31,6 +44,11 @@
+