From e33a768047250294ad727a91ddfd2aca53ab8dd2 Mon Sep 17 00:00:00 2001 From: Avery Berryman Date: Sun, 15 Oct 2023 17:39:16 -0600 Subject: [PATCH] Create first puzzle component --- src/components/Puzzle1/PuzzleOne.css | 54 ++++++++++++++++++++++++++++ src/components/Puzzle1/PuzzleOne.js | 26 ++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 src/components/Puzzle1/PuzzleOne.css create mode 100644 src/components/Puzzle1/PuzzleOne.js diff --git a/src/components/Puzzle1/PuzzleOne.css b/src/components/Puzzle1/PuzzleOne.css new file mode 100644 index 0000000..a66bdec --- /dev/null +++ b/src/components/Puzzle1/PuzzleOne.css @@ -0,0 +1,54 @@ +.popup { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background-color: rgba(255, 255, 255, 0.9); + border: 1px solid #ccc; + border-radius: 5px; + padding: 20px; + box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2); + z-index: 1000; + max-width: 400px; + } + + .popup h2 { + font-size: 1.5rem; + margin-bottom: 10px; + } + + .popup p { + font-size: 1.2rem; + margin-bottom: 10px; + } + + .popup input[type="text"] { + width: 100%; + padding: 10px; + font-size: 1rem; + border: 1px solid #ccc; + border-radius: 5px; + margin-bottom: 10px; + } + + .popup button { + background-color: #007bff; + color: #fff; + border: none; + border-radius: 5px; + padding: 10px 20px; + font-size: 1rem; + cursor: pointer; + margin-right: 10px; + } + + .popup button:last-child { + margin-right: 0; + background-color: #ccc; + color: #333; + } + + .popup button:hover { + background-color: #0056b3; + } + \ No newline at end of file diff --git a/src/components/Puzzle1/PuzzleOne.js b/src/components/Puzzle1/PuzzleOne.js new file mode 100644 index 0000000..d2cf751 --- /dev/null +++ b/src/components/Puzzle1/PuzzleOne.js @@ -0,0 +1,26 @@ +import React, { useState } from 'react'; +import './PuzzleOne.css' + +export default function Puzzle1({ onClose, onSubmit }) { + const [answer, setAnswer] = useState(''); + + const handleSubmit = () => { + onSubmit(answer); + onClose(); + }; + + return ( +
+

What's that displayed on Bob's computer? Looks like a cipher...maybe he kept some notes on his whiteboard?

+

Decode the cipher: what does the message on Bob's computer mean?

+ setAnswer(e.target.value)} + placeholder="Enter answer" + /> + + +
+ ); +}