Kids Learning
Kids Learning
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fun Learning for Kids! 🌟</title>
<style>
body {
font-family: 'Comic Sans MS', cursive;
background: linear-gradient(45deg, #FFB6C1, #87CEEB);
padding: 20px;
}
.container {
max-width: 800px;
margin: 0 auto;
text-align: center;
}
h1 {
color: #FF69B4;
font-size: 3em;
text-shadow: 2px 2px #FFFFFF;
margin-bottom: 30px;
}
.subject-btn {
background-color: #FFD700;
padding: 20px 40px;
margin: 10px;
border: none;
border-radius: 15px;
font-size: 1.5em;
color: #FFFFFF;
cursor: pointer;
transition: transform 0.3s;
}
.subject-btn:hover {
transform: scale(1.1);
}
.quiz-section {
background-color: rgba(255, 255, 255, 0.9);
padding: 20px;
border-radius: 20px;
margin-top: 20px;
display: none;
}
.question {
font-size: 2em;
color: #4B0082;
margin-bottom: 20px;
}
.option-btn {
background-color: #98FB98;
padding: 15px 30px;
margin: 10px;
border: none;
border-radius: 10px;
font-size: 1.2em;
cursor: pointer;
min-width: 200px;
}
.feedback {
font-size: 1.5em;
margin-top: 20px;
padding: 10px;
border-radius: 10px;
}
.correct {
background-color: #90EE90;
}
.incorrect {
background-color: #FFA07A;
}
.mascot {
width: 100px;
position: fixed;
bottom: 20px;
right: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1>🎓 Fun Learning Time! 🎉</h1>
<script>
function showQuiz(subject) {
document.querySelectorAll('.quiz-section').forEach(quiz => {
quiz.style.display = 'none';
});
document.getElementById(`${subject}-quiz`).style.display = 'block';
}
function hideQuiz(subject) {
document.getElementById(`${subject}-quiz`).style.display = 'none';
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fun Learning for Kids! 🌟</title>
<style>
body {
font-family: 'Comic Sans MS', cursive;
background: linear-gradient(45deg, #FFEB3B, #64B5F6);
text-align: center;
padding: 20px;
color: #333;
}
h1 {
color: #D84315;
font-size: 3em;
text-shadow: 2px 2px #FFFFFF;
}
.category {
margin: 10px;
padding: 15px 30px;
font-size: 24px;
background-color: #42A5F5;
color: white;
border: none;
border-radius: 15px;
cursor: pointer;
transition: transform 0.3s;
}
.category:hover {
transform: scale(1.1);
}
.quiz-container {
display: none;
margin: 20px auto;
width: 80%;
max-width: 600px;
padding: 20px;
background-color: white;
border-radius: 15px;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}
.question {
font-size: 22px;
margin-bottom: 15px;
}
.option {
display: block;
font-size: 20px;
padding: 10px;
margin: 5px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
#result {
font-size: 24px;
margin-top: 20px;
}
.back-btn {
background-color: #F57C00;
color: white;
padding: 10px 20px;
margin-top: 15px;
border: none;
border-radius: 10px;
cursor: pointer;
}
</style>
</head>
<body>
<h1>🎓 Fun Learning Time! 🎉</h1>
<button class="category" onclick="startQuiz('colors')">🌈 Colors</button>
<button class="category" onclick="startQuiz('shapes')">🔷 Shapes</button>
<button class="category" onclick="startQuiz('numbers')">🔢 Numbers</button>
<button class="category" onclick="startQuiz('alphabets')"> Alphabets</button>
<script>
let currentCategory;
let currentIndex;
const questions = {
colors: [
{ q: "What color is the sun? ☀️", options: ["Yellow", "Green", "Blue", "Red"], answer:
"Yellow" },
{ q: "What color is grass? 🌿", options: ["Purple", "Orange", "Green", "Brown"], answer:
"Green" },
{ q: "What color is the ocean? 🌊", options: ["Blue", "Pink", "Black", "Gray"], answer:
"Blue" },
{ q: "What color is an apple? 🍎", options: ["Red", "Blue", "Yellow", "Green"], answer:
"Red" }
],
shapes: [
{ q: "Which shape has 4 sides? ⬛", options:
["Triangle", "Circle", "Rectangle", "Pentagon"], answer:
"Rectangle" },
{ q: "Which shape is round? ⚫", options: ["Square", "Triangle", "Circle", "Hexagon"],
answer: "Circle" }
],
numbers: [
{ q: "What comes after 5? 🔢", options: ["3", "7", "6", "9"], answer: "6" },
{ q: "How many fingers do you have? ✋", options: ["8", "10", "5", "12"],
answer: "10" }
],
alphabets: [
{ q: "What is the first letter of the alphabet? ", options: ["A", "B", "C", "D"], answer:
"A" },
{ q: "What letter comes after E?", options: ["D", "F", "G", "H"], answer: "F" }
]
};
function startQuiz(category) {
currentCategory = category;
currentIndex = 0;
document.getElementById("quiz-box").style.display = "block";
document.getElementById("quiz-title").innerText = category.toUpperCase();
document.getElementById("result").innerText = "";
loadQuestion();
}
function loadQuestion() {
if (currentIndex >= questions[currentCategory].length) {
document.getElementById("quiz-box").innerHTML = "<h2>🎉 Quiz Completed! Well
Done! 🎊</h2>";
return;
}
const qObj = questions[currentCategory][currentIndex];
document.getElementById("question-text").innerText = qObj.q;
let optionsHtml = "";
qObj.options.forEach(option => {
optionsHtml += `<button class='option' onclick='checkAnswer("${option}")'>$
{option}</button>`;
});
document.getElementById("options").innerHTML = optionsHtml;
document.getElementById("next-btn").style.display = "none";
}
function checkAnswer(selected) {
const correct = questions[currentCategory][currentIndex].answer;
if (selected === correct) {
document.getElementById("result").innerText = "🎉 Correct! Well done!";
document.getElementById("result").style.color = "#2e7d32";
} else {
document.getElementById("result").innerText = "❌ Oops! Try again!";
document.getElementById("result").style.color = "#d32f2f";
}
document.getElementById("next-btn").style.display = "block";
}
function nextQuestion() {
currentIndex++;
document.getElementById("result").innerText = "";
loadQuestion();
}
function hideQuiz() {
document.getElementById("quiz-box").style.display = "none";
}
</script>
</body>
</html>