The A Game
About this app
Play the A Game with Player 1: A and Player 2: G
The A Game The A Game
Put this on your site
Source
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>The A Game</title>
<meta name="description" content="Play the A Game with Player 1: A and Player 2: G">
<meta name="keywords" content="A Game, Player 1, Player 2, A, G">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.
// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
const player1 = 'A';
const player2 = 'G';
const gameContainer = document.getElementById('game-container');
const resultContainer = document.getElementById('result-container');
function playGame() {
const randomNum = Math.random();
let result;
if (randomNum < 0.5) {
result = `${player1} wins!`;
} else {
result = `${player2} wins!`;
}
resultContainer.innerHTML = result;
}
gameContainer.addEventListener('click', playGame);
});
} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>
<style>
/* App CSS Goes Here */
body {
background-color: #f2f2f2;
font-family: 'Arial', sans-serif;
}
#main-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.game {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.game-title {
font-size: 24px;
font-weight: bold;
margin-bottom: 20px;
color: #333;
}
.game-container {
display: flex;
justify-content: center;
align-items: center;
width: 200px;
height: 200px;
border: 2px solid #333;
border-radius: 50%;
margin-bottom: 20px;
cursor: pointer;
transition: all 0.3s ease;
}
.game-container:hover {
transform: scale(1.05);
}
.result-container {
font-size: 18px;
font-weight: bold;
color: #333;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<div class="game">
<h1 class="game-title">The A Game</h1>
<div id="game-container" class="game-container">
<i class="fa fa-gamepad fa-5x"></i>
</div>
<div id="result-container" class="result-container"></div>
</div>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!