diff --git a/esy.lock/index.json b/esy.lock/index.json index e2863ba2d..db8c322dd 100644 --- a/esy.lock/index.json +++ b/esy.lock/index.json @@ -1,5 +1,5 @@ { - "checksum": "1d81663c61856d7ddee79cf574285e40", + "checksum": "0cbd792b49053bb13fc29babeb98f050", "root": "revery@link:./package.json", "node": { "revery@link:./package.json": { @@ -9,7 +9,7 @@ "source": { "type": "link", "path": ".", "manifest": "package.json" }, "overrides": [], "dependencies": [ - "reason-glfw@3.2.1012@d41d8cd9", + "refmterr@3.1.10@d41d8cd9", "reason-glfw@3.2.1013@d41d8cd9", "reason-gl-matrix@0.9.9302@d41d8cd9", "reason-fontkit@2.0.6@d41d8cd9", "ocaml@4.7.1003@d41d8cd9", "flex@1.2.2@d41d8cd9", "@opam/lwt_ppx@opam:1.2.1@db1172a7", @@ -66,14 +66,14 @@ ], "devDependencies": [] }, - "reason-glfw@3.2.1012@d41d8cd9": { - "id": "reason-glfw@3.2.1012@d41d8cd9", + "reason-glfw@3.2.1013@d41d8cd9": { + "id": "reason-glfw@3.2.1013@d41d8cd9", "name": "reason-glfw", - "version": "3.2.1012", + "version": "3.2.1013", "source": { "type": "install", "source": [ - "archive:https://registry.npmjs.org/reason-glfw/-/reason-glfw-3.2.1012.tgz#sha1:c1c4383a235a29090fd2ed6f790cd1e7ffdd17ef" + "archive:https://registry.npmjs.org/reason-glfw/-/reason-glfw-3.2.1013.tgz#sha1:042b0bdcde972a558c28bcfcefad0a2b1facd062" ] }, "overrides": [], @@ -120,7 +120,7 @@ }, "overrides": [], "dependencies": [ - "refmterr@3.1.10@d41d8cd9", "reason-glfw@3.2.1012@d41d8cd9", + "refmterr@3.1.10@d41d8cd9", "reason-glfw@3.2.1013@d41d8cd9", "reason-gl-matrix@0.9.9302@d41d8cd9", "esy-harfbuzz@1.9.1005@d41d8cd9", "esy-freetype2@2.9.1006@d41d8cd9", "esy-cmake@0.3.5@d41d8cd9", "@opam/dune@opam:1.6.3@a7d7baed", diff --git a/examples/Controls.re b/examples/Controls.re new file mode 100644 index 000000000..c8ec0ad43 --- /dev/null +++ b/examples/Controls.re @@ -0,0 +1,249 @@ +open Revery.UI; +open Revery.UI.Components; +open Revery.Core; + +open Revery.Math; + +module Controls = { + type inputFields = { + first: string, + second: string, + }; + + let component = React.component("Controls"); + let make = window => + component(slots => { + let (count, setCount, slots) = React.Hooks.state(0, slots); + + let ({first, second}: inputFields, setValue, slots) = + React.Hooks.state({first: "", second: ""}, slots); + + let (text, setText, slots) = React.Hooks.state("Not Checked!", slots); + + let (rotationX, setRotationX, slots) = React.Hooks.state(0., slots); + let (rotationY, setRotationY, slots) = React.Hooks.state(0., slots); + let (rotationZ, setRotationZ, _slots: React.Hooks.empty) = + React.Hooks.state(0., slots); + + let increment = () => setCount(count + 1); + + let containerStyle = + Style.[justifyContent(`FlexStart), alignItems(`FlexStart)]; + + let topContainer = + Style.[ + justifyContent(`Center), + alignItems(`Center), + flexDirection(`Row), + ]; + + let countContainer = + Style.[ + width(200), + height(200), + alignItems(`Center), + justifyContent(`Center), + ]; + + let inputContainer = + Style.[ + width(200), + height(200), + alignItems(`Center), + justifyContent(`Center), + ]; + + let checkboxContainer = + Style.[ + width(200), + height(200), + alignItems(`Center), + justifyContent(`Center), + ]; + + let countStyle = + Style.[ + fontSize(30), + margin(15), + color(Colors.white), + fontFamily("Roboto-Regular.ttf"), + ]; + + let textStyle = + Style.[ + color(Colors.white), + width(100), + fontFamily("Roboto-Regular.ttf"), + fontSize(16), + margin(14), + ]; + + let controlsStyle = + Style.[ + margin(10), + flexDirection(`Row), + justifyContent(`Center), + alignItems(`Center), + ]; + + let sliderContainerStyle = + Style.[ + margin(10), + borderBottom(~width=1, ~color=Colors.darkGray), + flexDirection(`Row), + justifyContent(`Center), + alignItems(`Center), + ]; + + let verticalSliderContainerStyle = + Style.[ + margin(10), + borderRight(~width=1, ~color=Colors.darkGray), + flexDirection(`Column), + justifyContent(`Center), + alignItems(`Center), + ]; + + let toDeg = r => 180. *. r /. pi; + + let toDegString = r => r |> toDeg |> floor |> string_of_float; + + let twoPi = 2. *. pi; + + let countStr = string_of_int(count); + + + + +