Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 16 additions & 36 deletions client/components/Nav.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React, { Component } from 'react'
import { Component } from 'react'
import cookie from 'react-cookie'
import SkyLight from 'react-skylight'
import classNames from 'classnames'
import levels from '../levels'

class Nav extends Component {
export default class Nav extends Component {
handleKeyPress (e) {
if (e.which === 27) {
this.refs.storyBox.hide()
Expand All @@ -29,25 +28,10 @@ class Nav extends Component {
}

render () {
let modalLeft = '50%'
if (window.innerWidth < 600) {
modalLeft = '41%'
}
const storyAndInstructionsStyle = {
backgroundColor: '#00897B',
color: '#ffffff',
borderRadius: '2%',
padding: '0 30px 0 30px',
overflowY: 'auto'
}
const levelsModalLeft = window.innerWidth < 600 ? '41%' : '50%'
const levelsModalStyle = {
backgroundColor: '#00897B',
color: '#ffffff',
width: '50%',
borderRadius: '2%',
padding: '0 30px 0 30px',
overflowY: 'auto',
left: modalLeft
left: levelsModalLeft
}
return (
<div className='navigation'>
Expand All @@ -60,14 +44,13 @@ class Nav extends Component {
<div className='levels' onClick={() => this.refs.levelSelect.show()}>{'Level ' + this.props.currentLevel}</div>
<SkyLight hideOnOverlayClicked ref='levelSelect' dialogStyles={levelsModalStyle}>
<div className='about-backstory level-select-container'>
<h3 className={classNames('modal-heading', 'about-backstory')}>Select a level</h3>
<h3 className='modal-heading'>Select a level</h3>
{
Object.keys(levels).map((levelNum, index) => {
return (
<div
key={index}
className='level-select'

onClick={() => { this.props.setLevel(levelNum); this.refs.levelSelect.hide() }}
>
<p>{'Level ' + levelNum}</p>
Expand All @@ -81,10 +64,10 @@ class Nav extends Component {
<div className='sound' onClick={this.props.toggleSound}>
{this.props.sound ? <i className='fa fa-volume-up fa-lg' /> : <i className='fa fa-volume-off fa-lg' />}
</div>
<SkyLight hideOnOverlayClicked ref='storyBox' dialogStyles={storyAndInstructionsStyle}>
<SkyLight hideOnOverlayClicked ref='storyBox'>
<div className='about-backstory'>
<img src='/resources/images/intro-b3.svg' className='intro-b3' />
<h3 className={classNames('modal-heading', 'about-backstory')}>Beep Boop</h3>
<h3 className='modal-heading'>Beep Boop</h3>
<p>B3 Just powered up...</p>
<p>B3 is a retired helper bot. It has just woken up on board an abandoned freight space ship that is on a collision course with Earth!</p>
<p>Help B3 get through the ship to the control room so that it can divert the ship's course and save the human race!</p>
Expand All @@ -98,20 +81,19 @@ class Nav extends Component {
</div>
</div>
</SkyLight>
<SkyLight hideOnOverlayClicked ref='howToPlayBox' dialogStyles={storyAndInstructionsStyle}>
<SkyLight hideOnOverlayClicked ref='howToPlayBox'>
<div className='about-backstory'>
<h3 className={classNames('modal-heading', 'about-backstory')}>Your Mission</h3>
<h3 className='modal-heading'>Your Mission</h3>
<p>Get B3 <img src='/resources/images/b3-robot.svg' className='how-to-small' /> to the elevator <img src='/resources/images/elevator-top.svg' className='how-to-small' /> on each level. </p>
<p>B3 has a limited number of moves for each level. Use your moves wisely! </p>
<p>Use the control buttons to queue up some commands. Press 'GO' and B3 will follow your commands!</p>
<div className='controls-container'>
<h3 className={classNames('modal-heading', 'about-backstory')}>Controls</h3>
<p>Use <img src='/resources/images/go-button.svg' className='control-small' /> to move B3 forward.</p>
<p>Use <img src='/resources/images/rotate-left-button.svg' className='control-small' /> and <img src='/resources/images/rotate-right-button.svg' className='control-small' /> to rotate B3 left and right.</p>
<p>Use <img src='/resources/images/jump-button.svg' className='how-to-small' /> to jump B3 on to a box.</p>
<p>Remove a queued command by clicking on it.</p>
<p>You must jump from box to box. Avoid holes in the ground.</p>
</div>

<h3 className='modal-heading'>Controls</h3>
<p>Use <img src='/resources/images/go-button.svg' className='control-small' /> to move B3 forward.</p>
<p>Use <img src='/resources/images/rotate-left-button.svg' className='control-small' /> and <img src='/resources/images/rotate-right-button.svg' className='control-small' /> to rotate B3 left and right.</p>
<p>Use <img src='/resources/images/jump-button.svg' className='how-to-small' /> to jump B3 on to a box.</p>
<p>Remove a queued command by clicking on it.</p>
<p>You must jump from box to box. Avoid holes in the ground.</p>
<br />
<div className='modal-button-container'>
<a className='modal-button modal-animate how-to-action' onClick={() => { this.refs.howToPlayBox.hide() }}>
Expand All @@ -125,5 +107,3 @@ class Nav extends Component {
)
}
}

export default Nav
35 changes: 18 additions & 17 deletions client/scss/board.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use './colors';
@use './zindex';

#board {
width: 70%;
Expand All @@ -13,10 +14,6 @@
width: 100%;
height: 48%;
}
@media screen and (max-width: 320px) {
width: 100%;
height: 44%;
}
}

.board-background {
Expand Down Expand Up @@ -92,6 +89,7 @@
}

.tile {
z-index: zindex.$z-tile;
display: flex;
justify-content: center;
align-content: center;
Expand All @@ -117,22 +115,27 @@
}

.clear {
background: rgba(0,0,0,0.0);
background: transparent;
padding-bottom: 1%;
border-bottom: 2vh solid rgba(0,0,0,0.0);
border-bottom: 2vh solid transparent;
}

/* Have to put the black hole zindex on the tile
* to make it render below surrounding tiles */
.clear:has(> .hole) {
z-index: zindex.$z-black-hole;
}

.hole {
width: 105%;
-webkit-animation: spin 0.5s infinite linear;
animation: spin 1.2s infinite linear;
}
@-webkit-keyframes spin {
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}

100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}

Expand Down Expand Up @@ -188,7 +191,8 @@
}

.box-tile {
width: 93%;
z-index: zindex.$z-box;
width: 90%;
margin-bottom: 7%;
}

Expand All @@ -204,16 +208,13 @@
margin-bottom: 10%;
top: 0;
position: relative;
-webkit-animation-name: fadeOutUp; /* Chrome, Safari, Opera */
-webkit-animation-duration: 4s; /* Chrome, Safari, Opera */
animation-name: fadeOutUp;;
animation-duration: 4s;
animation-name: fadeOutUp;
animation-duration: 4s;

@keyframes fadeOutUp {
from {
opacity: 1;
}

to {
opacity: 0;
transform: translate3d(0, -100%, 0);
Expand Down
128 changes: 47 additions & 81 deletions client/scss/commandPane.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$actionButtonElevation: 7px;

.command-pane {
display:flex;
display: flex;
box-sizing: border-box;
width: 30%;
height: 90%;
Expand All @@ -23,63 +23,65 @@ $actionButtonElevation: 7px;
}

.command-queue {
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: flex-start;
overflow-y: scroll;

width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: flex-start;
overflow-y: scroll;
}

.command-queue::-webkit-scrollbar-track {
border-radius: 10px;
background-color: rgba(0,0,0,0.0);
border-radius: 10px;
background-color: rgba(0, 0, 0, 0.0);
}

.command-queue::-webkit-scrollbar {
width: 12px;
background-color: rgba(0,0,0,0.0);
width: 12px;
background-color: rgba(0, 0, 0, 0.0);
}

.command-queue::-webkit-scrollbar-thumb {
border-radius: 10px;
background-color: colors.$blue-darkest;
border-radius: 10px;
background-color: colors.$blue-darkest;
}

.moves-left {
line-height: 100%;
font-size: 21px;
color: white;
line-height: 100%;
font-size: 21px;
color: white;
text-shadow: 0px -2px rgba(0, 0, 0, 0.2);

@media screen and (max-width: 850px){
line-height: 0%;
}
@media screen and (max-width: 850px) {
line-height: 0%;
}
}

.command-container {
height: 28%;
width: 80%;
display:flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: flex-start;
align-content: flex-start;
align-items: flex-start;
border-left: 7px solid colors.$blue-darkest;
border-top: 7px solid colors.$blue-darkest;
background: colors.$blue-darker;
border-radius: 10px;
overflow-y: scroll;
height: 28%;
width: 80%;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: flex-start;
align-content: flex-start;
align-items: flex-start;
border-left: 7px solid colors.$blue-darkest;
border-top: 7px solid colors.$blue-darkest;
background: colors.$blue-darker;
border-radius: 10px;
overflow-y: scroll;

@media screen and (max-width: 850px) {
height: 20%;
width: 93%;
}
@media screen and (max-width: 850px) {
height: 20%;
width: 93%;
}
}

.runButtons-container {
height: 30%;
width: 80%;
display:flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
Expand All @@ -97,28 +99,12 @@ $actionButtonElevation: 7px;
width: 58%;
border-top: none;
}

@media screen and (max-width: 320px) {
height: 29%;
}
}


.moves-left {
line-height: 100%;
font-size: 21px;
color: white;
text-shadow: 0px -2px rgba(0, 0, 0, 0.2);

@media screen and (max-width: 850px){
line-height: 0%;
}
}

.action-button-container {
height: 20%;
width: 80%;
display:flex;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
Expand Down Expand Up @@ -147,20 +133,10 @@ $actionButtonElevation: 7px;
background: colors.$white-dark;
border-bottom: $actionButtonElevation solid #a4a4a4;

@media screen and (max-width: 1400px) {
height: 50%;
width: 50%;
}

@media screen and (max-width: 1200px) {
height: 21%;
width: 79%;
}

@media screen and (max-width: 1000px) {
height: 15%;
width: 79%;
margin: -78px -8px 6px 9px;
margin: 9px 0 6px 9px;
height: 37px;
width: 70px;
}

@media screen and (max-width: 850px) {
Expand All @@ -184,16 +160,6 @@ $actionButtonElevation: 7px;
background: colors.$orange;
border-bottom: $actionButtonElevation solid colors.$orange-dark;
}
.moves-left {
line-height: 100%;
font-size: 21px;
color: white;
text-shadow: 0px -2px rgba(0, 0, 0, 0.2);

@media screen and (max-width: 850px){
line-height: 0%;
}
}

.action-rotate:hover {
background: #ee9272;
Expand All @@ -216,9 +182,9 @@ $actionButtonElevation: 7px;
}

.action-button:active {
transform: translate(0px,$actionButtonElevation);
-webkit-transform: translate(0px,$actionButtonElevation);
transform: translate(0px, $actionButtonElevation);
-webkit-transform: translate(0px, $actionButtonElevation);
border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}
}
}
}
Loading