Here's a concept for an interactive ice cream making simulation game website. This would be built with HTML, CSS, and JavaScript to create a fun, customizable experience.
html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dreamy Scoops - Ice Cream Maker</title>
<style>
body {
font-family: 'Comic Sans MS', cursive, sans-serif;
background-color: #ffebee;
margin: 0;
padding: 0;
color: #5d4037;
}
.container {
max-width: 1000px;
margin: 0 auto;
padding: 20px;
}
header {
text-align: center;
background-color: #ffcdd2;
padding: 20px;
border-radius: 10px;
margin-bottom: 20px;
}
h1 {
color: #880e4f;
font-size: 3em;
text-shadow: 2px 2px #ff8a80;
}
.game-area {
display: flex;
flex-wrap: wrap;
gap: 20px;
}
.customization-panel {
flex: 1;
min-width: 300px;
background-color: #f8bbd0;
padding: 20px;
border-radius: 10px;
}
.ice-cream-display {
flex: 2;
min-width: 400px;
background-color: #e1bee7;
padding: 20px;
border-radius: 10px;
text-align: center;
}
.section {
margin-bottom: 20px;
background-color: white;
padding: 15px;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
h2 {
color: #7b1fa2;
border-bottom: 2px solid #ba68c8;
padding-bottom: 5px;
}
.options {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 10px;
}
.option {
padding: 8px 12px;
background-color: #f3e5f5;
border: 2px solid #ce93d8;
border-radius: 20px;
cursor: pointer;
transition: all 0.3s;
}
.option:hover, .option.selected {
background-color: #ce93d8;
color: white;
}
.ice-cream-container {
width: 300px;
height: 400px;
margin: 0 auto;
position: relative;
}
.cone, .bowl {
width: 100%;
height: 100px;
position: absolute;
bottom: 0;
z-index: 1;
}
.cone {
background-color: #d7ccc8;
clip-path: polygon(30% 0%, 70% 0%, 100% 100%, 0% 100%);
}
.bowl {
background-color: #bcaaa4;
border-radius: 50% 50% 0 0 / 60% 60% 0 0;
}
.scoop {
width: 120px;
height: 120px;
border-radius: 50%;
position: absolute;
z-index: 2;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.topping {
position: absolute;
z-index: 3;
width: 30px;
height: 30px;
}
.controls {
text-align: center;
margin-top: 20px;
}
button {
background-color: #ba68c8;
color: white;
border: none;
padding: 10px 20px;
border-radius: 20px;
font-size: 1em;
cursor: pointer;
transition: all 0.3s;
margin: 0 5px;
}
button:hover {
background-color: #8e24aa;
transform: scale(1.05);
}
.stats {
background-color: #c5cae9;
padding: 15px;
border-radius: 10px;
margin-top: 20px;
}
.flavor-info {
display: flex;
justify-content: space-around;
margin-top: 10px;
}
.flavor-detail {
text-align: center;
}
.flavor-color {
width: 30px;
height: 30px;
border-radius: 50%;
margin: 0 auto 5px;
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>Dreamy Scoops</h1>
<p>Create your perfect ice cream!</p>
</header>
<div class="game-area">
<div class="customization-panel">
<div class="section">
<h2>Base Selection</h2>
<div class="options">
<div class="option selected" data-base="cone">Cone</div>
<div class="option" data-base="bowl">Bowl</div>
<div class="option" data-base="waffle">Waffle Cone</div>
</div>
</div>
<div class="section">
<h2>Flavors</h2>
<div class="options">
<div class="option selected" data-flavor="vanilla" style="background-color: #f3e5ab;">Vanilla</div>
<div class="option" data-flavor="chocolate" style="background-color: #8d6e63;">Chocolate</div>
<div class="option" data-flavor="strawberry" style="background-color: #ff8a80;">Strawberry</div>
<div class="option" data-flavor="mint" style="background-color: #a5d6a7;">Mint</div>
<div class="option" data-flavor="blueberry" style="background-color: #90caf9;">Blueberry</div>
<div class="option" data-flavor="coffee" style="background-color: #a1887f;">Coffee</div>
</div>
</div>
<div class="section">
<h2>Toppings</h2>
<div class="options">
<div class="option" data-topping="sprinkles">Sprinkles</div>
<div class="option" data-topping="chocolate-chips">Chocolate Chips</div>
<div class="option" data-topping="nuts">Nuts</div>
<div class="option" data-topping="cherry">Cherry</div>
<div class="option" data-topping="whipped-cream">Whipped Cream</div>
<div class="option" data-topping="cookie-dough">Cookie Dough</div>
</div>
</div>
<div class="section">
<h2>Shape</h2>
<div class="options">
<div class="option selected" data-shape="round">Round Scoop</div>
<div class="option" data-shape="star">Star Shape</div>
<div class="option" data-shape="heart">Heart Shape</div>
<div class="option" data-shape="swirl">Swirl</div>
</div>
</div>
<div class="section">
<h2>Number of Scoops</h2>
<div class="options">
<div class="option selected" data-scoops="1">1 Scoop</div>
<div class="option" data-scoops="2">2 Scoops</div>
<div class="option" data-scoops="3">3 Scoops</div>
</div>
</div>
</div>
<div class="ice-cream-display">
<h2>Your Ice Cream Creation</h2>
<div class="ice-cream-container" id="iceCreamContainer">
<!-- Ice cream will be rendered here by JavaScript -->
</div>
<div class="stats">
<h3>Ice Cream Stats</h3>
<div class="flavor-info">
<div class="flavor-detail">
<div class="flavor-color" id="flavorColor"></div>
<div>Flavor</div>
<div id="flavorName">Vanilla</div>
</div>
<div class="flavor-detail">
<div>Sweetness</div>
<div id="sweetness">70%</div>
</div>
<div class="flavor-detail">
<div>Creaminess</div>
<div id="creaminess">80%</div>
</div>
<div class="flavor-detail">
<div>Calories</div>
<div id="calories">250</div>
</div>
</div>
</div>
<div class="controls">
<button id="randomizeBtn">Randomize</button>
<button id="saveBtn">Save Creation</button>
<button id="shareBtn">Share</button>
</div>
</div>
</div>
</div>
<script>
// Game state
const gameState = {
base: 'cone',
flavors: ['vanilla'],
toppings: [],
shape: 'round',
scoops: 1,
flavorData: {
vanilla: { color: '#f3e5ab', sweetness: 70, creaminess: 80, calories: 250 },
chocolate: { color: '#8d6e63', sweetness: 60, creaminess: 90, calories: 300 },
strawberry: { color: '#ff8a80', sweetness: 80, creaminess: 70, calories: 220 },
mint: { color: '#a5d6a7', sweetness: 50, creaminess: 75, calories: 200 },
blueberry: { color: '#90caf9', sweetness: 65, creaminess: 70, calories: 230 },
coffee: { color: '#a1887f', sweetness: 40, creaminess: 85, calories: 280 }
},
toppingData: {
sprinkles: { image: '🎉', calories: 20 },
'chocolate-chips': { image: '🍫', calories: 30 },
nuts: { image: '🌰', calories: 40 },
cherry: { image: '🍒', calories: 10 },
'whipped-cream': { image: '🥛', calories: 50 },
'cookie-dough': { image: '🍪', calories: 60 }
}
};
// DOM elements
const iceCreamContainer = document.getElementById('iceCreamContainer');
const flavorColor = document.getElementById('flavorColor');
const flavorName = document.getElementById('flavorName');
const sweetness = document.getElementById('sweetness');
const creaminess = document.getElementById('creaminess');
const calories = document.getElementById('calories');
// Initialize the game
function initGame() {
// Set up event listeners for all options
document.querySelectorAll('.option').forEach(option => {
option.addEventListener('click', function() {
// Remove selected class from all siblings
const parent = this.parentElement;
parent.querySelectorAll('.option').forEach(sibling => {
sibling.classList.remove('selected');
});
// Add selected class to clicked option
this.classList.add('selected');
// Update game state based on data attribute
const section = this.closest('.section').querySelector('h2').textContent.toLowerCase();
const value = this.getAttribute(`data-${section.replace(' ', '-')}`);
if (section === 'base selection') {
gameState.base = value;
} else if (section === 'flavors') {
gameState.flavors = [value];
updateFlavorStats(value);
} else if (section === 'toppings') {
const topping = value;
if (gameState.toppings.includes(topping)) {
gameState.toppings = gameState.toppings.filter(t => t !== topping);
} else {
gameState.toppings.push(topping);
}
} else if (section === 'shape') {
gameState.shape = value;
} else if (section === 'number of scoops') {
gameState.scoops = parseInt(value);
}
renderIceCream();
});
});
// Set up button event listeners
document.getElementById('randomizeBtn').addEventListener('click', randomizeIceCream);
document.getElementById('saveBtn').addEventListener('click', saveCreation);
document.getElementById('shareBtn').addEventListener('click', shareCreation);
// Initial render
renderIceCream();
}
// Update flavor stats display
function updateFlavorStats(flavor) {
const data = gameState.flavorData[flavor];
flavorColor.style.backgroundColor = data.color;
flavorName.textContent = flavor.charAt(0).toUpperCase() + flavor.slice(1);
sweetness.textContent = `${data.sweetness}%`;
creaminess.textContent = `${data.creaminess}%`;
calories.textContent = data.calories;
}
// Render the ice cream based on current state
function renderIceCream() {
// Clear previous ice cream
iceCreamContainer.innerHTML = '';
// Render base
const base = document.createElement('div');
base.className = gameState.base;
if (gameState.base === 'waffle') {
base.style.backgroundColor = '#d7ccc8';
base.style.clipPath = 'polygon(30% 0%, 70% 0%, 100% 100%, 0% 100%)';
// Add waffle texture
base.style.backgroundImage = 'linear-gradient(45deg, rgba(0,0,0,0.1) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.1) 75%), linear-gradient(45deg, rgba(0,0,0,0.1) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.1) 75%)';
base.style.backgroundSize = '20px 20px';
}
iceCreamContainer.appendChild(base);
// Render scoops
const scoopHeight = 120;
const scoopSpacing = 20;
for (let i = 0; i < gameState.scoops; i++) {
const scoop = document.createElement('div');
scoop.className = `scoop ${gameState.shape}`;
// Position scoops
const bottomPosition = 100 + (i * scoopSpacing);
scoop.style.bottom = `${bottomPosition}px`;
// Apply flavor color (use first flavor for all scoops in this simple version)
const flavor = gameState.flavors[0];
scoop.style.backgroundColor = gameState.flavorData[flavor].color;
// Apply shape-specific styles
if (gameState.shape === 'star') {
scoop.style.clipPath = 'polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)';
} else if (gameState.shape === 'heart') {
scoop.style.clipPath = 'path("M100,30 C100,30 70,-10 50,10 C30,-10 0,30 0,30 C0,50 20,80 50,100 C80,80 100,50 100,30 Z")';
} else if (gameState.shape === 'swirl') {
scoop.style.borderRadius = '60% 40% 30% 70%/60% 30% 70% 40%';
}
iceCreamContainer.appendChild(scoop);
}
// Render toppings
gameState.toppings.forEach(topping => {
const toppingData = gameState.toppingData[topping];
const toppingElement = document.createElement('div');
toppingElement.className = 'topping';
toppingElement.textContent = toppingData.image;
// Position toppings randomly on top of scoops
const topPosition = 100 + (gameState.scoops * scoopSpacing) + 10;
const leftPosition = Math.random() * 200 + 50;
toppingElement.style.top = `${topPosition}px`;
toppingElement.style.left = `${leftPosition}px`;
iceCreamContainer.appendChild(toppingElement);
});
}
// Randomize the ice cream
function randomizeIceCream() {
const bases = ['cone', 'bowl', 'waffle'];
const flavors = Object.keys(gameState.flavorData);
const toppings = Object.keys(gameState.toppingData);
const shapes = ['round', 'star', 'heart', 'swirl'];
const scoopCounts = [1, 2, 3];
gameState.base = bases[Math.floor(Math.random() * bases.length)];
gameState.flavors = [flavors[Math.floor(Math.random() * flavors.length)]];
gameState.toppings = [];
// Random number of toppings (0-3)
const toppingCount = Math.floor(Math.random() * 4);
for (let i = 0; i < toppingCount; i++) {
const randomTopping = toppings[Math.floor(Math.random() * toppings.length)];
if (!gameState.toppings.includes(randomTopping)) {
gameState.toppings.push(randomTopping);
}
}
gameState.shape = shapes[Math.floor(Math.random() * shapes.length)];
gameState.scoops = scoopCounts[Math.floor(Math.random() * scoopCounts.length)];
// Update UI to reflect random selection
document.querySelectorAll('.option').forEach(option => {
option.classList.remove('selected');
});
// Select the random options in the UI
document.querySelector(`.option[data-base="${gameState.base}"]`).classList.add('selected');
document.querySelector(`.option[data-flavor="${gameState.flavors[0]}"]`).classList.add('selected');
gameState.toppings.forEach(topping => {
document.querySelector(`.option[data-topping="${topping}"]`).classList.add('selected');
});
document.querySelector(`.option[data-shape="${gameState.shape}"]`).classList.add('selected');
document.querySelector(`.option[data-scoops="${gameState.scoops}"]`).classList.add('selected');
updateFlavorStats(gameState.flavors[0]);
renderIceCream();
}
// Save creation (placeholder function)
function saveCreation() {
alert('Your ice cream creation has been saved!');
// In a real implementation, this would save to localStorage or a database
}
// Share creation (placeholder function)
function shareCreation() {
alert('Share functionality would go here!');
// In a real implementation, this would generate a shareable link or image
}
// Initialize the game when the page loads
window.onload = initGame;
</script>
</body>
</html>
This simulation provides a fun, interactive way for users to customize their perfect ice cream while learning about different flavor profiles and combinations.