From d2e508797796c2d61d16cbf1493ec0936bd81e92 Mon Sep 17 00:00:00 2001 From: Saksham chandel <94097778+yung-coder@users.noreply.github.com> Date: Wed, 17 Aug 2022 19:03:31 +0530 Subject: [PATCH] modified --- src/plays/code-editor/CodeEditor.js | 12 ++ src/plays/code-editor/Editor.jsx | 1 + src/plays/code-editor/Modal.jsx | 110 ++++++++++++++++ src/plays/code-editor/close.png | Bin 0 -> 957 bytes src/plays/code-editor/modal.css | 194 ++++++++++++++++++++++++++++ src/plays/code-editor/styles.css | 7 + 6 files changed, 324 insertions(+) create mode 100644 src/plays/code-editor/Modal.jsx create mode 100644 src/plays/code-editor/close.png create mode 100644 src/plays/code-editor/modal.css diff --git a/src/plays/code-editor/CodeEditor.js b/src/plays/code-editor/CodeEditor.js index 5a71bd2af..9c6f87b11 100644 --- a/src/plays/code-editor/CodeEditor.js +++ b/src/plays/code-editor/CodeEditor.js @@ -3,6 +3,7 @@ import "./styles.css"; import React, { useState, useEffect } from "react"; import Editor from "./Editor"; import Button from './Button' +import Modal from './Modal'; // WARNING: Do not change the entry componenet name function CodeEditor(props) { // Your Code Start below. @@ -34,12 +35,22 @@ function CodeEditor(props) { return () => clearTimeout(timeOut); }, [html, css, js]); + + const [showModal, setShowModal] = useState(false); + + const toggle = (e) => { + + setShowModal(!showModal); + }; return ( <>
{/* Your Code Starts Here */} +
+ +
+ ); } diff --git a/src/plays/code-editor/Editor.jsx b/src/plays/code-editor/Editor.jsx index 2ab0a39d1..9202459ff 100644 --- a/src/plays/code-editor/Editor.jsx +++ b/src/plays/code-editor/Editor.jsx @@ -24,6 +24,7 @@ const Editor = ({ language, value, setEditorState }) => { } const themeArray = ['dracula', 'material', 'mdn-like', 'the-matrix', 'night'] + return (
diff --git a/src/plays/code-editor/Modal.jsx b/src/plays/code-editor/Modal.jsx new file mode 100644 index 000000000..6ff4ede35 --- /dev/null +++ b/src/plays/code-editor/Modal.jsx @@ -0,0 +1,110 @@ +// import { Fragment, useState, useEffect } from "react"; + +// import "./modal.css"; +// import close from './close.png' + +// const Modal = ({ showModal, toggle }) => { +// const [currState, setCurrentState] = useState(0); + + + +// useEffect(() => { +// setCurrentState(0); +// }, [showModal]); + +// const buttonHandler = (val) => (e) => { +// if ((currState === 0 && val < 0) || (currState === 3 && val > 0)) return; +// setCurrentState(currState + val); +// }; + +// if (!showModal) return false; + +// return ( +// + +//
+// close +//
+//

How to Play!

+//

Yo

+//
+// {currState > 0 ? :

} +// +//
+//
+//
+//
+// +// ); +// }; + +// export default Modal; + +import { Fragment, useState, useEffect } from "react"; + +// css +import "./modal.css"; + +// assets + +import close from './close.png' + +const Modal = ({ showModal, toggle }) => { + const [currState, setCurrentState] = useState(0); + + const structuringData = [ + { + info: "Click any of the box to unvail the the hidden image.", + + }, + { + info: "Now Click another box to unvail another image. if its not the same the both of them will be hidden again.", + + }, + { + info: "If the both images are matched they will stay visible and you want to uncover other images and also find their pair", + + }, + { + info: "Lastly images position will be different on every 'reset' button click any you can keep continue memorise the glimpse of the images and find their pair. ", + + }, + ]; + + useEffect(() => { + setCurrentState(0); + }, [showModal]); + + const buttonHandler = (val) => (e) => { + if ((currState === 0 && val < 0) || (currState === 3 && val > 0)) return; + setCurrentState(currState + val); + }; + if (!showModal) return false; + return ( + +
+ clonse +
+

How to Play!

+

{structuringData[currState].info}

+ {/* pic */} +
+ {currState > 0 ? :

} + +
+
+
+
+ + ); +}; + +export default Modal; diff --git a/src/plays/code-editor/close.png b/src/plays/code-editor/close.png new file mode 100644 index 0000000000000000000000000000000000000000..61330d6b1b1ce00ebfc878afa5b6c1f373d00a91 GIT binary patch literal 957 zcmV;u148_XP)U4#l?1;<&=|EB z{3rea?X0x4u@l5Xi4asQ#7-MYif9ay7&R(*(Gc`3=3baHcgfDqJF~M7OcB_b-RH@M zJ7%*zw6h)<0fvDsz#Q-hcu6^_0mp#Nz$`EZeC&4cFfau)JB%@4XW)y~WFPRHl^%b9 zJD6W?8^?jg4ioG#1@wo%c5mvy0;{{c0yfEnjllF86Uq{y4tyh<%PpC7HRA*s?|^{_ zGOoDDH-RN!E5L1sNiyC8dtz8+#8qC#m0nsE9O(z10egL~T!A|91gPYg+t-WvsLR7{ zU>q3CIbQ=Gd4MkfqqyHX_V_?CcS7FVUdA%5kM?!IYmbGRzzpWIHx|C~P2jG*;1K3^ z@QtuPh;BO?@{_>!{}-+TpFJ0z#l#Fn4fyJLjg!ExZYR))Fh`gO!R3V%BSe!Iv?3hH zYito+UeJi}3BL%1$qQN$4(2#_;qro3ghLMJOh#VNh%isK2+7F{F(M=@FK9(L++pqH zkth1e02k{4n{NK#%19U*CX zAykA?$P3yLN+mB;@!z~`Vz%9b$@hj@xV3hV!aCbX;|Y`#8eebi@e}h1zZ7W8+YwI0 z)5u3C`BFp(EpJCS8ObR#vE*emNGL*Vc{{?X2!5+llzb8qG~}lh)@T5y1G}z3a~n(J zYjXoQ6V%uu#2%hTghe7m2)Ti&72&L^u|_TUeJngx!Va+mKTCWsNuhZ zJ3*ZHimLekTkjHZP8O_Sww}u%FK9&g4)g(B_gpBpyr2=`Ccqny1&Wdvd?UPtwO^M@ zRbKFk@C(e}g6qW8p4H`zFc0w5aZ+mXLY@c@0j@brNaeQghHHfLVBQ%T&v0<+@saX7j$-625tZwVCCcMAc#L_gtc)DRJU5U# fcLKPN@dDr