diff --git a/frontend/src/App.css b/frontend/src/App.css index 316b0df8f..a75dbdec7 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -46,6 +46,7 @@ position: fixed; top: 50%; left: 50%; + overflow: hidden; margin: 0; padding: 0; border: none; diff --git a/frontend/src/Theme.css b/frontend/src/Theme.css index 9814b68d8..d1c282694 100644 --- a/frontend/src/Theme.css +++ b/frontend/src/Theme.css @@ -66,12 +66,14 @@ /* general modal overlay */ --overlay-background-colour: #8ad5da; + --overlay-header-background-colour: #61b5ba; --overlay-tab-colour: #c7e8f4; --overlay-attack-background-colour: #d6d6ff; --overlay-text-colour: #313131; /* handbook modal */ --handbook-background-colour: #fff; + --handbook-header-background-colour: #a7a7a7; --handbook-spine-background-colour: #d3d3d3; --handbook-spine-separator-colour: var(--main-text-colour-inverted); --handbook-tab-selected-colour: #313131; diff --git a/frontend/src/components/DocumentViewer/DocumentViewBox.css b/frontend/src/components/DocumentViewer/DocumentViewBox.css index b7597305e..683eeaf0b 100644 --- a/frontend/src/components/DocumentViewer/DocumentViewBox.css +++ b/frontend/src/components/DocumentViewer/DocumentViewBox.css @@ -1,31 +1,45 @@ +.document-popup-inner header { + border-radius: 0; + background-color: var(--accent-background-colour); + color: var(--main-text-colour); +} + +.document-popup-inner header .overlay-close-button { + border-color: var(--main-text-colour); + color: var(--main-text-colour); +} + +.document-popup-inner header .overlay-close-icon { + border-color: var(--main-text-colour); + color: var(--main-text-colour); +} + +.document-popup-inner header .overlay-close-button:hover { + background-color: var(--action-button-background-colour-hover); +} + +.document-popup-inner header .overlay-close-button:focus-visible { + background-color: var(--action-button-background-colour-hover); + outline-color: var(--main-text-colour); +} + .document-popup-inner { + display: flex; + flex-direction: column; +} + +.view-documents-main { position: relative; display: flex; flex-direction: column; box-sizing: border-box; - height: 85vh; + height: 75vh; padding: 2rem; border: 0.1875rem solid var(--main-border-colour); background: var(--main-background); aspect-ratio: 7/8; } -.document-popup-inner .close-button { - position: absolute; - top: 1rem; - right: 1rem; - padding: 0.25rem 0.75rem; - color: var(--main-text-colour); - font-weight: bold; - font-size: 1.75rem; - text-decoration: none; -} - -.document-popup-inner .close-button:hover { - border-color: var(--accent-border-colour); - color: var(--accent-border-colour); -} - .document-viewer-container { flex-grow: 1; overflow-y: auto; diff --git a/frontend/src/components/DocumentViewer/DocumentViewBox.test.tsx b/frontend/src/components/DocumentViewer/DocumentViewBox.test.tsx index c6371bfbf..aa1676d0d 100644 --- a/frontend/src/components/DocumentViewer/DocumentViewBox.test.tsx +++ b/frontend/src/components/DocumentViewer/DocumentViewBox.test.tsx @@ -126,7 +126,7 @@ describe('DocumentViewBox component tests', () => { const { user } = renderDocumentViewBox(); const closeButton = screen.getByRole('button', { - name: 'close document viewer', + name: 'close', }); await user.click(closeButton); diff --git a/frontend/src/components/DocumentViewer/DocumentViewBox.tsx b/frontend/src/components/DocumentViewer/DocumentViewBox.tsx index 105010872..a2ed6479b 100644 --- a/frontend/src/components/DocumentViewer/DocumentViewBox.tsx +++ b/frontend/src/components/DocumentViewer/DocumentViewBox.tsx @@ -1,10 +1,11 @@ import DocViewer, { DocViewerRenderers } from '@cyntler/react-doc-viewer'; import { useEffect, useState } from 'react'; +import OverlayHeader from '@src/components/Overlay/OverlayHeader'; import { DocumentMeta } from '@src/models/document'; import { documentService } from '@src/service'; -import DocumentViewBoxHeader from './DocumentViewBoxHeader'; +import DocumentViewBoxNav from './DocumentViewBoxNav'; import './DocumentViewBox.css'; @@ -32,44 +33,43 @@ function DocumentViewBox({ closeOverlay }: { closeOverlay: () => void }) { return (
- - { - if (documentIndex > 0) { - setDocumentIndex(documentIndex - 1); - } - }} - onNext={() => { - if (documentIndex < documentMetas.length - 1) { - setDocumentIndex(documentIndex + 1); - } - }} + -
- + { + if (documentIndex > 0) { + setDocumentIndex(documentIndex - 1); + } + }} + onNext={() => { + if (documentIndex < documentMetas.length - 1) { + setDocumentIndex(documentIndex + 1); + } }} /> +
+ +
); diff --git a/frontend/src/components/DocumentViewer/DocumentViewBoxHeader.css b/frontend/src/components/DocumentViewer/DocumentViewBoxHeader.css deleted file mode 100644 index 676aff9d4..000000000 --- a/frontend/src/components/DocumentViewer/DocumentViewBoxHeader.css +++ /dev/null @@ -1,44 +0,0 @@ -.view-documents-header { - display: flex; - flex-direction: column; - gap: 1.25rem; - align-items: stretch; - padding-bottom: 0.25rem; - color: var(--main-text-colour); -} - -.view-documents-header h2 { - width: 100%; - margin: 0; - padding-bottom: 1rem; - border-bottom: solid 0.0625rem var(--main-border-colour); - text-align: center; -} - -.view-documents-header .nav { - display: flex; - flex-direction: column; - gap: 0.5rem; - justify-content: center; - align-items: center; - width: 100%; -} - -.view-documents-header .info { - margin: 0; - padding: 0; - font-size: 1.25rem; -} - -.view-documents-header .button-container { - display: flex; - gap: 1rem; - justify-content: space-between; - align-items: center; - align-self: stretch; -} - -.view-documents-header .button-container button { - flex: 0 0 30%; - white-space: nowrap; -} diff --git a/frontend/src/components/DocumentViewer/DocumentViewBoxHeader.tsx b/frontend/src/components/DocumentViewer/DocumentViewBoxHeader.tsx deleted file mode 100644 index 487d6b8fb..000000000 --- a/frontend/src/components/DocumentViewer/DocumentViewBoxHeader.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import ThemedButton from '@src/components/ThemedButtons/ThemedButton'; - -import './DocumentViewBoxHeader.css'; - -interface DocumentViewBoxHeaderProps { - documentIndex: number; - documentName: string; - numberOfDocuments: number; - onPrevious: () => void; - onNext: () => void; -} - -function DocumentViewBoxHeader({ - documentIndex, - documentName, - numberOfDocuments, - onPrevious, - onNext, -}: DocumentViewBoxHeaderProps) { - const documentNumber = `${documentIndex + 1} out of ${numberOfDocuments}`; - - return ( -
-

View documents

-
-
- -  previous document - -
{documentNumber}
- = numberOfDocuments - 1} - > - next document  - -
-
-

{documentName}

-
- ); -} - -export default DocumentViewBoxHeader; -export type { DocumentViewBoxHeaderProps }; diff --git a/frontend/src/components/DocumentViewer/DocumentViewBoxNav.css b/frontend/src/components/DocumentViewer/DocumentViewBoxNav.css new file mode 100644 index 000000000..69441f811 --- /dev/null +++ b/frontend/src/components/DocumentViewer/DocumentViewBoxNav.css @@ -0,0 +1,38 @@ +.view-documents-nav { + display: flex; + flex-direction: column; + gap: 1.25rem; + align-items: stretch; + padding-bottom: 0.25rem; + color: var(--main-text-colour); +} + +.view-documents-nav .info { + margin: 0; + padding: 0; + font-size: 1.25rem; +} + +.view-documents-nav .button-container { + display: flex; + gap: 1rem; + justify-content: space-between; + align-items: center; + align-self: stretch; +} + +.view-documents-nav .button-container button { + flex: 0 0 30%; + white-space: nowrap; +} + +.view-documents-nav .button-container button:focus-visible { + background-color: var(--action-button-background-colour-hover); + outline-color: var(--main-text-colour); +} + +.view-documents-nav + .button-container + button[aria-disabled='true']:focus-visible { + background-color: var(--action-button-disabled-background-colour); +} diff --git a/frontend/src/components/DocumentViewer/DocumentViewBoxNav.tsx b/frontend/src/components/DocumentViewer/DocumentViewBoxNav.tsx new file mode 100644 index 000000000..930e25e84 --- /dev/null +++ b/frontend/src/components/DocumentViewer/DocumentViewBoxNav.tsx @@ -0,0 +1,42 @@ +import ThemedButton from '@src/components/ThemedButtons/ThemedButton'; + +import './DocumentViewBoxNav.css'; + +interface DocumentViewBoxNavProps { + documentIndex: number; + documentName: string; + numberOfDocuments: number; + onPrevious: () => void; + onNext: () => void; +} + +function DocumentViewBoxNav({ + documentIndex, + documentName, + numberOfDocuments, + onPrevious, + onNext, +}: DocumentViewBoxNavProps) { + const documentNumber = `${documentIndex + 1} out of ${numberOfDocuments}`; + + return ( +
+ +

{documentName}

+
+ ); +} + +export default DocumentViewBoxNav; +export type { DocumentViewBoxNavProps }; diff --git a/frontend/src/components/HandbookOverlay/HandbookAttacks.tsx b/frontend/src/components/HandbookOverlay/HandbookAttacks.tsx index 9df109e70..1379f5735 100644 --- a/frontend/src/components/HandbookOverlay/HandbookAttacks.tsx +++ b/frontend/src/components/HandbookOverlay/HandbookAttacks.tsx @@ -23,7 +23,7 @@ function HandbookAttacks({ currentLevel }: { currentLevel: LEVEL_NAMES }) { return (
-

Attacks

+

Attacks

{getHeaderText(currentLevel)}

{currentLevel > LEVEL_NAMES.LEVEL_1 && ( diff --git a/frontend/src/components/HandbookOverlay/HandbookCloseIcon.tsx b/frontend/src/components/HandbookOverlay/HandbookCloseIcon.tsx deleted file mode 100644 index 4f876c2a9..000000000 --- a/frontend/src/components/HandbookOverlay/HandbookCloseIcon.tsx +++ /dev/null @@ -1,26 +0,0 @@ -function HandbookIcon() { - return ( - - - - - ); -} - -export default HandbookIcon; diff --git a/frontend/src/components/HandbookOverlay/HandbookGlossary.tsx b/frontend/src/components/HandbookOverlay/HandbookGlossary.tsx index 8b9285b5c..23da7c7cb 100644 --- a/frontend/src/components/HandbookOverlay/HandbookGlossary.tsx +++ b/frontend/src/components/HandbookOverlay/HandbookGlossary.tsx @@ -11,10 +11,10 @@ function HandbookGlossary({ currentLevel }: { currentLevel: LEVEL_NAMES }) { } return (
-
-

Glossary

+
+

Glossary

{getHeaderText(currentLevel)}

-
+ {currentLevel > LEVEL_NAMES.LEVEL_1 && (
{GLOSSARY.map(({ term, definition }) => ( diff --git a/frontend/src/components/HandbookOverlay/HandbookOverlay.css b/frontend/src/components/HandbookOverlay/HandbookOverlay.css index 972ad1b04..39fdabf32 100644 --- a/frontend/src/components/HandbookOverlay/HandbookOverlay.css +++ b/frontend/src/components/HandbookOverlay/HandbookOverlay.css @@ -1,55 +1,36 @@ .handbook-overlay { display: flex; - flex-direction: row; + flex-direction: column; height: 85vh; - background-color: var(--handbook-background-colour); - color: var(--handbook-text-colour); aspect-ratio: 7/8; } -.handbook-overlay .close-button { - position: absolute; - top: 0.25rem; - right: 0.25rem; -} - -.handbook-overlay .close-button:hover svg rect { - fill: black; - stroke: white; +.handbook-overlay .overlay-header { + border-bottom: 0.0625rem solid var(--handbook-spine-separator-colour); + border-radius: 0; } -.handbook-overlay .close-button:hover svg path { - fill: white; +.handbook-overlay .handbook { + display: flex; + flex-direction: row; + overflow: hidden; + background-color: var(--handbook-background-colour); + color: var(--handbook-text-colour); } -.handbook-overlay .content { +.handbook-overlay .handbook-page { overflow-y: auto; - margin-top: 3rem; - margin-right: 0.5rem; - margin-bottom: 0.25rem; - padding: 0 1.75rem 0.5rem; + padding: 1.75rem; /* firefox scrollbar styling */ scrollbar-color: var(--handbook-scrollbar-colour) transparent; } /* webkit scrollbar styling */ -.handbook-overlay .content::-webkit-scrollbar-thumb { +.handbook-overlay .handbook-page::-webkit-scrollbar-thumb { background-color: var(--handbook-scrollbar-colour); } -.handbook-overlay .content::-webkit-scrollbar-thumb:hover { +.handbook-overlay .handbook-page::-webkit-scrollbar-thumb:hover { background-color: var(--handbook-scrollbar-hover-colour); } - -.handbook-overlay .content h1 { - font-size: 1.5rem; -} - -.handbook-overlay .content h2 { - font-size: 1.125rem; -} - -.handbook-overlay .content p { - font-size: 1rem; -} diff --git a/frontend/src/components/HandbookOverlay/HandbookOverlay.tsx b/frontend/src/components/HandbookOverlay/HandbookOverlay.tsx index c2203f846..ca99d13ef 100644 --- a/frontend/src/components/HandbookOverlay/HandbookOverlay.tsx +++ b/frontend/src/components/HandbookOverlay/HandbookOverlay.tsx @@ -1,11 +1,11 @@ import { useRef, useState } from 'react'; +import OverlayHeader from '@src/components/Overlay/OverlayHeader'; import useIsOverflow from '@src/hooks/useIsOverflow'; import { HANDBOOK_PAGES } from '@src/models/handbook'; import { LEVEL_NAMES, LevelSystemRole } from '@src/models/level'; import HandbookAttacks from './HandbookAttacks'; -import HandbookCloseIcon from './HandbookCloseIcon'; import HandbookGlossary from './HandbookGlossary'; import HandbookSpine from './HandbookSpine'; import HandbookSystemRole from './HandbookSystemRole'; @@ -44,27 +44,23 @@ function HandbookOverlay({ return (
- - -
- {pageContent} + +
+ +
+ {pageContent} +
); diff --git a/frontend/src/components/HandbookOverlay/HandbookSpine.css b/frontend/src/components/HandbookOverlay/HandbookSpine.css index 5111434f0..a60fdd479 100644 --- a/frontend/src/components/HandbookOverlay/HandbookSpine.css +++ b/frontend/src/components/HandbookOverlay/HandbookSpine.css @@ -5,7 +5,7 @@ max-width: 6rem; padding-top: 3rem; border-right: 0.0625rem solid var(--handbook-spine-separator-colour); - background-color: var(--handbook-spine-background-colour); + background-color: var(--overlay-header-background-colour); font-size: 1.125rem; } @@ -15,15 +15,18 @@ /* remove default button styling */ background: none; + font-size: 1rem; text-align: left; } .handbook-spine button:focus-visible { + background-color: var(--overlay-tab-colour); + outline-color: var(--main-text-colour); outline-offset: -0.25rem; } .handbook-spine button:hover { - background-color: var(--handbook-tab-hover-colour); + background-color: var(--overlay-tab-colour); } .handbook-spine button[aria-selected='true'] { diff --git a/frontend/src/components/HandbookOverlay/HandbookSystemRole.tsx b/frontend/src/components/HandbookOverlay/HandbookSystemRole.tsx index 1bbb99f9f..8652b19be 100644 --- a/frontend/src/components/HandbookOverlay/HandbookSystemRole.tsx +++ b/frontend/src/components/HandbookOverlay/HandbookSystemRole.tsx @@ -11,13 +11,13 @@ function HandbookSystemRole({ }) { return (
-
-

System Roles

+
+

System Roles

Here you can review the parameters the bot is working under for each level. You can only review this for levels you have already completed.

-
+
{systemRoles.length !== 0 ? ( diff --git a/frontend/src/components/Overlay/LevelsComplete.css b/frontend/src/components/Overlay/LevelsComplete.css deleted file mode 100644 index ac34bca27..000000000 --- a/frontend/src/components/Overlay/LevelsComplete.css +++ /dev/null @@ -1,8 +0,0 @@ -.levels-complete-overlay { - display: flex; - flex-direction: column; -} - -.levels-complete-overlay .content { - overflow-y: auto; -} diff --git a/frontend/src/components/Overlay/LevelsComplete.tsx b/frontend/src/components/Overlay/LevelsComplete.tsx index 4d460a6ca..f955c78e7 100644 --- a/frontend/src/components/Overlay/LevelsComplete.tsx +++ b/frontend/src/components/Overlay/LevelsComplete.tsx @@ -3,8 +3,6 @@ import LevelsCompleteButtons from '@src/components/ThemedButtons/LevelsCompleteB import MissionDialogue from './MissionDialogue'; import Overlay from './Overlay'; -import './LevelsComplete.css'; - function LevelsComplete({ goToSandbox, closeOverlay, @@ -22,27 +20,24 @@ function LevelsComplete({ ]; return ( - -
-

Congratulations!

-
- -
-

- You've completed the story mode! You can stay here and continue - to play with the levels, or you can move onto Sandbox mode where you - can configure your own defence set up and try to break it. -

-

- You can always switch modes by clicking on the button in the left - panel. -

- -
-
+ +
+ +
+

+ You've completed the story mode! You can stay here and continue + to play with the levels, or you can move onto Sandbox mode where you + can configure your own defence set up and try to break it. +

+

+ You can always switch modes by clicking on the button in the left + panel. +

+ +
); } diff --git a/frontend/src/components/Overlay/MissionDialogue.css b/frontend/src/components/Overlay/MissionDialogue.css index 50539c945..d540ef975 100644 --- a/frontend/src/components/Overlay/MissionDialogue.css +++ b/frontend/src/components/Overlay/MissionDialogue.css @@ -1,5 +1,4 @@ .mission-dialogue h2 { - margin-top: 0; margin-bottom: 0; font-weight: bold; font-size: 1.25rem; diff --git a/frontend/src/components/Overlay/MissionInformation.css b/frontend/src/components/Overlay/MissionInformation.css index 45fecc8a9..33cc38d25 100644 --- a/frontend/src/components/Overlay/MissionInformation.css +++ b/frontend/src/components/Overlay/MissionInformation.css @@ -1,10 +1,7 @@ .mission-information { display: flex; flex-direction: column; -} - -.mission-information .content { - overflow-y: auto; + overflow: auto; } .button-area { diff --git a/frontend/src/components/Overlay/MissionInformation.tsx b/frontend/src/components/Overlay/MissionInformation.tsx index e00a06a15..7de080504 100644 --- a/frontend/src/components/Overlay/MissionInformation.tsx +++ b/frontend/src/components/Overlay/MissionInformation.tsx @@ -14,10 +14,11 @@ function MissionInformation({ currentLevel: LEVEL_NAMES; closeOverlay: () => void; }) { + const heading = `${LEVELS[currentLevel].name} Mission Information`; + return ( - +
-

Mission Information

.close-button { - position: absolute; - top: 1rem; - right: 1rem; - padding: 0.125rem 0.5rem; - border: 0.1875rem solid transparent; - color: inherit; - font-weight: bold; - font-size: 1.5rem; -} - -.overlay > .close-button:focus-visible { - border-color: var(--main-text-colour); -} - -.overlay > .close-button:hover { - color: var(--main-text-colour); - text-decoration: none; -} - .overlay-content { display: flex; overflow: hidden; diff --git a/frontend/src/components/Overlay/Overlay.tsx b/frontend/src/components/Overlay/Overlay.tsx index 88b5674a6..4c95a5dde 100644 --- a/frontend/src/components/Overlay/Overlay.tsx +++ b/frontend/src/components/Overlay/Overlay.tsx @@ -1,24 +1,21 @@ import { ReactNode } from 'react'; +import OverlayHeader from './OverlayHeader'; + import './Overlay.css'; function Overlay({ children, closeOverlay, + heading, }: { children: ReactNode; closeOverlay: () => void; + heading: string; }) { return (
- - +
{children}
); diff --git a/frontend/src/components/Overlay/OverlayChoice.css b/frontend/src/components/Overlay/OverlayChoice.css index 76a73c67f..a1e535769 100644 --- a/frontend/src/components/Overlay/OverlayChoice.css +++ b/frontend/src/components/Overlay/OverlayChoice.css @@ -2,4 +2,10 @@ display: flex; flex-direction: column; gap: 0.5rem; + overflow: auto; + padding: 1rem; +} + +.overlay-choice p { + margin-top: 0; } diff --git a/frontend/src/components/Overlay/OverlayChoice.tsx b/frontend/src/components/Overlay/OverlayChoice.tsx index a2640a8b3..e6bd1f21b 100644 --- a/frontend/src/components/Overlay/OverlayChoice.tsx +++ b/frontend/src/components/Overlay/OverlayChoice.tsx @@ -10,14 +10,16 @@ function OverlayChoice({ button2, content, closeOverlay, + heading, }: { button1: OverlayButtonProps; button2: OverlayButtonProps; content: React.ReactNode; closeOverlay: () => void; + heading: string; }) { return ( - +
{content} diff --git a/frontend/src/components/Overlay/OverlayCloseIcon.tsx b/frontend/src/components/Overlay/OverlayCloseIcon.tsx new file mode 100644 index 000000000..01f077d8d --- /dev/null +++ b/frontend/src/components/Overlay/OverlayCloseIcon.tsx @@ -0,0 +1,12 @@ +function OverlayCloseIcon({ iconFill }: { iconFill: string }) { + return ( + + + + ); +} + +export default OverlayCloseIcon; diff --git a/frontend/src/components/Overlay/OverlayHeader.css b/frontend/src/components/Overlay/OverlayHeader.css new file mode 100644 index 000000000..7345c528b --- /dev/null +++ b/frontend/src/components/Overlay/OverlayHeader.css @@ -0,0 +1,41 @@ +.overlay-header { + display: flex; + justify-content: space-between; + align-items: center; + height: 5rem; + border-top-left-radius: 0.625rem; + border-top-right-radius: 0.625rem; + background-color: var(--overlay-header-background-colour); +} + +.overlay-header h1 { + padding: 0 2rem; +} + +.overlay-header button { + display: flex; + gap: 0.5rem; + align-items: center; + margin-right: 1rem; + padding: 0.5rem; + border: 0.0625rem solid var(--main-text-colour-inverted); + border-radius: 0.5rem; + background-color: inherit; + color: var(--main-text-colour-inverted); + font-weight: bold; + font-size: 1rem; +} + +.overlay-header button:hover { + background-color: var(--overlay-tab-colour); +} + +.overlay-header button:focus-visible { + background-color: var(--overlay-tab-colour); + outline-color: var(--main-text-colour); +} + +.overlay-close-icon { + width: 1.25rem; + height: 1.25rem; +} diff --git a/frontend/src/components/Overlay/OverlayHeader.test.tsx b/frontend/src/components/Overlay/OverlayHeader.test.tsx new file mode 100644 index 000000000..201ab0a83 --- /dev/null +++ b/frontend/src/components/Overlay/OverlayHeader.test.tsx @@ -0,0 +1,34 @@ +import { render, screen } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import { describe, expect, test, vi } from 'vitest'; + +import OverlayHeader from './OverlayHeader'; + +const mockCloseOverlay = vi.fn(); + +describe('Overlay Header component', () => { + test('renders the heading text passed in', () => { + render( + + ); + + expect(screen.getByText('Test Header')).toBeInTheDocument(); + }); + + test('renders close button', () => { + render( + + ); + + expect(screen.getByText('close')).toBeInTheDocument(); + }); + + test('clicking the close button closes the modal', async () => { + render( + + ); + await userEvent.click(screen.getByRole('button')); + + expect(mockCloseOverlay).toHaveBeenCalledOnce(); + }); +}); diff --git a/frontend/src/components/Overlay/OverlayHeader.tsx b/frontend/src/components/Overlay/OverlayHeader.tsx new file mode 100644 index 000000000..d6ce1f223 --- /dev/null +++ b/frontend/src/components/Overlay/OverlayHeader.tsx @@ -0,0 +1,28 @@ +import OverlayCloseIcon from './OverlayCloseIcon'; + +import './OverlayHeader.css'; + +interface OverlayHeaderProps { + closeOverlay: () => void; + heading: string; + iconColor?: string; +} + +function OverlayHeader({ + closeOverlay, + heading, + iconColor = '#000', +}: OverlayHeaderProps) { + return ( +
+

{heading}

+ +
+ ); +} +export default OverlayHeader; diff --git a/frontend/src/components/Overlay/OverlayWelcome.css b/frontend/src/components/Overlay/OverlayWelcome.css index 8efcce0b9..2061b7919 100644 --- a/frontend/src/components/Overlay/OverlayWelcome.css +++ b/frontend/src/components/Overlay/OverlayWelcome.css @@ -1,6 +1,5 @@ .welcome { overflow-y: auto; - margin-top: 2rem; padding: 0 1.5rem; } diff --git a/frontend/src/components/Overlay/OverlayWelcome.tsx b/frontend/src/components/Overlay/OverlayWelcome.tsx index 0693a138b..d20f34e26 100644 --- a/frontend/src/components/Overlay/OverlayWelcome.tsx +++ b/frontend/src/components/Overlay/OverlayWelcome.tsx @@ -16,12 +16,12 @@ function OverlayWelcome({ closeOverlay: () => void; }) { return ( - +
-

Welcome to Spy Logic!

+

Welcome to Spy Logic!

This is an app we developed to teach you about AI chat system security in a playful way. In this game you are playing the role of an diff --git a/frontend/src/components/Overlay/ResetLevel.tsx b/frontend/src/components/Overlay/ResetLevel.tsx index ddd5ca543..7ac19b038 100644 --- a/frontend/src/components/Overlay/ResetLevel.tsx +++ b/frontend/src/components/Overlay/ResetLevel.tsx @@ -14,21 +14,21 @@ function ResetLevelOverlay({ return ( { void resetLevel(); }, }} button2={{ - children: 'Cancel', + children: 'No, cancel', onClick: closeOverlay, }} content={ <> -

Reset level

+

Do you want to reset your level progress?

{ - 'Warning! This will reset all your chat history and sent emails for this level.' + 'Resetting will erase all your chat history and sent emails for this level.' } {currentLevel >= LEVEL_NAMES.LEVEL_3 && ' However, any configurations you have made to defences will not be lost.'} @@ -37,6 +37,7 @@ function ResetLevelOverlay({ } closeOverlay={closeOverlay} + heading="Reset Level" /> ); } diff --git a/frontend/src/components/Overlay/ResetProgress.tsx b/frontend/src/components/Overlay/ResetProgress.tsx index 715a9b1f9..1ee6b006a 100644 --- a/frontend/src/components/Overlay/ResetProgress.tsx +++ b/frontend/src/components/Overlay/ResetProgress.tsx @@ -10,26 +10,28 @@ function ResetProgressOverlay({ return ( { void resetProgress(); }, }} button2={{ - children: 'Cancel', + children: 'No, cancel', onClick: closeOverlay, }} content={ <> -

Reset all progress

+

Do you want to reset all progress?

- {`Warning! This will reset all your progress in the levels and sandbox mode. - This includes all your conversation history and sent emails. Any configurations you have made to defences in sandbox mode will also be lost. + {`Resetting will erase all your progress in the levels and sandbox mode. + This includes all your conversation history and sent emails. + Any configurations you have made to defences in sandbox mode will also be lost. Are you sure you want to do this?`}

} closeOverlay={closeOverlay} + heading="Reset Progress" /> ); } diff --git a/frontend/src/components/ThemedButtons/ModeSelectButtons.css b/frontend/src/components/ThemedButtons/ModeSelectButtons.css index cc19d0f66..0b6192bdb 100644 --- a/frontend/src/components/ThemedButtons/ModeSelectButtons.css +++ b/frontend/src/components/ThemedButtons/ModeSelectButtons.css @@ -27,3 +27,7 @@ .mode-selection-buttons button:hover { background-color: var(--overlay-tab-colour); } + +.mode-selection-buttons button:focus-visible { + background-color: var(--overlay-tab-colour); +} diff --git a/frontend/src/components/ThemedButtons/ModeSelectButtons.tsx b/frontend/src/components/ThemedButtons/ModeSelectButtons.tsx index dc9223487..58989e660 100644 --- a/frontend/src/components/ThemedButtons/ModeSelectButtons.tsx +++ b/frontend/src/components/ThemedButtons/ModeSelectButtons.tsx @@ -18,7 +18,7 @@ function ModeSelectButtons({ } return ( -
    +
      {modeButtons.map((modeButton) => (