Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling fixes #27

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# bustzombie
react project
A React project

# Contributors
Monica, Sangita, Artemis

# Licence


# Description

A simple game based on React's features. The player attempts to bust as many zombie-faces as possible in the given time. To do so, the player needs to click fast on the zombie icons, which, however, pop up again.
If the player clears the screen before the game is over, the player wins. If there are still zombie icons on the screen, the player loses.
1 change: 1 addition & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta charset="utf-8">
<title>Bust Zombie</title>
<link rel="stylesheet" href="/style.e308ff8e.css">
<link href="https://fonts.googleapis.com/css?family=Eater|Oswald" rel="stylesheet">
<script src="/style.e308ff8e.js"></script><link rel="stylesheet" href="/src.7ed060e2.css"></head>

<body>
Expand Down
26 changes: 24 additions & 2 deletions dist/src.7ed060e2.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import url("https://fonts.googleapis.com/css?family=Eater|Oswald");

/*
#41463D
#FE621D
Expand Down Expand Up @@ -47,6 +45,14 @@ h1 {
letter-spacing: 8px;
}

#game-over {
font-family: "Eater", cursive;
color: #2E88A0;
margin: 0;
letter-spacing: 8px;
text-align: center;
}

p {
margin: 24px;
}
Expand Down Expand Up @@ -86,3 +92,19 @@ img {
height: calc(75vmin / 3);
width: calc(75vmin / 3);
}

.timer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: calc(75vmin / 6);
width: calc(75vmin / 6);
background-color: rgb(52, 160, 190);
border: 8px solid #41463d;
text-align: center;
font-family: "Oswald", sans-serif;
color: #41463d;
font-size: 2.5rem;
padding: 0.5rem;
}
29 changes: 9 additions & 20 deletions dist/src.7ed060e2.js
Original file line number Diff line number Diff line change
Expand Up @@ -22337,24 +22337,6 @@ function (_React$Component) {

_createClass(Timer, [{
key: "render",
// state = {
// counting: false,
// seconds: 60
// };
// componentDidMount() {
// this.intervalId = setInterval(
// this.decrement, 1000)
// }
// decrement = () => {
// this.setState((prevState) => {
// if (prevState.seconds == 1) {
// clearInterval(this.intervalId);
// }
// return {
// seconds:prevState.seconds - 1
// };
// }
// )};
value: function render() {
return _react.default.createElement("div", {
className: "timer"
Expand Down Expand Up @@ -22410,7 +22392,9 @@ function (_React$Component) {
_createClass(Result, [{
key: "render",
value: function render() {
return _react.default.createElement("h2", null, "Game over!");
return _react.default.createElement("h2", {
id: "game-over"
}, "Game over!");
}
}]);

Expand Down Expand Up @@ -22500,6 +22484,11 @@ function (_React$Component) {
value: function componentDidMount() {
this.intervalId = setInterval(this.decrement, 1000);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
clearInterval(this.intervalId);
}
}, {
key: "render",
value: function render() {
Expand Down Expand Up @@ -22747,7 +22736,7 @@ var parent = module.bundle.parent;
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
var hostname = "" || location.hostname;
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
var ws = new WebSocket(protocol + '://' + hostname + ':' + "37507" + '/');
var ws = new WebSocket(protocol + '://' + hostname + ':' + "38395" + '/');

ws.onmessage = function (event) {
var data = JSON.parse(event.data);
Expand Down
2 changes: 1 addition & 1 deletion dist/src.7ed060e2.map

Large diffs are not rendered by default.

26 changes: 24 additions & 2 deletions dist/style.e308ff8e.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import url("https://fonts.googleapis.com/css?family=Eater|Oswald");

/*
#41463D
#FE621D
Expand Down Expand Up @@ -47,6 +45,14 @@ h1 {
letter-spacing: 8px;
}

#game-over {
font-family: "Eater", cursive;
color: #2E88A0;
margin: 0;
letter-spacing: 8px;
text-align: center;
}

p {
margin: 24px;
}
Expand Down Expand Up @@ -86,3 +92,19 @@ img {
height: calc(75vmin / 3);
width: calc(75vmin / 3);
}

.timer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: calc(75vmin / 6);
width: calc(75vmin / 6);
background-color: rgb(52, 160, 190);
border: 8px solid #41463d;
text-align: center;
font-family: "Oswald", sans-serif;
color: #41463d;
font-size: 2.5rem;
padding: 0.5rem;
}
2 changes: 1 addition & 1 deletion dist/style.e308ff8e.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ var parent = module.bundle.parent;
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
var hostname = "" || location.hostname;
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
var ws = new WebSocket(protocol + '://' + hostname + ':' + "37507" + '/');
var ws = new WebSocket(protocol + '://' + hostname + ':' + "38395" + '/');

ws.onmessage = function (event) {
var data = JSON.parse(event.data);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"test": "jest --watch",
"start": "parcel public/index.html"
"build": "parcel build public/index.html"
},
"keywords": [],
"author": "",
Expand Down
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta charset="utf-8">
<title>Bust Zombie</title>
<link rel="stylesheet" href="./style.css">
<link href="https://fonts.googleapis.com/css?family=Eater|Oswald" rel="stylesheet">
</head>

<body>
Expand Down
26 changes: 24 additions & 2 deletions public/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import url("https://fonts.googleapis.com/css?family=Eater|Oswald");

/*
#41463D
#FE621D
Expand Down Expand Up @@ -47,6 +45,14 @@ h1 {
letter-spacing: 8px;
}

#game-over {
font-family: "Eater", cursive;
color: #2E88A0;
margin: 0;
letter-spacing: 8px;
text-align: center;
}

p {
margin: 24px;
}
Expand Down Expand Up @@ -86,3 +92,19 @@ img {
height: calc(75vmin / 3);
width: calc(75vmin / 3);
}

.timer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: calc(75vmin / 6);
width: calc(75vmin / 6);
background-color: rgb(52, 160, 190);
border: 8px solid #41463d;
text-align: center;
font-family: "Oswald", sans-serif;
color: #41463d;
font-size: 2.5rem;
padding: 0.5rem;
}
3 changes: 3 additions & 0 deletions src/components/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ componentDidMount() {
this.intervalId = setInterval(
this.decrement, 1000)
}
componentWillUnmount() {
clearInterval(this.intervalId);
}

decrement = () => {
this.setState((prevState) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/gameOver.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react'
export default class Result extends React.Component {
render() {
return (
<h2>Game over!</h2>
<h2 id='game-over'>Game over!</h2>
);
}
}
22 changes: 1 addition & 21 deletions src/components/timer.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
import React from 'react'

export default class Timer extends React.Component {
// state = {
// counting: false,
// seconds: 60
// };
// componentDidMount() {
// this.intervalId = setInterval(
// this.decrement, 1000)
// }

// decrement = () => {
// this.setState((prevState) => {
// if (prevState.seconds == 1) {
// clearInterval(this.intervalId);
// }
// return {
// seconds:prevState.seconds - 1
// };
// }

// )};


render() {
return (
<div className='timer'>
Expand Down