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

Enhanced Home Page for Snake Game #3245

Merged
merged 1 commit into from
May 15, 2024
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
59 changes: 26 additions & 33 deletions Games/Snake_Game/index.html
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Snake Game</title>
<link
rel="shortcut icon"
href="./assets/images/favicon.ico"
type="image/x-icon"
/>
<!-- external css -->
<link rel="stylesheet" href="./style.css" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
/>
<link rel="stylesheet" href="./style.css" />
</head>

<body>
<div
style="
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Snake Game</title>
<link rel="shortcut icon" href="./assets/images/favicon.ico" type="image/x-icon" />
<!-- external css -->
<link rel="stylesheet" href="./style.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
<link rel="stylesheet" href="./style.css" />
</head>

<body>
<div style="
text-align: left;
font-size: 30px;
padding: 5px;
border: none;
background: #0c4522;
"
>
<a href="https://kunjgit.github.io/GameZone/"
><i style="color: white" class="fas fa-home home-icon"></i
></a>
<h1 class="heading">Snake Game</h1>
</div>
<div class="body">
">
<a href="https://kunjgit.github.io/GameZone/"><i style="color: white" class="fas fa-home home-icon"></i></a>
<h1 class="heading">Snake Game</h1>
</div>
<div class="body">
<div class="scores">
<button onclick="instructions()">Instructions</button>
<div id="scoreBox">Score: 0</div>
<div id="HiScore">HighScore: 0</div>
<div id="board"></div>
</div>
</body>
<script src="./script.js"></script>
</html>
<div id="board"></div>
</div>
</body>
<script src="./script.js"></script>

</html>
45 changes: 30 additions & 15 deletions Games/Snake_Game/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ button{


button {
position: absolute;
top: 5rem;
left: 42rem;
/* position: absolute; */
/* top: 5rem; */
/* left: 42rem; */
padding: 0.5rem 1rem;
font-size: 2rem;

Expand All @@ -44,34 +44,34 @@ button:hover {
#scoreBox{
border-radius: 1rem;
border: 2px solid #9E9E9E;
position: absolute;
/* position: absolute; */
font-size: 30px;
right: 40px;
top: 75px;
/* right: 40px; */
/* top: 75px; */
font-family: math;
padding: 3px 12px;
padding: 8px 12px;
}

#HiScore{
border-radius: 1rem;
position: absolute;
/* position: absolute; */
font-size: 30px;
right: 25px;
/* right: 25px; */
border: 2px solid #9E9E9E;
top: 125px;
/* top: 125px; */
font-family: math;
padding: 3px 12px;
padding: 8px 12px;
}

#board{
margin-top: 4%;
border-radius: 1rem;
position: absolute;
top: 23%;
border-radius: 1.5rem;
background: #0c4522;
width: 75vmin;
height: 75vmin;
border: 2px solid black;
display: grid;
border-radius: 50px;
grid-template-rows: repeat(18, 1fr);
grid-template-columns: repeat(18, 1fr);
}
Expand Down Expand Up @@ -113,4 +113,19 @@ a{
position: relative;
font-size: 30px;

}
}
.scores{
display: flex;
width: 70vw;
position: absolute;
top: 4rem;
justify-content: space-evenly;
}
body{
height: 100%;
overflow-y: hidden;
}

.fas{
margin-left: 20px;
}
Loading