Calculator Tools Calculator Tools
Create

Fast Push (Pop Fidget Kids Games Toys)

Oct 4, 2023

About this app

Fast Push (Pop Fidget Kids Games Toys) - A virtual pop fidget toy game.

Fast Push (Pop Fidget Kids Games Toys) Color: Red Orange Yellow Green Blue Purple Pink Indigo Shape: Circle Yellow Circle Green Circle Blue Circle Purple Circle Brown Circle Black Circle White Circle Reset

Related apps

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>Fast Push (Pop Fidget Kids Games Toys)</title>
<meta name="description" content="Fast Push (Pop Fidget Kids Games Toys) - A virtual pop fidget toy game.">
<meta name="keywords" content="fast push, pop fidget, kids games, toys, virtual toy, pop bubbles">

<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() {
// Constants
const COLORS = ["#FF5858", "#FF9F1C", "#FFCD56", "#4BC0C0", "#36A2EB", "#9966FF", "#F78DA7", "#885AF2"];
const SHAPE_ICONS = ["🔴", "🟡", "🟢", "🔵", "🟣", "🟤", "⚫️", "⚪️"];

// Variables
let selectedColor = COLORS[0];
let selectedShapeIcon = SHAPE_ICONS[0];

// Initialize game
initGame();

function initGame() {
createFidgetToy();
}

function createFidgetToy() {
const fidgetToyContainer = document.getElementById("fidget-toy-container");

// Clear previous fidget toy
fidgetToyContainer.innerHTML = "";

// Create bubbles
for (let i = 0; i < 16; i++) {
const bubble = document.createElement("div");
bubble.classList.add("bubble");
bubble.style.backgroundColor = selectedColor;
bubble.innerHTML = selectedShapeIcon;
bubble.addEventListener("click", popBubble);
fidgetToyContainer.appendChild(bubble);
}
}

function popBubble(event) {
const bubble = event.target;
bubble.classList.add("popped");
bubble.removeEventListener("click", popBubble);
playPopSound();
}

function playPopSound() {
// Add sound effect here
}

function resetFidgetToy() {
const bubbles = document.getElementsByClassName("bubble");

// Reset bubbles
for (let i = 0; i < bubbles.length; i++) {
const bubble = bubbles[i];
bubble.classList.remove("popped");
bubble.addEventListener("click", popBubble);
}
}

function changeColor(color) {
selectedColor = color;
createFidgetToy();
}

function changeShapeIcon(shapeIcon) {
selectedShapeIcon = shapeIcon;
createFidgetToy();
}

// Event listeners
document.getElementById("reset-button").addEventListener("click", resetFidgetToy);
document.getElementById("color-select").addEventListener("change", function() {
changeColor(this.value);
});
document.getElementById("shape-select").addEventListener("change", function() {
changeShapeIcon(this.value);
});
});

} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>

<style>
/* App CSS Goes Here */
body {
background-color: #f8f9fa;
font-family: 'Arial', sans-serif;
}

#main-container {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 50px;
}

#fidget-toy-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 20px;
}

.bubble {
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
border-radius: 50%;
margin: 5px;
font-size: 20px;
color: #fff;
cursor: pointer;
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
transition: background-color 0.3s;
}

.bubble.popped {
background-color: #e9ecef;
color: #000;
cursor: default;
}

#options-container {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 20px;
}

.option-label {
margin-right: 10px;
}

.reset-button {
padding: 5px 10px;
border-radius: 5px;
background-color: #dc3545;
color: #fff;
border: none;
cursor: pointer;
transition: background-color 0.3s;
}

.reset-button:hover {
background-color: #c82333;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<div id="fidget-toy-container"></div>

<div id="options-container">
<label for="color-select" class="option-label">Color:</label>
<select id="color-select">
<option value="#FF5858">Red</option>
<option value="#FF9F1C">Orange</option>
<option value="#FFCD56">Yellow</option>
<option value="#4BC0C0">Green</option>
<option value="#36A2EB">Blue</option>
<option value="#9966FF">Purple</option>
<option value="#F78DA7">Pink</option>
<option value="#885AF2">Indigo</option>
</select>

<label for="shape-select" class="option-label">Shape:</label>
<select id="shape-select">
<option value="🔴">Circle</option>
<option value="🟡">Yellow Circle</option>
<option value="🟢">Green Circle</option>
<option value="🔵">Blue Circle</option>
<option value="🟣">Purple Circle</option>
<option value="🟤">Brown Circle</option>
<option value="⚫️">Black Circle</option>
<option value="⚪️">White Circle</option>
</select>

<button id="reset-button" class="reset-button">Reset</button>
</div>
</div>
</body>
</html>