Three!
Nov 18, 2023
v.0
Help the number 3 escape from the descending numbers! Game Interactive Fun Escape Number Three

Versions  

Bugs  
None!

Get This App On Your Website

1. Copy the code above with the iframe and link.
2. Paste the code into your website.
3. Resize the iframe to fit your website.

Javascript, HTML, CSS Code

                
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript"> window.addEventListener('error', function(event) { var message = JSON.parse(JSON.stringify(event.message)); var source = event.filename; var lineno = event.lineno; var colno = event.colno; var error = event.error; window.parent.postMessage({ type: 'iframeError', details: { message: message, source: source, lineno: lineno, colno: colno, error: error ? error.stack : '' } }, '*'); }); window.addEventListener('unhandledrejection', function(event) { window.parent.postMessage({ type: 'iframePromiseRejection', details: { reason: event.reason } }, '*'); }); </script>

<meta charset="UTF-8">
<title>3, Run! Game</title>
<meta name="description" content="Help the number 3 escape from the descending numbers!">
<meta name="keywords" content="game, fun, escape, number, three, interactive">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body, html {
height: 100%;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
font-family: 'Press Start 2P', cursive;
background: linear-gradient(to right, #36d1dc, #5b86e5);
}
#game-container {
position: relative;
width: 300px;
height: 500px;
overflow: hidden;
border: 5px solid #fff;
border-radius: 10px;
background-color: #f9f9f9;
}
.number {
position: absolute;
width: 100%;
text-align: center;
font-size: 40px;
animation: descend 5s linear infinite;
}
@keyframes descend {
from { top: -50px; }
to { top: 500px; }
}
#number3 {
position: absolute;
bottom: 10px;
left: 50%;
transform: translateX(-50%);
font-size: 50px;
color: #e74c3c;
}
.game-over {
display: none;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
flex-direction: column;
justify-content: center;
align-items: center;
color: #ffffff;
font-size: 20px;
}
.game-over.active {
display: flex;
}
@font-face {
font-family: 'Press Start 2P';
src: url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
const gameContainer = document.getElementById('game-container');
const number3 = document.getElementById('number3');
const gameOverScreen = document.getElementById('game-over');
let gameInterval;

function startGame() {
gameInterval = setInterval(() => {
const newNumber = document.createElement('div');
newNumber.classList.add('number');
newNumber.textContent = Math.floor(Math.random() * 9) + 1;
gameContainer.appendChild(newNumber);
}, 1000);
}

function checkCollision() {
const numbers = document.querySelectorAll('.number');
numbers.forEach(number => {
const numberRect = number.getBoundingClientRect();
const number3Rect = number3.getBoundingClientRect();
if (numberRect.top + numberRect.height > number3Rect.top &&
numberRect.left < number3Rect.right &&
numberRect.right > number3Rect.left) {
clearInterval(gameInterval);
gameOverScreen.classList.add('active');
}
});
}

document.addEventListener('keydown', (e) => {
if (e.key === 'ArrowLeft' && number3.offsetLeft > 0) {
number3.style.left = `${number3.offsetLeft - 20}px`;
}
if (e.key === 'ArrowRight' && number3.offsetLeft < gameContainer.offsetWidth - number3.offsetWidth) {
number3.style.left = `${number3.offsetLeft + 20}px`;
}
});

setInterval(checkCollision, 100);
startGame();
});
</script>

<link rel="canonical" href="https://calculator.tools/app/three-754/">
<meta charset="utf-8">

</head>
<body>
<div id="game-container">
<div id="number3">3</div>
<div id="game-over" class="game-over">
<div>Game Over 😵</div>
<div>Press F5 to Restart</div>
</div>
</div>
<script type="text/javascript"> var localStoragePrefix = "ct-754"; var lastSave = 0; function saveLocal(data) { if (Date.now() - lastSave < 1000) { return; } let cookie = localStoragePrefix + "=" + JSON.stringify(data) + "; path=" + window.location.pathname + "'; SameSite=Strict"; cookie += "; expires=" + new Date(Date.now() + 1000 * 60 * 60 * 24 * 365 * 1000).toUTCString(); document.cookie = cookie; lastSave = Date.now(); } function loadLocal() { var cookiePrefix = localStoragePrefix + "="; var cookieStart = document.cookie.indexOf(cookiePrefix); if (cookieStart > -1) { let cookieEnd = document.cookie.indexOf(";", cookieStart); if (cookieEnd == -1) { cookieEnd = document.cookie.length; } var cookieData = document.cookie.substring(cookieStart + cookiePrefix.length, cookieEnd); return JSON.parse(cookieData); } } </script>
<script type="text/javascript"> window.addEventListener('load', function() { var observer = new MutationObserver(function() { window.parent.postMessage({height: document.documentElement.scrollHeight || document.body.scrollHeight},"*"); }); observer.observe(document.body, {attributes: true, childList: true, subtree: true}); window.parent.postMessage({height: document.documentElement.scrollHeight || document.body.scrollHeight},"*"); }); </script>
</body>
</html>

NEW APPS

These are apps made by the community!

FAQ

What is Calculator Tools?

Calculator Tools allows you to instantly create and generate any simple one page web app for free and immediately have it online to use and share. This means anything! Mini apps, calculators, trackers, tools, games, puzzles, screensavers... anything you can think of that the AI can handle.

The AI uses Javacript, HTML, and CSS programming to code your app up in moments. This currently uses GPT-4 the latest and most powerful version of the OpenAI GPT language model.

What Do You Mean Make An App?

Have you ever just wanted a simple app but didn't want to learn programming or pay someone to make it for you? Calculator Tools is the solution! Just type in your prompt and the AI will generate a simple app for you in seconds. You can then customize it to your liking and share it with your friends.

AI has become so powerful it is that simple these days.

Does This Use ChatGPT?

It uses GPT-4 which is the most powerful model for ChatGPT.

Calculator Tools does not remember things from prompt to prompt, each image is a unique image that does not reference any of the images or prompts previously supplied.