diff --git a/src/components/RoomOne/RoomOne.css b/src/components/RoomOne/RoomOne.css index dcd9599..948f8cf 100644 --- a/src/components/RoomOne/RoomOne.css +++ b/src/components/RoomOne/RoomOne.css @@ -6,8 +6,8 @@ .room { background-image: var(--room-bg); background-size: cover; - width: 100vw; - height: 100vh; + width: 100svw; + height: 100svh; display: grid; padding: 0 2%; grid-template-columns: repeat(5, 1fr); @@ -145,6 +145,7 @@ .alpha-centauri { color: white; + margin-bottom: 3rem; } @media screen and (max-width: 1025px) { @@ -167,23 +168,51 @@ } } -@media screen and (max-width: 768px) { - /* .room { - grid-template-columns: repeat(2, 1fr); - grid-template-rows: repeat(6, 1fr); +@media screen and (max-height: 585px) { + .board { + width: 80%; + } + .lamp { + width: 110%; + } + .radio { + width: 70% + } + .door { + width: 60%; + } +} + +@media screen and (max-height: 480px) { + .room { + grid-template-columns: repeat(5, 1fr); + grid-template-rows: repeat(3, 1fr); grid-template-areas: - 'clock board' - 'bike door' - 'plant desk' - 'radio lamp'; - } */ + 'clock board board board lamp' + 'bike door door desk radio' + 'plant door door desk radio '; + } + .board { + width: 70%; + } + + .radio { + margin-bottom: 0rem; + } + .door { + width: 50%; + } +} + + +@media screen and (max-width: 768px) { + .room { padding: 0rem; } .board, .clock, - .radio, .plant, .bike { width: 90%; @@ -192,8 +221,12 @@ .desk-comp { width: 50%; } - .lamp { - width: 140%; + +} + +@media screen and (max-height: 300px) { + .board { + width: 70%; } } diff --git a/src/components/RoomOne/RoomOne.js b/src/components/RoomOne/RoomOne.js index 7faf4fe..c197323 100644 --- a/src/components/RoomOne/RoomOne.js +++ b/src/components/RoomOne/RoomOne.js @@ -44,7 +44,9 @@ export default function RoomOne() { }; useEffect(() => { - const cable = createConsumer('wss://escapelink-be-42ffc95e6cf7.herokuapp.com/cable'); + const cable = createConsumer( + 'wss://escapelink-be-42ffc95e6cf7.herokuapp.com/cable' + ); const newSubscription = cable.subscriptions.create( { channel: 'GameChannel', room: backendData }, { @@ -99,7 +101,6 @@ export default function RoomOne() { }); }; - useEffect(() => { if (winConditions.length === 5) { dataSubscription.send({ game_over: true }); @@ -115,7 +116,7 @@ export default function RoomOne() { }; const roomStyle = { - "--room-bg": lampClicked ? "none" : `url(${blueBackground})`, + '--room-bg': lampClicked ? 'none' : `url(${blueBackground})` }; const handlePopupOpen = (popupName) => { @@ -127,23 +128,23 @@ export default function RoomOne() { }; const handleClockClick = () => { - handlePopupOpen("puzzleThree"); + handlePopupOpen('puzzleThree'); }; const handleDeskCompClick = () => { - handlePopupOpen("puzzleOne"); + handlePopupOpen('puzzleOne'); }; const handleRadioClick = () => { - handlePopupOpen("puzzleTwo"); + handlePopupOpen('puzzleTwo'); }; const handlePlantClick = () => { - handlePopupOpen("puzzleFour"); + handlePopupOpen('puzzleFour'); }; const handleBikeClick = () => { - handlePopupOpen("puzzleFive"); + handlePopupOpen('puzzleFive'); }; const handleLampClick = () => { @@ -166,14 +167,6 @@ export default function RoomOne() { tabIndex={isDisabled.puzzleThree ? -1 : 0}> clock - + - {openPopup === "puzzleOne" && ( + {openPopup === 'puzzleOne' && ( setPuzzleState('puzzleOne')} winConditions={winConditions} @@ -219,7 +220,7 @@ export default function RoomOne() { puzzleCompleted={puzzleCompleted} /> )} - {openPopup === "puzzleTwo" && ( + {openPopup === 'puzzleTwo' && ( setPuzzleState('puzzleTwo')} winConditions={winConditions} @@ -228,7 +229,7 @@ export default function RoomOne() { puzzleCompleted={puzzleCompleted} /> )} - {openPopup === "puzzleThree" && ( + {openPopup === 'puzzleThree' && ( setPuzzleState('puzzleThree')} winConditions={winConditions} @@ -237,7 +238,7 @@ export default function RoomOne() { puzzleCompleted={puzzleCompleted} /> )} - {openPopup === "puzzleFour" && ( + {openPopup === 'puzzleFour' && ( setPuzzleState('puzzleFour')} winConditions={winConditions} @@ -246,7 +247,7 @@ export default function RoomOne() { puzzleCompleted={puzzleCompleted} /> )} - {openPopup === "puzzleFive" && ( + {openPopup === 'puzzleFive' && ( setPuzzleState('puzzleFive')} winConditions={winConditions} @@ -261,7 +262,9 @@ export default function RoomOne() { subscription={subscription} /> {roomStyle['--room-bg'] === 'none' && ( - ⏃⌰⌿⊑⏃ ☊⟒⋏⏁⏃⎍⍀⟟ + + ⏃⌰⌿⊑⏃ ☊⟒⋏⏁⏃⎍⍀⟟ + )} )}