diff --git a/client/src/app.css b/client/src/app.css index b5364b5..df779d6 100644 --- a/client/src/app.css +++ b/client/src/app.css @@ -2,6 +2,7 @@ :root { --clr-primary: #1976d2; + --clr-primary-dark: #104a83; --clr-light-gray: #ddd; --clr-dark-gray: #aaa; --clr-darker-gray: #555; @@ -73,6 +74,10 @@ body { background: white; } +.btn-inverted:hover { + color: var(--clr-primary-dark); +} + .btn-disabled, .btn[disabled] { color: var(--clr-dark-gray); background: var(--clr-light-gray); diff --git a/client/src/components/level.css b/client/src/components/level.css index dd131ce..83c0f7e 100644 --- a/client/src/components/level.css +++ b/client/src/components/level.css @@ -268,3 +268,29 @@ td code { z-index: 1; padding: .5rem; } + +.menu.dropdown { + position: absolute; + display: flex; + flex-direction: column; + right: 0; + top: 100%; + background-color: #fff; + z-index: 1; + border-top: 1px solid rgba(0, 0, 0, 0.1); + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + box-shadow: -.1rem .3rem .3rem 0 rgba(0, 0, 0, 0.1); +} + +.menu.dropdown.hidden { + display: none; +} + +#menu-btn { + padding: 0; + font-size: 1.3rem; +} + +.menu.dropdown .svg-inline--fa { + width: 1.8rem; +} diff --git a/client/src/components/level.tsx b/client/src/components/level.tsx index e1fd7ed..63c0926 100644 --- a/client/src/components/level.tsx +++ b/client/src/components/level.tsx @@ -26,7 +26,7 @@ import { EditorConnection, EditorEvents } from '../../../node_modules/lean4-info import { EventEmitter } from '../../../node_modules/lean4-infoview/src/infoview/event'; import type { Location } from 'vscode-languageserver-protocol'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faBars, faHome, faCircleInfo, faArrowRight, faArrowLeft, faShield, faRotateLeft } from '@fortawesome/free-solid-svg-icons' +import { faBars, faCode, faPencilSquare, faXmark, faHome, faCircleInfo, faArrowRight, faArrowLeft, faShield, faRotateLeft } from '@fortawesome/free-solid-svg-icons' import { styled, useTheme, Theme, CSSObject } from '@mui/material/styles'; import { GameIdContext } from '../app'; @@ -418,6 +418,8 @@ function LevelAppBar({isLoading, levelId, worldId, levelTitle, toggleImpressum}) const { commandLineMode, setCommandLineMode } = React.useContext(InputModeContext) + const [navOpen, setNavOpen] = React.useState(false) + return
@@ -428,37 +430,41 @@ function LevelAppBar({isLoading, levelId, worldId, levelTitle, toggleImpressum}) {levelTitle} - {levelId > 0 && <> - + +
+
+ {levelId < gameInfo.data?.worldSize[worldId] && + + } + {levelId > 0 && <> } - {levelId < gameInfo.data?.worldSize[worldId] && - - } - - - - -
- + + +
+ + } function useLevelEditor(worldId: string, levelId: number, codeviewRef, initialCode, initialSelections, onDidChangeContent, onDidChangeSelection) {