Skip to content

Commit

Permalink
cleaned up the project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom van Weersch committed Oct 21, 2024
1 parent fc27931 commit 33d533d
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 176 deletions.
173 changes: 173 additions & 0 deletions css/stylesheet.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/* Add some basic styling to make the game look decent */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
height: 100vh; /* Full viewport height */
display: flex;
flex-direction: column;
justify-content: center; /* Center content vertically */
align-items: center; /* Center content horizontally */
background-color: #f0f0f0; /* Light background */
}

#start-screen {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}

#start-screen h1 {
font-size: 36px;
margin-bottom: 20px;
}

#start-screen p {
font-size: 18px;
margin-bottom: 40px;
}

#start-screen button {
width: 100px;
height: 40px;
font-size: 18px;
margin: 5px;
border: none;
border-radius: 5px;
cursor: pointer;
background-color: #4CAF50;
color: #fff;
}

#game-container {
display: none; /* Hide the game container initially */
flex-direction: column;
justify-content: space-between; /* Space between elements */
align-items: center; /* Center elements horizontally */
height: 80%; /* Adjust height as needed */
width: 80%; /* Adjust width as needed */
text-align: center;
background: white; /* White background for the game area */
border-radius: 8px; /* Rounded corners */
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Subtle shadow */
padding: 20px; /* Padding around the content */
}

#character-image {
width: 250px;
margin: 20px auto;
}

#input-field {
width: 80%; /* Full width of the input field */
height: 30px;
font-size: 18px;
padding: 10px;
margin-bottom: 10px; /* Space below the input */
}

button {
width: 100px;
height: 40px;
font-size: 18px;
margin: 5px; /* Space between buttons */
border: none;
border-radius: 5px;
cursor: pointer;
}

#submit-button {
background-color: #4CAF50; /* Green */
color: #fff;
}

#skip-button {
background-color: #ccc; /* Gray */
color: #333;
}

#give-up-button {
background-color: #f44336; /* Red */
color: #fff;
}

/* Modal styles */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
display: flex; /* Use flexbox for centering */
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
}

.modal-content {
background-color: #fefefe;
padding: 20px;
border: 1px solid #888;
width: 80%; /* Could be more or less, depending on screen size */
max-width: 500px; /* Limit the width for larger screens */
text-align: center; /* Center text inside modal */
border-radius: 8px; /* Rounded corners for the modal */
}

.close-button {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}

.close-button:hover,
.close-button:focus {
color: black;
text-decoration: none;
cursor: pointer;
}

#restart-button {
background-color: #4CAF50; /* Green */
color: white;
width: 100%; /* Full width for the button */
padding: 10px; /* Padding for the button */
border-radius: 5px; /* Rounded corners */
cursor: pointer;
}

/* Center the game over modal */
#game-over-modal .modal-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

}

.popup-message {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 10px 20px;
border-radius: 5px;
color: white;
font-size: 16px;
display: none; /* Initially hidden */
}

.correct-message {
background-color: #4CAF50; /* Green background for correct messages */
}

.wrong-message {
background-color: #f44336; /* Red background for wrong messages */
}
178 changes: 2 additions & 176 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,181 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Guess the Ow2 Hero</title>
<style>
/* Add some basic styling to make the game look decent */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
height: 100vh; /* Full viewport height */
display: flex;
flex-direction: column;
justify-content: center; /* Center content vertically */
align-items: center; /* Center content horizontally */
background-color: #f0f0f0; /* Light background */
}

#start-screen {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}

#start-screen h1 {
font-size: 36px;
margin-bottom: 20px;
}

#start-screen p {
font-size: 18px;
margin-bottom: 40px;
}

#start-screen button {
width: 100px;
height: 40px;
font-size: 18px;
margin: 5px;
border: none;
border-radius: 5px;
cursor: pointer;
background-color: #4CAF50;
color: #fff;
}

#game-container {
display: none; /* Hide the game container initially */
flex-direction: column;
justify-content: space-between; /* Space between elements */
align-items: center; /* Center elements horizontally */
height: 80%; /* Adjust height as needed */
width: 80%; /* Adjust width as needed */
text-align: center;
background: white; /* White background for the game area */
border-radius: 8px; /* Rounded corners */
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Subtle shadow */
padding: 20px; /* Padding around the content */
}

#character-image {
width: 250px;
margin: 20px auto;
}

#input-field {
width: 80%; /* Full width of the input field */
height: 30px;
font-size: 18px;
padding: 10px;
margin-bottom: 10px; /* Space below the input */
}

button {
width: 100px;
height: 40px;
font-size: 18px;
margin: 5px; /* Space between buttons */
border: none;
border-radius: 5px;
cursor: pointer;
}

#submit-button {
background-color: #4CAF50; /* Green */
color: #fff;
}

#skip-button {
background-color: #ccc; /* Gray */
color: #333;
}

#give-up-button {
background-color: #f44336; /* Red */
color: #fff;
}

/* Modal styles */
.modal {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
display: flex; /* Use flexbox for centering */
justify-content: center; /* Center horizontally */
align-items: center; /* Center vertically */
}

.modal-content {
background-color: #fefefe;
padding: 20px;
border: 1px solid #888;
width: 80%; /* Could be more or less, depending on screen size */
max-width: 500px; /* Limit the width for larger screens */
text-align: center; /* Center text inside modal */
border-radius: 8px; /* Rounded corners for the modal */
}

.close-button {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}

.close-button:hover,
.close-button:focus {
color: black;
text-decoration: none;
cursor: pointer;
}

#restart-button {
background-color: #4CAF50; /* Green */
color: white;
width: 100%; /* Full width for the button */
padding: 10px; /* Padding for the button */
border-radius: 5px; /* Rounded corners */
cursor: pointer;
}

/* Center the game over modal */
#game-over-modal .modal-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

}

.popup-message {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 10px 20px;
border-radius: 5px;
color: white;
font-size: 16px;
display: none; /* Initially hidden */
}

.correct-message {
background-color: #4CAF50; /* Green background for correct messages */
}

.wrong-message {
background-color: #f44336; /* Red background for wrong messages */
}
</style>
<link rel="stylesheet" href="css/stylesheet.css">
</head>
<body>
<div id="start-screen">
Expand All @@ -205,6 +31,6 @@ <h2>Game Over!</h2>
</div>
</div>

<script src="script.js"></script>
<script src="js/script.js"></script>
</body>
</html>
File renamed without changes.

0 comments on commit 33d533d

Please sign in to comment.