Skip to content

Murder mystery notepad#40

Open
nikolay-panovski wants to merge 22 commits intomainfrom
MM-Notepad
Open

Murder mystery notepad#40
nikolay-panovski wants to merge 22 commits intomainfrom
MM-Notepad

Conversation

@nikolay-panovski
Copy link
Copy Markdown
Collaborator

Goal of the issue

"Murder mystery" is an idea for a group custom game where solving a mystery in an "escape room" style in the real world will be combined with tasks and clues in this custom app. We want to have a character card for each participant, with the ability to save clues found during gameplay and take personal notes.

What did i do

Implemented a character card screen as a custom game (for custom games see #38 , "game-cat-story" branch) and added a notepad to it with predefined notes (currently pulled from successfully solved elements' postDescription) and textarea for free notes. All notes save to localStorage.

How to test

  • Ideally log in with a full (not try) account.
  • Load the "Murder mystery" quest (edit your .env if necessary, or generate a voucher QR through the generator in Settings)
  • Go in the "Character card" element (it is after the first info element).
  • Click the notepad icon in the top right.
  • Type something in the "Your notes" field. Click the save icon in the top right. Check if the text gets displayed automatically if you reload the page or log out and then back in.
  • Go out of the character card and solve one or more of the released tasks. Go back to the notepad in the character card. Check if you have received notes in the middle area. Again try to log out and back in, and check again.

Known issues

  • CSS: Page layout might be bad on most phone sizes and will certainly look broken on desktop. Tested size is 360x760 (set it up in Chrome's developer tabs).
  • Notepad can save only the first discovered predefined note from a solved element. Exact bug not found, but rewriting the Toto variable is suspected to be going wrong.

Will be useful in order to put an image as a background of the whole page.
I don't know what this is relevant for or where it came from; it was automatic.
The method might be unnecessary anyway? Currently the component does nothing new and it gets its markdown as a prop
'position: relative' for main container div
Saves locally to localStorage.
2048, as a consideration for localStorage saving; caveat is that the users are not told of the limitation.
Character name was changed from an Italian one to a French one in design some time ago, this is now reflected as "final".
Still a bug: only the first one gets saved.

the exact description/setup here (including on Toto side) probably fits in a whole blog post
Copy link
Copy Markdown
Owner

@kevinveld2001 kevinveld2001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally, it looks like it is working.

However, I found some points that can be improved.

return (<>
{!showNotepad && <>
{/* TODO: Randomize/appropriate backgroundImage per character */}
<div className="absolute inset-0 w-full h-full" style={{backgroundImage:"url(/MurderMystery/MM_CaseFile_Amelie.png)"}}>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://tailwindcss.com/docs/background-size
The background does not fill the background. Somtimes its to big or to small.

{/* Link drilled in the component (it should be identical to the global back button for every game - the real one is buried below the div and image here) */}
<Link to={`/quest/${sessionId}`} className={`absolute flex flex-row items-center m-5 mb-0 pr-10 self-start`} >
<MdArrowBackIos />
<span>back</span>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translate


<div className="fixed top-[40%] h-[60%] mt-8 inset-x-4">
<div className="relative h-[40%]">
<p>Found notes:</p>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translate

</div>

<div className="relative h-[50%]">
<label htmlFor="freenotes">Type your notes here:</label>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translate

</button>
</>
:
<p className="justify-center self-center">No notes</p>
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translate

@@ -0,0 +1,51 @@
import { useState } from "react";
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like all the custom games in the '/components/game/custom' nou some are in this folder some are in a other folder

@@ -0,0 +1,106 @@
import { useEffect, useState } from "react";
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like all the custom games in the '/components/game/custom' nou some are in this folder some are in a other folder

@nikolay-panovski
Copy link
Copy Markdown
Collaborator Author

Translations and folders handled. Background-size seems to work well. The divs/text on these screens could still be improved, which I don't plan to do.

(Credits to Kevin) Stretches worse than 'background: cover', but helps keep the div/text elements around the same place
@nikolay-panovski
Copy link
Copy Markdown
Collaborator Author

BREAKING - DO NOT MERGE: User notes ARE CLEARED from localStorage automatically on login!

This is mandated by a Clear-Site-Data header from the server! This makes the "save notes" implentation here broken/useless! It has to be fixed on the Toto side - by saving to a Toto variable instead or by telling the server to not clear localStorage for this app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants