From 7495333b7d842a5c9c9266f2f3abdf5cf8b4a4ea Mon Sep 17 00:00:00 2001 From: sjwie Date: Fri, 16 Feb 2024 16:08:02 +0900 Subject: [PATCH] add prettier tailwind extension for sorting classes && add react-unity-webgl --- .prettierrc | 3 ++- app/draw-io/page.tsx | 6 +++--- app/layout.tsx | 8 ++++---- app/page.tsx | 4 ++-- app/unity/page.tsx | 26 +++++++++++++++++++++++++- package.json | 4 +++- yarn.lock | 10 ++++++++++ 7 files changed, 49 insertions(+), 12 deletions(-) diff --git a/.prettierrc b/.prettierrc index d27c631..cce5482 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,5 +5,6 @@ "useTabs": false, "tabWidth": 2, "printWidth": 80, - "arrowParens": "always" + "arrowParens": "always", + "plugins": ["prettier-plugin-tailwindcss"] } diff --git a/app/draw-io/page.tsx b/app/draw-io/page.tsx index f21f0ab..fa83b4a 100644 --- a/app/draw-io/page.tsx +++ b/app/draw-io/page.tsx @@ -7,7 +7,7 @@ export default function Home() { const drawioRef = useRef(null); return (
-
+
{ @@ -21,10 +21,10 @@ export default function Home() { }} />
-
미리보기
+
미리보기
{imgData ? ( diff --git a/app/layout.tsx b/app/layout.tsx index 88d8550..4794144 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -23,14 +23,14 @@ export default function RootLayout({
-
+
Home -
+ {children} -
+
{linkItemProp.map((linkItem, i) => ( Draw.io Unity diff --git a/app/unity/page.tsx b/app/unity/page.tsx index 6ff5373..0e53aa2 100644 --- a/app/unity/page.tsx +++ b/app/unity/page.tsx @@ -1,3 +1,27 @@ +import { Unity, useUnityContext } from "react-unity-webgl"; + export default function Home() { - return <>; + const { unityProvider, isLoaded, loadingProgression } = useUnityContext({ + loaderUrl: "build/myunityapp.loader.js", + dataUrl: "build/myunityapp.data", + frameworkUrl: "build/myunityapp.framework.js", + codeUrl: "build/myunityapp.wasm", + }); + + // We'll round the loading progression to a whole number to represent the + // percentage of the Unity Application that has loaded. + const loadingPercentage = Math.round(loadingProgression * 100); + + return ( +
+ {isLoaded === false && ( + // We'll conditionally render the loading overlay if the Unity + // Application is not loaded. +
+

Loading... ({loadingPercentage}%)

+
+ )} + +
+ ); } diff --git a/package.json b/package.json index 8a4b841..27d2781 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "next": "14.1.0", "react": "^18", "react-dom": "^18", - "react-drawio": "^0.1.2" + "react-drawio": "^0.1.2", + "react-unity-webgl": "^9.5.0" }, "devDependencies": { "@types/node": "^20", @@ -25,6 +26,7 @@ "eslint-config-next": "14.1.0", "postcss": "^8", "prettier": "^3.2.5", + "prettier-plugin-tailwindcss": "^0.5.11", "tailwindcss": "^3.3.0", "typescript": "^5" } diff --git a/yarn.lock b/yarn.lock index d0b36c9..f8558db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2053,6 +2053,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier-plugin-tailwindcss@^0.5.11: + version "0.5.11" + resolved "https://registry.yarnpkg.com/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.11.tgz#1aa9308c3285b3cb7942aaeaec8d0e0775ac54d0" + integrity sha512-AvI/DNyMctyyxGOjyePgi/gqj5hJYClZ1avtQvLlqMT3uDZkRbi4HhGUpok3DRzv9z7Lti85Kdj3s3/1CeNI0w== + prettier@^3.2.5: version "3.2.5" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" @@ -2095,6 +2100,11 @@ react-is@^16.13.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-unity-webgl@^9.5.0: + version "9.5.0" + resolved "https://registry.yarnpkg.com/react-unity-webgl/-/react-unity-webgl-9.5.0.tgz#08277bf80d0678dbd26131d2c7ea4eb05233862e" + integrity sha512-zmTffL2S7QL1g2DQem0/HzxhJaEQ3L4aEV4VUlQOkZc4JzMjScrqGVvHc4AnyMz94vVQqlbHwNfq4YhJEEGzQg== + react@^18: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"