From 62cb8e9a662125b0c19d9b03ec60aa36a1d36555 Mon Sep 17 00:00:00 2001 From: Louis Hain Date: Tue, 24 Sep 2024 17:23:47 +0200 Subject: [PATCH] adds controls info popup --- app/components/controlsInfo.tsx | 27 ++++++++++++++++++ app/routes/_index.tsx | 5 ++++ app/styles/controlsInfo.css | 49 +++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 app/components/controlsInfo.tsx create mode 100644 app/styles/controlsInfo.css diff --git a/app/components/controlsInfo.tsx b/app/components/controlsInfo.tsx new file mode 100644 index 0000000..24ed492 --- /dev/null +++ b/app/components/controlsInfo.tsx @@ -0,0 +1,27 @@ +import { useState} from 'react' +import '~/styles/controlsInfo.css' + +// using https://github.com/shhdharmen/keyboard-css "keyboard-css" for keyboard keys + +function ControlsInfoPopup() { + const [popupStatus, setPopupStatus] = useState(true); + + return popupStatus ? ( +
+ +
+ + Controls:
+ 🖱️ to look around
+ esc to regain normal mouse controls
+ WASD to move around +
+
+ ) : ""; +} + +export default ControlsInfoPopup \ No newline at end of file diff --git a/app/routes/_index.tsx b/app/routes/_index.tsx index be9d4e1..d68bd17 100644 --- a/app/routes/_index.tsx +++ b/app/routes/_index.tsx @@ -1,9 +1,14 @@ import CanvasLayer from '~/components/CanvasLayer'; +import ControlsInfoPopup from '~/components/controlsInfo' export default function Index() { return ( <> + + + +

Hyperrealistic Indoor Street View
Exercise

diff --git a/app/styles/controlsInfo.css b/app/styles/controlsInfo.css new file mode 100644 index 0000000..0d338d1 --- /dev/null +++ b/app/styles/controlsInfo.css @@ -0,0 +1,49 @@ +.controlsInfoPopup { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100vh; + background-color: rgba(0, 0, 0, 0.75); + display: flex; + justify-content: center; + align-items: center; +} + +.controlsInfo { + position: relative; + padding: 32px; + width: 100%; + max-width: 640px; + color: #FFFFFF; + background-color: #181C20; + box-shadow: 0 4px 8px #000000; + border-radius: 5px; + line-height:40px; +} + +.close-btn { + position: absolute; + bottom: 16px; + right: 16px; + cursor: pointer; + font-size: 16px; + + width: 60px; + height: 40px; + background-color: #303030; + text-align: center; + border-radius: 5px; +} + +.mouse-icon { + font-size: 40px; +} + +.controls-title { + font-size: 32px; +} + +.close-btn:hover { + background-color: #5a5a5a; +} \ No newline at end of file