Spaces:
Running
Running
Add 2 files
Browse files- README.md +6 -4
- index.html +462 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: yellow
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: testing-story-time
|
| 3 |
+
emoji: 🐳
|
| 4 |
colorFrom: yellow
|
| 5 |
+
colorTo: red
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,462 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Dreamy Tales - Interactive Bedtime Stories</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&family=Fredoka+One&display=swap');
|
| 11 |
+
|
| 12 |
+
body {
|
| 13 |
+
font-family: 'Comic Neue', cursive;
|
| 14 |
+
background-color: #f0f9ff;
|
| 15 |
+
color: #1e3a8a;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
.title-font {
|
| 19 |
+
font-family: 'Fredoka One', cursive;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
.story-container {
|
| 23 |
+
background-image: url('https://img.freepik.com/free-vector/hand-painted-watercolor-pastel-sky-background_23-2148902771.jpg');
|
| 24 |
+
background-size: cover;
|
| 25 |
+
background-position: center;
|
| 26 |
+
min-height: 400px;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.character {
|
| 30 |
+
transition: all 0.3s ease;
|
| 31 |
+
cursor: pointer;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.character:hover {
|
| 35 |
+
transform: scale(1.1) rotate(5deg);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.page-turn {
|
| 39 |
+
animation: pageTurn 0.5s ease;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
@keyframes pageTurn {
|
| 43 |
+
0% { transform: rotateY(0deg); }
|
| 44 |
+
50% { transform: rotateY(90deg); }
|
| 45 |
+
100% { transform: rotateY(0deg); }
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.twinkle {
|
| 49 |
+
animation: twinkle 2s infinite alternate;
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
@keyframes twinkle {
|
| 53 |
+
0% { opacity: 0.5; }
|
| 54 |
+
100% { opacity: 1; }
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
.floating {
|
| 58 |
+
animation: floating 3s ease-in-out infinite;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
@keyframes floating {
|
| 62 |
+
0% { transform: translateY(0px); }
|
| 63 |
+
50% { transform: translateY(-15px); }
|
| 64 |
+
100% { transform: translateY(0px); }
|
| 65 |
+
}
|
| 66 |
+
</style>
|
| 67 |
+
</head>
|
| 68 |
+
<body class="min-h-screen">
|
| 69 |
+
<!-- Header -->
|
| 70 |
+
<header class="bg-gradient-to-r from-blue-500 to-purple-600 py-6 shadow-lg">
|
| 71 |
+
<div class="container mx-auto px-4">
|
| 72 |
+
<h1 class="title-font text-4xl md:text-5xl text-white text-center drop-shadow-lg">
|
| 73 |
+
<i class="fas fa-moon twinkle mr-2"></i> Dreamy Tales
|
| 74 |
+
</h1>
|
| 75 |
+
<p class="text-white text-center mt-2 text-lg">Where stories come to life at bedtime!</p>
|
| 76 |
+
</div>
|
| 77 |
+
</header>
|
| 78 |
+
|
| 79 |
+
<!-- Main Content -->
|
| 80 |
+
<main class="container mx-auto px-4 py-8">
|
| 81 |
+
<!-- Story Selection -->
|
| 82 |
+
<section class="mb-12">
|
| 83 |
+
<h2 class="title-font text-3xl text-center mb-8 text-blue-800">Choose Your Adventure</h2>
|
| 84 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
| 85 |
+
<!-- Story Card 1 -->
|
| 86 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-all duration-300">
|
| 87 |
+
<div class="h-48 bg-gradient-to-br from-yellow-200 to-pink-300 flex items-center justify-center">
|
| 88 |
+
<i class="fas fa-dragon text-6xl text-purple-700 floating"></i>
|
| 89 |
+
</div>
|
| 90 |
+
<div class="p-6">
|
| 91 |
+
<h3 class="title-font text-xl mb-2">The Little Dragon's First Flight</h3>
|
| 92 |
+
<p class="text-gray-700 mb-4">Help Spark the dragon overcome his fear of heights and learn to fly!</p>
|
| 93 |
+
<button onclick="startStory(1)" class="bg-blue-500 hover:bg-blue-600 text-white py-2 px-4 rounded-full w-full transition">
|
| 94 |
+
Read Story <i class="fas fa-book-open ml-2"></i>
|
| 95 |
+
</button>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
+
|
| 99 |
+
<!-- Story Card 2 -->
|
| 100 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-all duration-300">
|
| 101 |
+
<div class="h-48 bg-gradient-to-br from-green-200 to-blue-300 flex items-center justify-center">
|
| 102 |
+
<i class="fas fa-unicorn text-6xl text-pink-600 floating" style="animation-delay: 0.5s;"></i>
|
| 103 |
+
</div>
|
| 104 |
+
<div class="p-6">
|
| 105 |
+
<h3 class="title-font text-xl mb-2">The Lost Unicorn's Secret</h3>
|
| 106 |
+
<p class="text-gray-700 mb-4">Join Luna the unicorn on a magical journey through the Enchanted Forest.</p>
|
| 107 |
+
<button onclick="startStory(2)" class="bg-purple-500 hover:bg-purple-600 text-white py-2 px-4 rounded-full w-full transition">
|
| 108 |
+
Read Story <i class="fas fa-book-open ml-2"></i>
|
| 109 |
+
</button>
|
| 110 |
+
</div>
|
| 111 |
+
</div>
|
| 112 |
+
|
| 113 |
+
<!-- Story Card 3 -->
|
| 114 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden hover:shadow-xl transition-all duration-300">
|
| 115 |
+
<div class="h-48 bg-gradient-to-br from-red-200 to-orange-300 flex items-center justify-center">
|
| 116 |
+
<i class="fas fa-robot text-6xl text-blue-700 floating" style="animation-delay: 1s;"></i>
|
| 117 |
+
</div>
|
| 118 |
+
<div class="p-6">
|
| 119 |
+
<h3 class="title-font text-xl mb-2">Bleep the Robot's Big Day</h3>
|
| 120 |
+
<p class="text-gray-700 mb-4">Discover what happens when a curious robot learns about emotions.</p>
|
| 121 |
+
<button onclick="startStory(3)" class="bg-orange-500 hover:bg-orange-600 text-white py-2 px-4 rounded-full w-full transition">
|
| 122 |
+
Read Story <i class="fas fa-book-open ml-2"></i>
|
| 123 |
+
</button>
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
+
</div>
|
| 127 |
+
</section>
|
| 128 |
+
|
| 129 |
+
<!-- Story Reader (Hidden by default) -->
|
| 130 |
+
<section id="storyReader" class="hidden">
|
| 131 |
+
<div class="flex justify-between items-center mb-6">
|
| 132 |
+
<button onclick="goBackToSelection()" class="bg-gray-300 hover:bg-gray-400 text-gray-800 py-2 px-4 rounded-full transition">
|
| 133 |
+
<i class="fas fa-arrow-left mr-2"></i> Back to Stories
|
| 134 |
+
</button>
|
| 135 |
+
<div class="flex space-x-2">
|
| 136 |
+
<button id="prevBtn" onclick="prevPage()" class="bg-blue-300 hover:bg-blue-400 text-blue-800 py-2 px-4 rounded-full transition">
|
| 137 |
+
<i class="fas fa-arrow-left"></i>
|
| 138 |
+
</button>
|
| 139 |
+
<button id="nextBtn" onclick="nextPage()" class="bg-blue-500 hover:bg-blue-600 text-white py-2 px-4 rounded-full transition">
|
| 140 |
+
<i class="fas fa-arrow-right"></i>
|
| 141 |
+
</button>
|
| 142 |
+
</div>
|
| 143 |
+
</div>
|
| 144 |
+
|
| 145 |
+
<div id="storyContainer" class="story-container bg-white rounded-xl shadow-xl overflow-hidden p-8 md:p-12 relative">
|
| 146 |
+
<div id="storyContent" class="page-turn bg-white bg-opacity-80 rounded-lg p-6 md:p-8 max-w-3xl mx-auto">
|
| 147 |
+
<!-- Story content will be inserted here by JavaScript -->
|
| 148 |
+
</div>
|
| 149 |
+
|
| 150 |
+
<!-- Interactive Elements -->
|
| 151 |
+
<div id="interactiveElements" class="mt-8 flex flex-wrap justify-center gap-4">
|
| 152 |
+
<!-- Interactive buttons will be inserted here by JavaScript -->
|
| 153 |
+
</div>
|
| 154 |
+
|
| 155 |
+
<!-- Stars rating -->
|
| 156 |
+
<div id="ratingSection" class="hidden mt-8 text-center">
|
| 157 |
+
<p class="text-lg mb-2">Did you like this story?</p>
|
| 158 |
+
<div class="flex justify-center space-x-2">
|
| 159 |
+
<i class="fas fa-star text-gray-300 text-2xl cursor-pointer hover:text-yellow-400" onclick="rateStory(1)"></i>
|
| 160 |
+
<i class="fas fa-star text-gray-300 text-2xl cursor-pointer hover:text-yellow-400" onclick="rateStory(2)"></i>
|
| 161 |
+
<i class="fas fa-star text-gray-300 text-2xl cursor-pointer hover:text-yellow-400" onclick="rateStory(3)"></i>
|
| 162 |
+
<i class="fas fa-star text-gray-300 text-2xl cursor-pointer hover:text-yellow-400" onclick="rateStory(4)"></i>
|
| 163 |
+
<i class="fas fa-star text-gray-300 text-2xl cursor-pointer hover:text-yellow-400" onclick="rateStory(5)"></i>
|
| 164 |
+
</div>
|
| 165 |
+
</div>
|
| 166 |
+
</div>
|
| 167 |
+
</section>
|
| 168 |
+
</main>
|
| 169 |
+
|
| 170 |
+
<!-- Footer -->
|
| 171 |
+
<footer class="bg-gradient-to-r from-blue-600 to-purple-700 py-6 text-white mt-12">
|
| 172 |
+
<div class="container mx-auto px-4 text-center">
|
| 173 |
+
<p class="mb-2">Made with <i class="fas fa-heart text-red-300"></i> for sweet dreams</p>
|
| 174 |
+
<p class="text-sm">© 2023 Dreamy Tales - All rights reserved</p>
|
| 175 |
+
</div>
|
| 176 |
+
</footer>
|
| 177 |
+
|
| 178 |
+
<script>
|
| 179 |
+
// Story data
|
| 180 |
+
const stories = {
|
| 181 |
+
1: {
|
| 182 |
+
title: "The Little Dragon's First Flight",
|
| 183 |
+
pages: [
|
| 184 |
+
{
|
| 185 |
+
content: `<h2 class="title-font text-2xl mb-4 text-center">Chapter 1: Meet Spark</h2>
|
| 186 |
+
<p class="mb-4">Once upon a time, in a land of floating mountains, there lived a little dragon named Spark. He had bright red scales that shimmered in the sunlight and tiny wings that fluttered when he got excited.</p>
|
| 187 |
+
<p class="mb-4">But Spark had a secret... he was afraid of heights! All the other young dragons could fly, but Spark stayed on the ground, watching from below.</p>`,
|
| 188 |
+
image: '<i class="fas fa-dragon text-8xl text-red-500 mx-auto block my-6 character" onclick="dragonRoar()"></i>',
|
| 189 |
+
interactive: [
|
| 190 |
+
{text: "Roar like a dragon!", action: "dragonRoar()", icon: "fa-volume-up"},
|
| 191 |
+
{text: "Flap your wings!", action: "flapWings()", icon: "fa-feather"}
|
| 192 |
+
]
|
| 193 |
+
},
|
| 194 |
+
{
|
| 195 |
+
content: `<h2 class="title-font text-2xl mb-4 text-center">Chapter 2: The Wise Old Turtle</h2>
|
| 196 |
+
<p class="mb-4">One day, Spark met a wise old turtle named Sheldon. Sheldon could see that Spark was sad about not being able to fly.</p>
|
| 197 |
+
<p class="mb-4">"Little dragon," said Sheldon in his slow, wise voice, "everyone is afraid of something at first. The trick is to start small."</p>
|
| 198 |
+
<p class="mb-4">Sheldon suggested that Spark try jumping from a small rock first, then gradually try higher places.</p>`,
|
| 199 |
+
image: '<i class="fas fa-turtle text-8xl text-green-600 mx-auto block my-6 character" onclick="turtleWisdom()"></i>',
|
| 200 |
+
interactive: [
|
| 201 |
+
{text: "What advice would you give Spark?", action: "showAdvicePrompt()", icon: "fa-comment"},
|
| 202 |
+
{text: "Move slowly like a turtle", action: "moveLikeTurtle()", icon: "fa-clock"}
|
| 203 |
+
]
|
| 204 |
+
},
|
| 205 |
+
{
|
| 206 |
+
content: `<h2 class="title- font text-2xl mb-4 text-center">Chapter 3: The First Flight</h2>
|
| 207 |
+
<p class="mb-4">Following Sheldon's advice, Spark started with small jumps from a low rock. Each day, he tried a slightly higher rock.</p>
|
| 208 |
+
<p class="mb-4">One evening, as the sun painted the sky orange and pink, Spark climbed to the top of a medium-sized hill. He took a deep breath...</p>
|
| 209 |
+
<p class="mb-4">And jumped! His wings caught the wind and for the first time, Spark flew! He soared over the treetops, his heart full of joy.</p>`,
|
| 210 |
+
image: '<i class="fas fa-dragon text-8xl text-red-500 mx-auto block my-6 floating"></i>',
|
| 211 |
+
interactive: [
|
| 212 |
+
{text: "Cheer for Spark!", action: "cheerForSpark()", icon: "fa-hands-clapping"},
|
| 213 |
+
{text: "Pretend to fly!", action: "pretendToFly()", icon: "fa-paper-plane"}
|
| 214 |
+
]
|
| 215 |
+
},
|
| 216 |
+
{
|
| 217 |
+
content: `<h2 class="title-font text-2xl mb-4 text-center">The End</h2>
|
| 218 |
+
<p class="mb-4">From that day on, Spark flew everywhere! He still remembered to be careful, but he wasn't afraid anymore.</p>
|
| 219 |
+
<p class="mb-4">And sometimes, he would even give rides to his turtle friend Sheldon, who enjoyed seeing the world from above.</p>
|
| 220 |
+
<p class="mb-4">The end.</p>`,
|
| 221 |
+
image: '<div class="flex justify-center space-x-8 my-6"><i class="fas fa-dragon text-8xl text-red-500 floating"></i><i class="fas fa-turtle text-8xl text-green-600" style="animation-delay: 0.5s;"></i></div>',
|
| 222 |
+
interactive: []
|
| 223 |
+
}
|
| 224 |
+
]
|
| 225 |
+
},
|
| 226 |
+
2: {
|
| 227 |
+
title: "The Lost Unicorn's Secret",
|
| 228 |
+
pages: [
|
| 229 |
+
{
|
| 230 |
+
content: `<h2 class="title-font text-2xl mb-4 text-center">Chapter 1: The Mysterious Unicorn</h2>
|
| 231 |
+
<p class="mb-4">In the heart of the Enchanted Forest, where flowers sang and trees whispered secrets, a young unicorn named Luna appeared one morning.</p>
|
| 232 |
+
<p class="mb-4">She had a silvery-white coat that glowed in the moonlight and a golden horn that sparkled like stardust. But Luna had no memory of where she came from.</p>`,
|
| 233 |
+
image: '<i class="fas fa-unicorn text-8xl text-purple-400 mx-auto block my-6 twinkle" onclick="unicornGlow()"></i>',
|
| 234 |
+
interactive: [
|
| 235 |
+
{text: "Make Luna's horn glow!", action: "unicornGlow()", icon: "fa-magic"},
|
| 236 |
+
{text: "Whisper like the trees", action: "whisperSecret()", icon: "fa-tree"}
|
| 237 |
+
]
|
| 238 |
+
},
|
| 239 |
+
// Additional pages would follow the same pattern
|
| 240 |
+
]
|
| 241 |
+
},
|
| 242 |
+
3: {
|
| 243 |
+
title: "Bleep the Robot's Big Day",
|
| 244 |
+
pages: [
|
| 245 |
+
{
|
| 246 |
+
content: `<h2 class="title-font text-2xl mb-4 text-center">Chapter 1: Bleep Wakes Up</h2>
|
| 247 |
+
<p class="mb-4">In a shiny metal city of the future, a small robot named Bleep powered up for another day. Bleep was different from other robots - he was curious about everything!</p>
|
| 248 |
+
<p class="mb-4">While other robots followed their programming exactly, Bleep always asked "Why?" and wanted to learn new things.</p>`,
|
| 249 |
+
image: '<i class="fas fa-robot text-8xl text-blue-500 mx-auto block my-6 character" onclick="robotSound()"></i>',
|
| 250 |
+
interactive: [
|
| 251 |
+
{text: "Make robot sounds!", action: "robotSound()", icon: "fa-robot"},
|
| 252 |
+
{text: "Ask 'Why?' like Bleep", action: "askWhy()", icon: "fa-question"}
|
| 253 |
+
]
|
| 254 |
+
},
|
| 255 |
+
// Additional pages would follow the same pattern
|
| 256 |
+
]
|
| 257 |
+
}
|
| 258 |
+
};
|
| 259 |
+
|
| 260 |
+
// Current story state
|
| 261 |
+
let currentStoryId = null;
|
| 262 |
+
let currentPage = 0;
|
| 263 |
+
let totalPages = 0;
|
| 264 |
+
|
| 265 |
+
// Start a new story
|
| 266 |
+
function startStory(storyId) {
|
| 267 |
+
currentStoryId = storyId;
|
| 268 |
+
currentPage = 0;
|
| 269 |
+
totalPages = stories[storyId].pages.length;
|
| 270 |
+
|
| 271 |
+
document.getElementById('storyReader').classList.remove('hidden');
|
| 272 |
+
document.querySelector('main > section:first-child').classList.add('hidden');
|
| 273 |
+
|
| 274 |
+
loadPage();
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
// Go back to story selection
|
| 278 |
+
function goBackToSelection() {
|
| 279 |
+
document.getElementById('storyReader').classList.add('hidden');
|
| 280 |
+
document.querySelector('main > section:first-child').classList.remove('hidden');
|
| 281 |
+
|
| 282 |
+
// Reset any animations or effects
|
| 283 |
+
document.getElementById('ratingSection').classList.add('hidden');
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
// Load the current page
|
| 287 |
+
function loadPage() {
|
| 288 |
+
const storyContent = document.getElementById('storyContent');
|
| 289 |
+
const interactiveElements = document.getElementById('interactiveElements');
|
| 290 |
+
const prevBtn = document.getElementById('prevBtn');
|
| 291 |
+
const nextBtn = document.getElementById('nextBtn');
|
| 292 |
+
const ratingSection = document.getElementById('ratingSection');
|
| 293 |
+
|
| 294 |
+
// Apply page turn animation
|
| 295 |
+
storyContent.classList.add('page-turn');
|
| 296 |
+
setTimeout(() => storyContent.classList.remove('page-turn'), 500);
|
| 297 |
+
|
| 298 |
+
// Update navigation buttons
|
| 299 |
+
prevBtn.disabled = currentPage === 0;
|
| 300 |
+
nextBtn.disabled = currentPage === totalPages - 1;
|
| 301 |
+
|
| 302 |
+
// Show rating only on last page
|
| 303 |
+
if (currentPage === totalPages - 1) {
|
| 304 |
+
ratingSection.classList.remove('hidden');
|
| 305 |
+
} else {
|
| 306 |
+
ratingSection.classList.add('hidden');
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
// Load page content
|
| 310 |
+
const page = stories[currentStoryId].pages[currentPage];
|
| 311 |
+
storyContent.innerHTML = `
|
| 312 |
+
${page.content}
|
| 313 |
+
${page.image || ''}
|
| 314 |
+
`;
|
| 315 |
+
|
| 316 |
+
// Load interactive elements
|
| 317 |
+
interactiveElements.innerHTML = '';
|
| 318 |
+
page.interactive.forEach(item => {
|
| 319 |
+
const button = document.createElement('button');
|
| 320 |
+
button.className = 'bg-yellow-400 hover:bg-yellow-500 text-blue-800 py-3 px-6 rounded-full transition flex items-center';
|
| 321 |
+
button.innerHTML = `
|
| 322 |
+
<i class="fas ${item.icon} mr-2"></i> ${item.text}
|
| 323 |
+
`;
|
| 324 |
+
button.onclick = new Function(item.action);
|
| 325 |
+
interactiveElements.appendChild(button);
|
| 326 |
+
});
|
| 327 |
+
|
| 328 |
+
// Update document title
|
| 329 |
+
document.title = `${stories[currentStoryId].title} - Page ${currentPage + 1}`;
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
// Navigation functions
|
| 333 |
+
function nextPage() {
|
| 334 |
+
if (currentPage < totalPages - 1) {
|
| 335 |
+
currentPage++;
|
| 336 |
+
loadPage();
|
| 337 |
+
}
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
function prevPage() {
|
| 341 |
+
if (currentPage > 0) {
|
| 342 |
+
currentPage--;
|
| 343 |
+
loadPage();
|
| 344 |
+
}
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
// Interactive functions
|
| 348 |
+
function dragonRoar() {
|
| 349 |
+
alert('ROOOOOAR! 🐉');
|
| 350 |
+
const dragon = document.querySelector('.fa-dragon');
|
| 351 |
+
dragon.classList.add('animate-pulse', 'text-orange-500');
|
| 352 |
+
setTimeout(() => {
|
| 353 |
+
dragon.classList.remove('animate-pulse', 'text-orange-500');
|
| 354 |
+
}, 1000);
|
| 355 |
+
|
| 356 |
+
// Play roar sound if available
|
| 357 |
+
if (typeof Audio !== 'undefined') {
|
| 358 |
+
const roar = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-monster-dragon-roar-5.mp3');
|
| 359 |
+
roar.play().catch(e => console.log('Audio playback failed:', e));
|
| 360 |
+
}
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
function flapWings() {
|
| 364 |
+
const dragon = document.querySelector('.fa-dragon');
|
| 365 |
+
dragon.style.transform = 'rotate(10deg) scale(1.2)';
|
| 366 |
+
setTimeout(() => {
|
| 367 |
+
dragon.style.transform = '';
|
| 368 |
+
}, 300);
|
| 369 |
+
|
| 370 |
+
alert('Flap! Flap! Your wings are working!');
|
| 371 |
+
}
|
| 372 |
+
|
| 373 |
+
function turtleWisdom() {
|
| 374 |
+
const wisdom = [
|
| 375 |
+
"Slow and steady wins the race!",
|
| 376 |
+
"Big things start with small steps.",
|
| 377 |
+
"Don't compare your beginning to someone else's middle.",
|
| 378 |
+
"Every expert was once a beginner."
|
| 379 |
+
];
|
| 380 |
+
alert(wisdom[Math.floor(Math.random() * wisdom.length)]);
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
function moveLikeTurtle() {
|
| 384 |
+
alert('Moving... very... slowly... 🐢');
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
function cheerForSpark() {
|
| 388 |
+
alert('Yay! Go Spark! 🎉');
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
function pretendToFly() {
|
| 392 |
+
alert('Whoosh! You're flying high in the sky! ✈️');
|
| 393 |
+
}
|
| 394 |
+
|
| 395 |
+
function unicornGlow() {
|
| 396 |
+
const unicorn = document.querySelector('.fa-unicorn');
|
| 397 |
+
unicorn.classList.add('text-yellow-300', 'twinkle');
|
| 398 |
+
setTimeout(() => {
|
| 399 |
+
unicorn.classList.remove('text-yellow-300');
|
| 400 |
+
}, 2000);
|
| 401 |
+
|
| 402 |
+
alert('✨ Your horn is glowing with magic! ✨');
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
function whisperSecret() {
|
| 406 |
+
const secret = prompt("What secret would you whisper to the trees?");
|
| 407 |
+
if (secret) {
|
| 408 |
+
alert(`The trees whisper back: "${secret.toUpperCase()}!"`);
|
| 409 |
+
}
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
function robotSound() {
|
| 413 |
+
const sounds = ['Bleep!', 'Blop!', 'Zzzzt!', 'Whirrr!'];
|
| 414 |
+
alert(sounds[Math.floor(Math.random() * sounds.length)]);
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
function askWhy() {
|
| 418 |
+
const questions = [
|
| 419 |
+
"Why is the sky blue?",
|
| 420 |
+
"Why do birds sing?",
|
| 421 |
+
"Why do we need to sleep?",
|
| 422 |
+
"Why are rainbows curved?"
|
| 423 |
+
];
|
| 424 |
+
alert(questions[Math.floor(Math.random() * questions.length)]);
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
function showAdvicePrompt() {
|
| 428 |
+
const advice = prompt("What advice would you give to Spark about being brave?");
|
| 429 |
+
if (advice) {
|
| 430 |
+
alert(`Great advice! Spark says: "Thank you! I'll try that!"`);
|
| 431 |
+
}
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
// Rate the story
|
| 435 |
+
function rateStory(rating) {
|
| 436 |
+
const stars = document.querySelectorAll('#ratingSection .fa-star');
|
| 437 |
+
stars.forEach((star, index) => {
|
| 438 |
+
if (index < rating) {
|
| 439 |
+
star.classList.add('text-yellow-400');
|
| 440 |
+
star.classList.remove('text-gray-300');
|
| 441 |
+
} else {
|
| 442 |
+
star.classList.add('text-gray-300');
|
| 443 |
+
star.classList.remove('text-yellow-400');
|
| 444 |
+
}
|
| 445 |
+
});
|
| 446 |
+
|
| 447 |
+
alert(`Thank you for your ${rating} star rating! We're glad you enjoyed the story!`);
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
// Keyboard navigation
|
| 451 |
+
document.addEventListener('keydown', (e) => {
|
| 452 |
+
if (currentStoryId !== null) {
|
| 453 |
+
if (e.key === 'ArrowRight') {
|
| 454 |
+
nextPage();
|
| 455 |
+
} else if (e.key === 'ArrowLeft') {
|
| 456 |
+
prevPage();
|
| 457 |
+
}
|
| 458 |
+
}
|
| 459 |
+
});
|
| 460 |
+
</script>
|
| 461 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=dnice1975/testing-story-time" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 462 |
+
</html>
|