From d9d9f94b91cb5d13478f0342ece44128cf01dfab Mon Sep 17 00:00:00 2001 From: "Dominykas M." <26067386+Tasty-Kiwi@users.noreply.github.com> Date: Thu, 28 Mar 2024 18:59:54 +0200 Subject: [PATCH] Make fx converter live update, remove PPLAF, change lua online website --- docs/Guides/Lua/beginner.md | 2 +- docs/intro.md | 2 -- src/components/fx-converter.tsx | 16 ++++++++-------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/Guides/Lua/beginner.md b/docs/Guides/Lua/beginner.md index 6dc3087..8e0ffc1 100644 --- a/docs/Guides/Lua/beginner.md +++ b/docs/Guides/Lua/beginner.md @@ -4,7 +4,7 @@ sidebar_position: 1 # Beginner Lua Tutorial -[https://repl.it/languages/lua](https://repl.it/languages/lua) can be used to try Lua in the browser. +[https://onecompiler.com/lua](https://onecompiler.com/lua) can be used to try Lua in the browser. These examples are more for review, rather than learning! If you see something here that you don't understand, continue to watch Lua tutorials on youtube! diff --git a/docs/intro.md b/docs/intro.md index fb6cb98..fa4f1b0 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -33,7 +33,6 @@ indentation to be consistent with the rest of PewPew's codebase. - [PewPew Snippets] is an essential Visual Studio Code extension that offers autocompletion and useful code snippets for creating levels. - [PewPewLive-MeshExporter] is a Blender plugin for converting scenes into PewPew Live 3D meshes. -- [PPLAF] is an opinionated Lua framework for creating advanced levels. [Discord]: https://pewpew.live/discord [simple_level]: https://github.com/jyaif/ppl-utils/blob/d32dbec8a171c9bcc0f800dcd864f175c42c34fd/content/levels/simple_level/ @@ -41,4 +40,3 @@ indentation to be consistent with the rest of PewPew's codebase. [https://pewpew.live]: https://pewpew.live [PewPewLive-MeshExporter]: https://github.com/ModEngineer/PewPewLive-MeshExporter [PewPew Snippets]: https://hybroid.pewpew.live/pps/ -[PPLAF]: https://github.com/glebi574/PPLAF/ diff --git a/src/components/fx-converter.tsx b/src/components/fx-converter.tsx index 4028315..c877d5f 100644 --- a/src/components/fx-converter.tsx +++ b/src/components/fx-converter.tsx @@ -2,6 +2,8 @@ import { useRef, useState } from "react" function floatToFixedpoint(input: string): string { let float = parseFloat(input) + if (isNaN(float)) return "Error!" + let abs_float = Math.abs(float) let int = Math.floor(abs_float) if (int > 2 << 51) { @@ -18,21 +20,19 @@ function floatToFixedpoint(input: string): string { } export default function FxConverter() { - const [num, setNum] = useState("2.718") - const outputRef = useRef(null) return (
- setNum(event.target.value)} /> { - outputRef.current.value = floatToFixedpoint(num) + type="text" + defaultValue="2.718" + onInput={(event) => { + outputRef.current.innerText = floatToFixedpoint(event.target.value) }} /> - +
+ 2.2940fx
) }