From e8ffdf8d7d5a2f29565a398dcc82cc069f0c1b5e Mon Sep 17 00:00:00 2001 From: Jon Eugster Date: Wed, 19 Jul 2023 02:10:51 +0200 Subject: [PATCH] add impressum --- client/src/app.css | 3 +- client/src/components/level.css | 13 ++++- client/src/components/level.tsx | 60 ++++++++++++++++++------ client/src/components/privacy_policy.tsx | 50 ++++++++++++++++++-- 4 files changed, 106 insertions(+), 20 deletions(-) diff --git a/client/src/app.css b/client/src/app.css index 56c988a..b5364b5 100644 --- a/client/src/app.css +++ b/client/src/app.css @@ -106,7 +106,8 @@ em { flex-direction: row; justify-content: space-between; padding: 1.1em; - filter: drop-shadow(0 0 5px rgba(0,0,0,0.5)) + filter: drop-shadow(0 0 5px rgba(0,0,0,0.5)); + z-index: 2; } .app-bar-title, .app-bar-subtitle { diff --git a/client/src/components/level.css b/client/src/components/level.css index e972dc0..05f4495 100644 --- a/client/src/components/level.css +++ b/client/src/components/level.css @@ -24,9 +24,10 @@ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg=='); } -.inventory-panel, .exercise-panel, .doc-panel { +.inventory-panel, .exercise-panel, .doc-panel, .introduction-panel { height: 100%; overflow: auto; + position: relative; } .infoview { @@ -258,3 +259,13 @@ td code { margin-left: auto; margin-right: auto; } + +.impressum { + background-color: #fff; + width: 100%; + height: 100%; + position: absolute; + top: 0; + z-index: 1; + padding: .5rem; +} diff --git a/client/src/components/level.tsx b/client/src/components/level.tsx index e84d40a..d29cad6 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 { faHome, faArrowRight, faArrowLeft, faRotateLeft } from '@fortawesome/free-solid-svg-icons' +import { 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'; @@ -42,6 +42,7 @@ import { DeletedHint, DeletedHints, Hints } from './hints'; import { DeletedChatContext, InputModeContext, MonacoEditorContext, ProofContext, ProofStep, SelectionContext } from './infoview/context'; import { hasInteractiveErrors } from './infoview/command_line'; import { GameHint } from './infoview/rpc_api'; +import { Impressum } from './privacy_policy'; function Level() { @@ -88,6 +89,16 @@ function PlayableLevel({worldId, levelId}) { const theme = useTheme(); + const [impressum, setImpressum] = React.useState(false) + + function closeImpressum() { + setImpressum(false) + } + + function toggleImpressum() { + setImpressum(!impressum) + } + useEffect(() => { // // Scroll to top when loading a new level // // TODO: Thats the wrong behaviour probably @@ -250,7 +261,7 @@ function PlayableLevel({worldId, levelId}) { - +
@@ -316,6 +327,7 @@ function PlayableLevel({worldId, levelId}) {
+ {impressum ? : null}
{!level.isLoading && @@ -341,13 +353,26 @@ function Introduction({worldId}) { const gameId = React.useContext(GameIdContext) const gameInfo = useGetGameInfoQuery({game: gameId}) + const [impressum, setImpressum] = React.useState(false) + + const closeImpressum = () => { + setImpressum(false) + } + + const toggleImpressum = () => { + setImpressum(!impressum) + } + return <>
- +
- - {gameInfo.data?.worlds.nodes[worldId].introduction} - +
+ + {gameInfo.data?.worlds.nodes[worldId].introduction} + + {impressum ? : null} +
{gameInfo.data?.worldSize[worldId] == 0 ? : - - + + + +
diff --git a/client/src/components/privacy_policy.tsx b/client/src/components/privacy_policy.tsx index 8a883db..7038485 100644 --- a/client/src/components/privacy_policy.tsx +++ b/client/src/components/privacy_policy.tsx @@ -10,7 +10,7 @@ import * as React from 'react' * `handleClose` is the function to close it again because it's open/closed state is * controlled by the containing element. */ -function PrivacyPolicyPopup (handleClose) { +export function PrivacyPolicyPopup ({handleClose}: {handleClose: () => void}) { return
@@ -43,7 +43,7 @@ function PrivacyPolicyPopup (handleClose) {
} -const PrivacyPolicy: React.FC = () => { +export const PrivacyPolicy: React.FC = () => { const [open, setOpen] = React.useState(false) const handleOpen = () => setOpen(true) const handleClose = () => setOpen(false) @@ -59,4 +59,48 @@ const PrivacyPolicy: React.FC = () => { ) } -export {PrivacyPolicy, PrivacyPolicyPopup} +export function Impressum({handleClose}) { + return
+
+

Funding

+

+ This Lean game engine has been developed as part of the + project ADAM: Anticipating the Digital + Age of Mathematics at + Heinrich-Heine-Universität Düsseldorf. It is funded by + the Stiftung Innovation in der Hochschullehre as part of project Freiraum 2022. +

+ +

Development

+

+ The source code is available on Github. + If you experience any problems, please + file an Issue on Github or + get directly in contact. +

+

Privacy Policy & Impressum

+

+ Our server collects metadata (such as IP address, browser, operating system) + and the data that the user enters into the editor. The data is used to + compute the Lean output and display it to the user. The information will be stored + as long as the user stays on our website and will be deleted immediately afterwards. + We keep logs to improve our software, but the contained data is anonymised. +

+

+ We do not use cookies, but your game progress is stored in the browser storage + as site data. Your game progress is not saved on the server; if you delete + your browser storage, it is completely gone. +

+

Our server is located in Germany.

+

+ Contact information:
+ Jon Eugster
+ Mathematisches Institut der Heinrich-Heine-Universität Düsseldorf
+ Universitätsstr. 1
+ 40225 Düsseldorf
+ Germany
+ +49 211 81-12173
+ Contact Details +

+
+}