-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
137 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,118 @@ | ||
/*BODY STUFFS*/ | ||
body { | ||
text-align: center; | ||
background-color: #0e0e0e; | ||
font-family: "Press Start 2P", Arial, Serif; | ||
} | ||
body > h1 { | ||
margin-top: -5px; | ||
margin-bottom: -3px; | ||
height: 100%; | ||
margin: 0 !important; | ||
position: relative; | ||
text-align: center; | ||
width: 100%; | ||
} | ||
|
||
/*BOARD*/ | ||
.game { | ||
background-color: #3b3b62; | ||
display: inline-block; | ||
margin: 0 auto; | ||
.initial-text { | ||
border: 1px dashed #fafafa; | ||
color: #fafafa; | ||
display: flex; | ||
flex-direction: column; | ||
margin: auto; | ||
left: 35%; | ||
padding: 30px; | ||
position: absolute; | ||
top: 20%; | ||
right: 35%; | ||
} | ||
|
||
#canvas { | ||
visibility: hidden; | ||
.initial-text > .initial-buttons { | ||
align-items: center; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-around; | ||
} | ||
|
||
.notification { | ||
display: none; | ||
background-color: black; | ||
color: red; | ||
.initial-text > .initial-buttons * { | ||
background-color: rgba(0, 0, 0, 0); | ||
border: 1px solid #fafafa; | ||
border-radius: 5px; | ||
color: inherit; | ||
cursor: pointer; | ||
font-family: inherit; | ||
padding: 15px; | ||
width: 175px; | ||
} | ||
|
||
/*BUTTONS*/ | ||
button { | ||
background-color: grey; | ||
border: 1px solid black; | ||
font-family: "Press Start 2P", Arial, Serif; | ||
margin: 5px; | ||
height: 45px; | ||
width: 300px; | ||
.initial-text > .initial-buttons *:hover { | ||
background-color: #fafafa; | ||
box-shadow: 2px 2px 2px #bcbaba; | ||
color: #0e0e0e; | ||
} | ||
|
||
.content { | ||
margin-top: 64px; | ||
.initial-text > .initial-buttons > .controls, | ||
.initial-text > .initial-buttons > .continue { | ||
margin: 15px 0; | ||
} | ||
|
||
.resume { | ||
.controls-info, | ||
.highscores-container { | ||
display: none; | ||
text-align: left; | ||
} | ||
|
||
.reset { | ||
.back, | ||
.reset, | ||
.continue { | ||
display: none; | ||
} | ||
|
||
.playAgain { | ||
display: none; | ||
} | ||
|
||
.settings { | ||
display: inline-block; | ||
.back { | ||
margin-bottom: 20px; | ||
} | ||
|
||
.home { | ||
display: none; | ||
.header { | ||
background-color: #0e0e0e; | ||
height: 79px; | ||
} | ||
|
||
.pause { | ||
.header-content { | ||
align-items: center; | ||
border-bottom: 1px solid #fafafa; | ||
display: none; | ||
justify-content: space-between; | ||
padding: 0 10px; | ||
} | ||
|
||
.mobileButton { | ||
display: none; | ||
.header-content > h2 { | ||
color: #fafafa; | ||
} | ||
|
||
.mobileButtonCenter { | ||
text-align: center; | ||
.header-content > .score { | ||
color: #39b513; | ||
} | ||
|
||
.mobileButtonCenter button { | ||
width: 80px; | ||
.header-content > .timer { | ||
color: #f94343; | ||
} | ||
|
||
.left--right button { | ||
margin: 0 40px; | ||
} | ||
@media screen and (max-width: 600px) { | ||
.initial-text { | ||
left: 15%; | ||
right: 15%; | ||
} | ||
|
||
@media screen and (max-width: 960px) { | ||
.mobileButton { | ||
.mobile { | ||
display: block; | ||
} | ||
|
||
.content { | ||
margin-top: 25px; | ||
.desktop { | ||
display: none; | ||
} | ||
} | ||
|
||
@media screen and (min-width: 601px) { | ||
.mobile { | ||
display: none; | ||
} | ||
|
||
.desktop { | ||
display: block; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,61 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>SNAKE</title> | ||
<link href='https://fonts.googleapis.com/css?family=Press+Start+2P' rel='stylesheet' type='text/css'> | ||
<link rel="stylesheet" href="css/style.css"> | ||
<link rel="stylesheet" src="//normalize-css.googlecode.com/svn/trunk/normalize.css"/> | ||
<meta name="viewport" content="width=device-width" /> | ||
<script src="https://cdn.firebase.com/js/client/2.4.0/firebase.js"></script> | ||
</head> | ||
<body> | ||
<div class="content"> | ||
<h1>SNAKE</h1> | ||
<h1><span class="currentScore"></span></h1> | ||
<div class="game"> | ||
<canvas id="canvas"> | ||
YOUR BROWSER DOESN'T SUPPORT CANVAS YET | ||
</canvas> | ||
</div> | ||
<div class="notification"> | ||
<h1>YOU DIED!</h1> | ||
<h3 class="score"></h3> | ||
</div> | ||
<div class="buttons"> | ||
<button class="playAgain" onclick="playAgain();"> PLAY AGAIN!</button> | ||
<button class="start" onclick="startGame();">START</button> | ||
<div class="mobileButton"> | ||
<div class="mobileButtonCenter"> | ||
<button onclick="mobileUp();"> UP </button> | ||
</div> | ||
<div class="mobileButtonCenter left--right"> | ||
<button onclick="mobileLeft();"> LEFT </button> | ||
<button onclick="mobileRight();"> RIGHT </button> | ||
</div> | ||
<div class="mobileButtonCenter"> | ||
<button onclick="mobileDown();"> DOWN </button> | ||
</div> | ||
</div> | ||
<button class="home" onclick="homeButton();">HOME</button> | ||
<button class="reset" onclick="resetGame();">RESET</button> | ||
<button class="pause" onclick="pauseGame();">PAUSE</button> | ||
<button class="resume" onclick="resumeGame();">RESUME</button> | ||
<button class="mute" onclick="muteGame();">Music: <span class="musicSetting"> On</span></button> | ||
<h1>HIGHSCORE: <span id="highScore"></span> </h1> | ||
</div> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>SNAKE</title> | ||
<link href='https://fonts.googleapis.com/css?family=Press+Start+2P' rel='stylesheet' type='text/css'> | ||
<link rel="stylesheet" href="css/style.css"> | ||
<link rel="stylesheet" src="//normalize-css.googlecode.com/svn/trunk/normalize.css" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
</head> | ||
|
||
<body> | ||
<div class="header"> | ||
<div class="header-content" id="header"> | ||
<h2>SNAKE</h2> | ||
<div class="score"> | ||
Current Score: <span id="currentScore">0</span> | ||
</div> | ||
<audio src="assets/run.mp3" id="run" loop></audio> | ||
<audio src="assets/dying.mp3" id="die"></audio> | ||
<audio src="assets/eat.wav" id="eat"></audio> | ||
<script src="js/script.js"></script> | ||
</body> | ||
</html> | ||
<div id="bonusFoodTimer"></div> | ||
</div> | ||
</div> | ||
<div class="initial-text" id="infoContainer"> | ||
<h1>SNAKE</h1> | ||
<div class="initial-buttons"> | ||
<button class="reset" id="reset"> RESET </button> | ||
<button class="start" id="start"> START </button> | ||
<button class="controls" id="controls"> CONTROLS </button> | ||
<button class="continue" id="continue"> CONTINUE </button> | ||
<button class="back" id="back"> BACK </button> | ||
</div> | ||
<div id="controlsInfo" class="controls-info"> | ||
<div class="desktop"> | ||
<div>W = Up</div> | ||
<div>S = Down</div> | ||
<div>A = Left</div> | ||
<div>D = Right</div> | ||
<div>SPACEBAR = Start/Pause</div> | ||
</div> | ||
<div class="mobile"> | ||
<div>Swipe up = Up</div> | ||
<div>Swipe down = Down</div> | ||
<div>Swipe left = Left</div> | ||
<div>Swipe right = Right</div> | ||
</div> | ||
</div> | ||
<div id="scoresInfo" class="controls-info"> | ||
|
||
</div> | ||
</div> | ||
<div class="content"> | ||
<div class="game"> | ||
<canvas id="canvas"> | ||
YOUR BROWSER DOESN'T SUPPORT CANVAS YET | ||
</canvas> | ||
</div> | ||
</div> | ||
<script src="js/main.js"></script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.