From 721a1f74a47d88d23d868f641bb606316c9e5a58 Mon Sep 17 00:00:00 2001 From: alyx Date: Thu, 2 Jun 2022 17:53:39 +0000 Subject: homepage, typing, check June 6 changelog --- grapher/index.html | 2 +- grapher/pl/index.html | 1 + index.html | 70 ++++++++++++++++++------- lib/types.js | 82 ++++++++++++++++++++++++++++- pwathings/appver.json | 2 +- searcher/index.html | 2 +- style.css | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++ types.html | 25 +++++++++ 8 files changed, 301 insertions(+), 25 deletions(-) create mode 100644 style.css create mode 100644 types.html diff --git a/grapher/index.html b/grapher/index.html index 9b05e23..3c88bad 100644 --- a/grapher/index.html +++ b/grapher/index.html @@ -4,7 +4,7 @@ - + CV2 Node Graph Generator diff --git a/grapher/pl/index.html b/grapher/pl/index.html index 7a728b9..73f047b 100644 --- a/grapher/pl/index.html +++ b/grapher/pl/index.html @@ -3,6 +3,7 @@ + Permalinked Graph diff --git a/index.html b/index.html index 26592e1..7ad034e 100644 --- a/index.html +++ b/index.html @@ -1,23 +1,53 @@ - - Placeholder - - - - - - - + + + + + Aleteoryx's CV2Utils + + + + + + + + +

Welcome to CV2Utils!

+

+ This is a little project of mine. + Below you'll find a collection of tools for understanding and explaining CV2, as well as playing with it out-of-game. + This site is in a perpetual state of work-in-progress, but there's a changelog below, too. +

+ +
+
+

June 6, 2022 - The Three Clicks Edition

+
+
    +
  • Built a proper homepage.
  • +
      +
    • Revamped the install code.
    • +
    • Added Changelog
    • +
    +
  • Continued work on type inference logic.
  • +
      +
    • You can view it at types.html, by opening the DevTools console.
    • +
    • The actual logic is contained in /lib/types.js.
    • +
    +
+
+
+ \ No newline at end of file diff --git a/lib/types.js b/lib/types.js index ed83f12..3e37424 100644 --- a/lib/types.js +++ b/lib/types.js @@ -1,4 +1,82 @@ //Gods-awful type-checking logic. -//TypeName: string, Params: Array|Object -function workOutType() \ No newline at end of file +//TypeName: string, Params: Array +function Type(TypeName,Params=[]) { + this.typename = ""; + this.mode = ""; + //Union/Tuple + if (/^\(.+\)$/.test(TypeName)) { + const types = []; + var depth = 0; + var workspace = ""; + for (const c of /^\((.+)\)$/.exec(TypeName)[1]) { + switch (c) { + case '(': + case '<': + depth++; + break; + case ')': + case '>': + depth--; + break; + case ',': + if (depth == 0) { + this.mode = "tuple"; + types.push(workspace); + workspace = ""; + continue; + } + break; + case '|': + if (depth == 0) { + this.mode = "union"; + types.push(workspace); + workspace = ""; + continue; + } + break; + } + workspace += c; + } + if (workspace) types.push(workspace); + this.template = types.map(t => t.trim()).map(t => ["any", ...Params].includes(t) ? t : new Type(t, Params)); + + } + //Template + else if (/^[^<]+<.+>$/.test(TypeName)) { + this.typename = /^([^<]+)$/.exec(TypeName)[1]) { + switch (c) { + case '(': + case '<': + depth++; + break; + case ')': + case '>': + depth--; + break; + case ',': + if (depth == 0) { + types.push(workspace); + workspace = ""; + continue; + } + break; + } + workspace += c; + } + if (workspace) types.push(workspace); + this.template = types.map(t => t.trim()).map(t => ["any", ...Params].includes(t) ? t : new Type(t, Params)); + } + //Standard Type + else if (/^[^()|<>,]+$/.test(TypeName)) { + this.typename = TypeName; + this.mode = "standard" + } + + this.params = Object.fromEntries(Params.map(p => [p, 'any'])); +} \ No newline at end of file diff --git a/pwathings/appver.json b/pwathings/appver.json index 669fb74..d7cf647 100644 --- a/pwathings/appver.json +++ b/pwathings/appver.json @@ -1,3 +1,3 @@ { - "ver": 1 + "ver": 2 } \ No newline at end of file diff --git a/searcher/index.html b/searcher/index.html index e02fabb..963c74b 100644 --- a/searcher/index.html +++ b/searcher/index.html @@ -4,7 +4,7 @@ - + CV2 Chip Searcher diff --git a/style.css b/style.css new file mode 100644 index 0000000..d8f884f --- /dev/null +++ b/style.css @@ -0,0 +1,142 @@ +@import url('https://fonts.googleapis.com/css2?family=Raleway&display=swap'); + +html { + --foreforeground: #3788ae; + --foreground: #082f41; + --background: #03141c; + color: white; + background: black; + /*padding: 1cm;*/ + font-size: 12pt; + font-family: 'Raleway', sans-serif; + + width: 100vw; + + overflow-x: hidden; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} +body > * { + width: max(60vw, 8cm); +} + +hr { + border: 0.5mm solid var(--foreforeground); + background: var(--foreforeground); + width: 100%; + height: 0%; +} + +.hide {display: none;} + +input, button, details{ + color: white; + background: var(--foreground); + padding: 1rem; + + border: none; + border-radius: 0.5cm; + font-size: 13pt; + margin: 0.5rem; +} + +input::placeholder { + color: var(--foreforeground); +} + +details :is(input, button) { + background: var(--background); +} + +details { + padding: 1rem; + background: var(--foreground); +} + +body { + height: calc(100% - 2cm); + margin: 1cm; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + width: max(60vw, 8cm); + + background: var(--background); + + padding: 1cm; + box-shadow: 0 0 5mm inset black; +} + +a:link { + color: white; +} +a:visited { + color: var(--foreforeground); +} + +kbd { + background: white; + color: black; + padding: 0.5mm; + border-radius: 1mm; + box-shadow: inset black -0.25mm -0.25mm 1mm; +} + +summary, +button, +:is(input[type=radio], input[type=checkbox]), +:is(input[type=radio], input[type=checkbox]) + label { + cursor: pointer; +} + +section#changelog { + height: 60vh; + overflow-y: auto; + overflow-x: hidden; + + box-shadow: inset 0mm 0mm 5mm #000; + +} + +section#changelog > article { + margin: 5mm; + margin-bottom 0; + box-shadow: 0mm 0mm 2.5mm #000; + padding: 2.5mm; + background: var(--foreground); +} + +#logo { + width: 5cm; + height: 5cm; + + position: relative; + z-index: 0; + + border-radius: 26px; + animation: logo 5s infinite ease; + overflow: hidden; + padding: none; +} +#logo > img { + width: 5cm; + z-index: -2; + margin: none; + position: relative; +} + +@keyframes logo { + 0% { + box-shadow: 0mm 0mm 1cm white, 0mm 0mm 0mm white; + } + 50% { + box-shadow: 0mm 0mm 5mm white, 0mm 0mm 1cm var(--foreforeground); + } + 100% { + box-shadow: 0mm 0mm 1cm white, 0mm 0mm 0mm white; + } +} \ No newline at end of file diff --git a/types.html b/types.html new file mode 100644 index 0000000..6794e75 --- /dev/null +++ b/types.html @@ -0,0 +1,25 @@ + + + + + + Document + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3-54-g00ecf