Javascript, HTML, CSS Code
Copy
<html>
<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">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Kindergarten Word Adventure 🌈📚</title>
<meta name="description" content="A fun and educational game for kindergarten kids focusing on words, reading, and identifying letters.">
<meta name="keywords" content="kindergarten, word game, educational game, kids game, reading, letters">
<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">
<link href="https://fonts.googleapis.com/css?family=Bangers|Bubblegum+Sans|Fredoka+One|Patrick+Hand|Poppins&display=swap" rel="stylesheet">
<!-- Built-In Functions for Apps -->
<script type="text/javascript">
var localStoragePrefix = "ct-168141775848737";
var lastSave = 0;
// save to localstorage
function saveLocal(data) {
if (Date.now() - lastSave < 1000) {
return;
}
// save to cookie
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();
}
// load from localstorage
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">
// App Javascript Goes Here
$(document).ready(function() {
var words = ['apple', 'banana', 'cat', 'dog', 'elephant', 'fish', 'giraffe', 'hippo', 'iguana', 'jellyfish', 'kangaroo', 'lion', 'monkey', 'nurse', 'octopus', 'penguin', 'queen', 'rabbit', 'snake', 'tiger', 'umbrella', 'violin', 'whale', 'xylophone', 'yak', 'zebra'];
var currentWord = '';
var revealedLetters = [];
function newWord() {
currentWord = words[Math.floor(Math.random() * words.length)];
revealedLetters = [];
updateWordDisplay();
}
function updateWordDisplay() {
var displayWord = '';
for (var i = 0; i < currentWord.length; i++) {
if (revealedLetters.includes(currentWord[i])) {
displayWord += currentWord[i];
} else {
displayWord += '_ ';
}
}
$('#word-display').text(displayWord);
}
function revealLetter(letter) {
if (!revealedLetters.includes(letter)) {
revealedLetters.push(letter);
updateWordDisplay();
}
}
function checkWin() {
for (var i = 0; i < currentWord.length; i++) {
if (!revealedLetters.includes(currentWord[i])) {
return false;
}
}
return true;
}
function letterClick(e) {
revealLetter(e.target.textContent);
if (checkWin()) {
$('#win-message').fadeIn();
setTimeout(function() {
$('#win-message').fadeOut();
newWord();
}, 3000);
}
}
function init() {
$('.letter').click(letterClick);
newWord();
}
init();
});
</script>
<style>
/* App CSS Goes Here */
body {
font-family: 'Bangers', 'Bubblegum Sans', 'Fredoka One', 'Patrick Hand', 'Poppins', cursive;
background: linear-gradient(to right, #FFD700, #FFA500, #FF6347);
color: #5c5d5e;
}
#main-container {
text-align: center;
padding-top: 50px;
}
#word-display {
font-size: 48px;
margin-bottom: 30px;
}
.letter {
font-size: 30px;
background-color: #ffffff;
border-radius: 10px;
padding: 10px;
margin: 5px;
cursor: pointer;
display: inline-block;
}
.letter:hover {
background-color: #f0f0f0;
}
#win-message {
display: none;
font-size: 48px;
color: #ff4757;
}
</style>
<link rel="canonical" href="https://calculator.tools/prompt/349/">
<meta charset="utf-8">
</head>
<body>
<div id="main-container" class="container">
<!-- App HTML Goes Here -->
<h1>🌈 Kindergarten Word Adventure 📚</h1>
<p>Click on the letters to reveal them in the word! Can you guess the whole word? 😃</p>
<div id="word-display"></div>
<div id="letters">
<span class="letter">a</span>
<span class="letter">b</span>
<span class="letter">c</span>
<span class="letter">d</span>
<span class="letter">e</span>
<span class="letter">f</span>
<span class="letter">g</span>
<span class="letter">h</span>
<span class="letter">i</span>
<span class="letter">j</span>
<span class="letter">k</span>
<span class="letter">l</span>
<span class="letter">m</span>
<span class="letter">n</span>
<span class="letter">o</span>
<span class="letter">p</span>
<span class="letter">q</span>
<span class="letter">r</span>
<span class="letter">s</span>
<span class="letter">t</span>
<span class="letter">u</span>
<span class="letter">v</span>
<span class="letter">w</span>
<span class="letter">x</span>
<span class="letter">y</span>
<span class="letter">z</span>
</div>
<div id="win-message">🎉 You did it! Great job! 🎉</div>
</div>
<script type="text/javascript"> var localStoragePrefix = "ct-{{ cachebreaker }}"; 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>