Redesign the page as a dreamlike, digital nebula with only floating bubbles (no platforms or elongated ovals).
Browse filesStrict requirements:
Do not render any flat ovals, shadows, platforms, or pads under bubbles.
Bubbles must look like real soap bubbles: circular/elliptical, soft edges, semi-transparent glass, iridescent highlights (violet–cyan–pink), subtle inner glow and specular light.
Depth & parallax: bubbles at different z-depths moving at different speeds; gentle float animations.
Background: cosmic/dreamy gradient with faint stars/particles and soft nebula fog; no hard shapes.
Typography: elegant futuristic sans, light glow; centered title/subtitle.
No rectangular cards or nested boxes. Everything should feel floating and airy.
Interactive flow (no backend):
Add a primary “Add Bubble” button (top-right).
Clicking it opens a modal (floating glass panel) with a textarea and two buttons: Save and Cancel.
On Save, create a new bubble with the entered text. Persist bubbles to localStorage (array of objects: id, text, x, y, z, color).
Clicking a bubble expands it (scale up + blur background) to read/edit text; provide Delete and Save inside.
Bubbles should have hover micro-interactions (slight scale/tilt), and drag-to-reposition (store x,y in localStorage).
Responsive: desktop and mobile; keep at least 3–5 default bubbles on first load.
Use requestAnimationFrame or lightweight GSAP for float/parallax; keep performance smooth.
Visual cues: Apple-VisionOS vibes, ethereal, minimal, premium. No clutter, no heavy borders, no drop-shadow pads.
Output clean HTML/CSS/JS with comments and readable class names.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>BubbleVerse: Floating Thoughts Gallery</title><script src="https://cdn.tailwindcss.com"></script><script src="https://unpkg.com/feather-icons"></script><script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.fog.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.4/gsap.min.js"></script><style>@keyframes float {0% { transform: translateY(0) rotate(0deg) scale(1) translateZ(0); }50% { transform: translateY(-20px) rotate(3deg) scale(1.05) translateZ(0); }100% { transform: translateY(0) rotate(0deg) scale(1) translateZ(0); }}@keyframes fluid {0% { border-radius: 60% 40% 30% 70%/60% 30% 70% 40%; }50% { border-radius: 30% 60% 70% 40%/50% 60% 30% 60%; }100% { border-radius: 60% 40% 30% 70%/60% 30% 70% 40%; }}.bubble {animation: float 8s ease-in-out infinite, fluid 12s ease-in-out infinite;transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);will-change: transform, filter, opacity;position: absolute;background: radial-gradient(circle at 30% 30%,rgba(255,255,255,0.4) 0%,rgba(200,200,255,0.1) 20%,transparent 70%);box-shadow:inset 0 0 40px rgba(255,255,255,0.1),inset 10px 0 60px rgba(200,100,255,0.2),inset -10px 0 60px rgba(100,200,255,0.2),inset 10px 0 300px rgba(200,100,255,0.1),inset -10px 0 300px rgba(100,200,255,0.1),0 0 50px rgba(255,255,255,0.1),0 0 100px rgba(255,255,255,0.1);border: 1px solid rgba(255,255,255,0.2);backdrop-filter: blur(5px);opacity: 0.9;}.bubble::before {content: '';position: absolute;top: 5%;left: 20%;width: 30%;height: 30%;border-radius: 50%;background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);filter: blur(5px);opacity: 0.6;}.bubble:hover {transform: scale(1.15) translateZ(0);opacity: 1;box-shadow:inset 0 0 80px rgba(255,255,255,0.2),inset 20px 0 100px rgba(200,100,255,0.3),inset -20px 0 100px rgba(100,200,255,0.3),inset 20px 0 300px rgba(200,100,255,0.2),inset -20px 0 300px rgba(100,200,255,0.2),0 0 100px rgba(255,255,255,0.3),0 0 150px rgba(255,255,255,0.2);}.bubble-expanded {animation: none !important;transform: scale(1.5) translateZ(0) !important;z-index: 100;backdrop-filter: blur(20px);border: 1px solid rgba(255,255,255,0.4);box-shadow:inset 0 0 120px rgba(255,255,255,0.3),inset 40px 0 200px rgba(200,100,255,0.4),inset -40px 0 200px rgba(100,200,255,0.4),0 0 200px rgba(255,255,255,0.4);opacity: 1;}.cosmic-bg {background: radial-gradient(ellipse at bottom, #0f0c29 0%, #302b63 50%, #24243e 100%);}.thought-content {opacity: 0;max-height: 0;transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);overflow: hidden;text-shadow: 0 0 10px rgba(255,255,255,0.7);position: relative;z-index: 2;}.bubble-expanded .thought-content {opacity: 1;max-height: 300px;padding: 20px;background: rgba(0,0,0,0.15);backdrop-filter: blur(15px);border-radius: 20px;border: 1px solid rgba(255,255,255,0.1);}.stellar-text {text-shadow: 0 0 20px rgba(100, 200, 255, 0.7);letter-spacing: 2px;font-weight: 300;}</style></head><body class="cosmic-bg h-screen overflow-hidden relative"><div id="vanta-bg" class="absolute inset-0 w-full h-full"></div><!-- Floating Particles --><div id="particles-js" class="absolute inset-0 w-full h-full pointer-events-none"></div><header class="relative z-10 py-8 px-4 text-center"><h1 class="text-6xl font-light text-white stellar-text"><span class="tracking-widest">BUBBLE</span><span class="font-thin">VERSE</span></h1><p class="text-blue-100 mt-4 font-light tracking-widest text-lg">COSMIC THOUGHT CLOUD</p></header><main class="relative z-10 container mx-auto px-4 h-4/5 overflow-hidden"><div class="bubble-container grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4 relative h-full"><!-- Bubble 1 --><div class="bubble bg-gradient-to-br from-pink-500 to-purple-600 w-28 h-28 flex items-center justify-center cursor-pointer p-4 absolute" style="top: 20%; left: 10%; animation-delay: 0.5s;"><div class="thought-content text-sm text-white">"The stars whispered secrets to the night, but the moon was too busy shining to listen."</div></div><!-- Bubble 2 --><div class="bubble bg-gradient-to-br from-cyan-500 to-blue-600 w-24 h-24 flex items-center justify-center cursor-pointer p-4 absolute" style="top: 30%; left: 80%; animation-delay: 2s;"><div class="thought-content text-sm text-white">"Time is just the universe's way of preventing everything from happening at once."</div></div><!-- Bubble 3 --><div class="bubble bg-gradient-to-br from-emerald-400 to-teal-600 w-32 h-32 flex items-center justify-center cursor-pointer p-4 absolute" style="top: 60%; left: 30%; animation-delay: 1s;"><div class="thought-content text-sm text-white">"We are all just fragments of stardust trying to remember where we came from."</div></div><!-- Bubble 4 --><div class="bubble bg-yellow-200 bg-opacity-70 rounded-full w-22 h-22 flex items-center justify-center cursor-pointer p-4 absolute" style="top: 70%; left: 60%; animation-delay: 3s;"><div class="thought-content text-xs text-yellow-800">"The ocean never stops kissing the shoreline, no matter how many times it's sent away."</div></div><!-- Bubble 5 --><div class="bubble bg-purple-200 bg-opacity-70 rounded-full w-26 h-26 flex items-center justify-center cursor-pointer p-4 absolute" style="top: 40%; left: 40%; animation-delay: 2.5s;"><div class="thought-content text-xs text-purple-800">"Silence is the most powerful scream when you know how to listen."</div></div><!-- Bubble 6 --><div class="bubble bg-indigo-200 bg-opacity-70 rounded-full w-18 h-18 flex items-center justify-center cursor-pointer p-4 absolute" style="top: 80%; left: 20%; animation-delay: 0.8s;"><div class="thought-content text-xs text-indigo-800">"The trees are poems the earth writes upon the sky."</div></div><!-- Bubble 7 --><div class="bubble bg-teal-200 bg-opacity-70 rounded-full w-24 h-24 flex items-center justify-center cursor-pointer p-4 absolute" style="top: 10%; left: 70%; animation-delay: 1.5s;"><div class="thought-content text-xs text-teal-800">"Life is the art of drawing without an eraser."</div></div></div></main><footer class="relative z-10 py-6 text-center text-blue-200 text-sm font-light"><p class="tracking-widest mb-6">CLICK TO REVEAL COSMIC THOUGHTS</p><button id="add-bubble" class="px-8 py-3.5 bg-gradient-to-r from-blue-500 to-purple-600 rounded-full text-white hover:shadow-xl hover:shadow-blue-500/30 transition-all duration-300 transform hover:scale-105"><i data-feather="plus-circle" class="inline mr-2"></i> ADD COSMIC THOUGHT</button></footer><!-- Add Thought Modal --><div id="add-thought-modal" class="fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 hidden backdrop-blur-lg"><div class="bg-gradient-to-br from-gray-900 to-gray-800 rounded-3xl p-10 max-w-md w-full border border-gray-700 shadow-2xl relative overflow-hidden"><div class="absolute -inset-1 bg-gradient-to-r from-blue-500 to-purple-600 opacity-20 blur-lg"></div><div class="relative"><h3 class="text-3xl font-light text-white mb-8 tracking-wider">ADD COSMIC THOUGHT</h3><textarea id="new-thought" class="w-full p-5 bg-gray-800/80 text-white rounded-2xl border border-gray-700/50 focus:outline-none focus:ring-2 focus:ring-blue-500/50 placeholder-gray-400 backdrop-blur-sm" rows="5" placeholder="Whisper your thought to the universe..."></textarea><div class="flex justify-end mt-8 space-x-4"><button id="cancel-thought" class="px-6 py-2.5 text-gray-300 hover:text-white rounded-xl hover:bg-gray-700/50 transition-all duration-300">CANCEL</button><button id="save-thought" class="px-6 py-2.5 bg-gradient-to-r from-blue-500 to-purple-600 text-white rounded-xl hover:shadow-xl hover:shadow-blue-500/40 transition-all duration-300 transform hover:scale-105">RELEASE</button></div></div></div></div><script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script><script>// Initialize Vanta.js fog backgroundVANTA.FOG({el: "#vanta-bg",mouseControls: true,touchControls: true,gyroControls: false,minHeight: 200.00,minWidth: 200.00,highlightColor: 0x7d7dff,midtoneColor: 0x5e5cff,lowlightColor: 0x2a2a7a,baseColor: 0x0a0a2a,blurFactor: 0.70,speed: 0.80,zoom: 0.60});// Initialize particles.jsparticlesJS('particles-js', {particles: {number: { value: 80, density: { enable: true, value_area: 800 } },color: { value: "#ffffff" },shape: { type: "circle" },opacity: { value: 0.5, random: true },size: { value: 2, random: true },line_linked: { enable: false },move: {enable: true,speed: 1,direction: "none",random: true,straight: false,out_mode: "out",bounce: false,attract: { enable: false, rotateX: 600, rotateY: 1200 }}},interactivity: {detect_on: "canvas",events: {onhover: { enable: true, mode: "repulse" },resize: true},modes: {repulse: { distance: 100, duration: 0.4 }}},retina_detect: true});// Initialize feather icons and animationsdocument.addEventListener('DOMContentLoaded', function() {// Animate header on loadgsap.from('header h1', {duration: 1.5,y: -50,opacity: 0,ease: "power3.out"});gsap.from('header p', {duration: 1.5,y: 50,opacity: 0,ease: "power3.out",delay: 0.3});feather.replace();// Bubble click handlerconst bubbles = document.querySelectorAll('.bubble');bubbles.forEach(bubble => {bubble.addEventListener('click', function() {// Close any already expanded bubbledocument.querySelectorAll('.bubble-expanded').forEach(expBubble => {if (expBubble !== this) {expBubble.classList.remove('bubble-expanded');}});// Toggle current bubblethis.classList.toggle('bubble-expanded');if (this.classList.contains('bubble-expanded')) {gsap.to(this, {duration: 0.6,scale: 1.5,ease: "back.out(1.7)"});} else {gsap.to(this, {duration: 0.6,scale: 1,ease: "back.in(1.7)"});}});// Gentle floating animationgsap.to(bubble, {duration: 8 + Math.random() * 4,y: -20 + Math.random() * 40,x: -20 + Math.random() * 40,rotation: -5 + Math.random() * 10,ease: "sine.inOut",repeat: -1,yoyo: true});});// Add thought buttonconst addBtn = document.getElementById('add-bubble');const modal = document.getElementById('add-thought-modal');const cancelBtn = document.getElementById('cancel-thought');const saveBtn = document.getElementById('save-thought');addBtn.addEventListener('click', function() {modal.classList.remove('hidden');});cancelBtn.addEventListener('click', function() {modal.classList.add('hidden');document.getElementById('new-thought').value = '';});saveBtn.addEventListener('click', function() {const thought = document.getElementById('new-thought').value.trim();if (thought) {addNewBubble(thought);modal.classList.add('hidden');document.getElementById('new-thought').value = '';}});// Function to add new bubble with entrance animationfunction addNewBubble(text) {const container = document.querySelector('.bubble-container');const colors = ['rgba(180,120,255,0.3)','rgba(120,180,255,0.3)','rgba(255,120,220,0.3)','rgba(120,255,220,0.3)','rgba(220,120,255,0.3)','rgba(120,220,255,0.3)'];const glows = ['rgba(200,100,255,0.3)','rgba(100,200,255,0.3)','rgba(255,100,200,0.3)','rgba(100,255,200,0.3)','rgba(200,100,255,0.3)','rgba(100,200,255,0.3)'];const colorIndex = Math.floor(Math.random() * colors.length);const baseColor = colors[colorIndex];const glowColor = glows[colorIndex];const size = Math.floor(Math.random() * 60) + 40;const top = Math.random() * 80;const left = Math.random() * 80;const delay = Math.random() * 8;const zDepth = Math.floor(Math.random() * 100) - 50;const bubble = document.createElement('div');bubble.className = `bubble w-${size} h-${size} flex items-center justify-center cursor-pointer p-4 absolute`;bubble.style.background = `radial-gradient(circle at 30% 30%,rgba(255,255,255,0.4) 0%,${baseColor} 20%,transparent 70%)`;bubble.style.boxShadow = `inset 0 0 40px rgba(255,255,255,0.1),inset 10px 0 60px ${glowColor},inset -10px 0 60px rgba(100,200,255,0.2),inset 10px 0 300px ${glowColor.replace('0.3', '0.1')},inset -10px 0 300px rgba(100,200,255,0.1),0 0 50px rgba(255,255,255,0.1),0 0 100px rgba(255,255,255,0.1)`;bubble.style.transform = `translateZ(${zDepth}px)`;bubble.style.top = `${top}%`;bubble.style.left = `${left}%`;bubble.style.animationDelay = `${delay}s`;const content = document.createElement('div');content.className = 'thought-content text-sm text-white';content.textContent = text;bubble.appendChild(content);container.appendChild(bubble);// Entrance animationgsap.from(bubble, {duration: 1.5,scale: 0,opacity: 0,ease: "elastic.out(1, 0.5)"});bubble.addEventListener('click', function() {document.querySelectorAll('.bubble-expanded').forEach(expBubble => {if (expBubble !== this) {expBubble.classList.remove('bubble-expanded');}});this.classList.toggle('bubble-expanded');});}// Close modal with animationmodal.addEventListener('click', function(e) {if (e.target === modal) {gsap.to(modal, {duration: 0.3,opacity: 0,onComplete: () => {modal.classList.add('hidden');document.getElementById('new-thought').value = '';gsap.set(modal, { opacity: 1 });}});}});// Animate all existing bubblesdocument.querySelectorAll('.bubble').forEach(bubble => {gsap.to(bubble, {duration: 10 + Math.random() * 10,y: -30 + Math.random() * 60,x: -30 + Math.random() * 60,rotation: -10 + Math.random() * 20,ease: "sine.inOut",repeat: -1,yoyo: true});});});</script></body></html>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Dream Nebula</title><script src="https://cdn.tailwindcss.com"></script><script src="https://unpkg.com/feather-icons"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Outfit:wght@200;400&display=swap" rel="stylesheet"><style>* {font-family: 'Outfit', sans-serif;}@keyframes float {0%, 100% { transform: translateY(0); }50% { transform: translateY(-15px); }}.bubble {position: absolute;border-radius: 50%;background: radial-gradient(circle at 30% 30%,rgba(255,255,255,0.8) 0%,transparent 70%);backdrop-filter: blur(2px);transition: transform 0.3s ease, filter 0.3s ease;will-change: transform;filter: saturate(1.2);box-shadow:inset 0 0 15px rgba(255,255,255,0.2),inset 10px 0 20px rgba(180,100,255,0.2),inset -10px 0 20px rgba(100,200,255,0.2);border: 1px solid rgba(255,255,255,0.15);animation: float 6s ease-in-out infinite;}.bubble::before {content: '';position: absolute;top: 10%;left: 20%;width: 40%;height: 40%;border-radius: 50%;background: linear-gradient(45deg,rgba(255,100,255,0.3),rgba(100,200,255,0.3),rgba(100,255,200,0.3));filter: blur(10px);z-index: -1;}.bubble:hover {transform: scale(1.1);filter: brightness(1.1) saturate(1.5);box-shadow:inset 0 0 20px rgba(255,255,255,0.3),inset 15px 0 30px rgba(180,100,255,0.3),inset -15px 0 30px rgba(100,200,255,0.3);}.bubble-expanded {animation: none;transform: scale(1.8) !important;z-index: 100;backdrop-filter: blur(10px);box-shadow:inset 0 0 30px rgba(255,255,255,0.4),inset 20px 0 40px rgba(180,100,255,0.4),inset -20px 0 40px rgba(100,200,255,0.4);}.cosmic-bg {background: radial-gradient(ellipse at center,rgba(15,12,41,1) 0%,rgba(48,43,99,0.8) 50%,rgba(36,36,62,0.6) 100%);position: relative;overflow: hidden;}.cosmic-bg::before {content: '';position: absolute;top: 0;left: 0;right: 0;bottom: 0;background:radial-gradient(circle at 20% 30%, rgba(180,100,255,0.1) 0%, transparent 50%),radial-gradient(circle at 80% 70%, rgba(100,200,255,0.1) 0%, transparent 50%);pointer-events: none;}.thought-content {opacity: 0;max-height: 0;transition: all 0.4s ease-out;overflow: hidden;position: relative;text-align: center;color: white;pointer-events: none;}.bubble-expanded .thought-content {opacity: 1;max-height: 200px;padding: 15px;pointer-events: auto;}.stellar-text {font-weight: 200;letter-spacing: 2px;background: linear-gradient(90deg, #ffffff, #aad5ff);-webkit-background-clip: text;background-clip: text;color: transparent;text-shadow: 0 0 15px rgba(170,213,255,0.3);}.star {position: absolute;background: white;border-radius: 50%;pointer-events: none;}</style></head><body class="cosmic-bg h-screen overflow-hidden relative"><div id="stars-container" class="absolute inset-0 w-full h-full pointer-events-none"></div><header class="relative z-10 pt-12 pb-8 px-4 text-center"><h1 class="text-5xl md:text-6xl font-light stellar-text">DREAM NEBULA</h1><p class="text-blue-100 mt-2 font-light tracking-wider text-sm md:text-base">FLOATING THOUGHT BUBBLES</p></header><button id="add-bubble-btn" class="fixed top-6 right-6 z-20 p-3 rounded-full bg-white/10 backdrop-blur-md text-white hover:bg-white/20 transition-all"><i data-feather="plus" class="w-5 h-5"></i></button><main class="relative z-10 h-[calc(100vh-180px)]"><div id="bubble-container" class="absolute inset-0"></div></main><!-- Add Bubble Modal --><div id="add-bubble-modal" class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm hidden"><div class="bg-gradient-to-br from-white/10 to-white/5 rounded-xl p-6 max-w-md w-full mx-4 border border-white/10 backdrop-blur-lg"><h3 class="text-xl font-light text-white mb-4">Add Thought Bubble</h3><textarea id="bubble-text" class="w-full p-3 bg-white/5 text-white rounded-lg border border-white/10 focus:outline-none focus:ring-1 focus:ring-white/30 placeholder-white/50" rows="4" placeholder="Your dreamlike thought..."></textarea><div class="flex justify-end space-x-3 mt-4"><button id="cancel-bubble" class="px-4 py-2 text-white/70 hover:text-white">Cancel</button><button id="save-bubble" class="px-4 py-2 bg-white/10 hover:bg-white/20 text-white rounded-lg transition">Save</button></div></div></div><!-- Edit Bubble Modal --><div id="edit-bubble-modal" class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm hidden"><div class="bg-gradient-to-br from-white/10 to-white/5 rounded-xl p-6 max-w-md w-full mx-4 border border-white/10 backdrop-blur-lg"><h3 class="text-xl font-light text-white mb-4">Edit Bubble</h3><textarea id="edit-bubble-text" class="w-full p-3 bg-white/5 text-white rounded-lg border border-white/10 focus:outline-none focus:ring-1 focus:ring-white/30 placeholder-white/50" rows="4"></textarea><div class="flex justify-between mt-4"><button id="delete-bubble" class="px-4 py-2 text-red-300 hover:text-red-400">Delete</button><div class="flex space-x-3"><button id="cancel-edit" class="px-4 py-2 text-white/70 hover:text-white">Cancel</button><button id="save-edit" class="px-4 py-2 bg-white/10 hover:bg-white/20 text-white rounded-lg transition">Save</button></div></div></div></div><script>// Generate random starsfunction createStars() {const container = document.getElementById('stars-container');const starCount = Math.floor(window.innerWidth * window.innerHeight / 1000);for (let i = 0; i < starCount; i++) {const star = document.createElement('div');star.className = 'star';// Random position and sizeconst size = Math.random() * 2;star.style.width = `${size}px`;star.style.height = `${size}px`;star.style.left = `${Math.random() * 100}%`;star.style.top = `${Math.random() * 100}%`;// Random opacity and animationstar.style.opacity = Math.random() * 0.8 + 0.2;star.style.animation = `twinkle ${Math.random() * 5 + 5}s infinite alternate`;container.appendChild(star);}}// Initialize bubble functionalitydocument.addEventListener('DOMContentLoaded', function() {createStars();feather.replace();// Initialize bubbles from localStorage or create default onesloadBubbles();// Modal functionalityconst addBtn = document.getElementById('add-bubble-btn');const addModal = document.getElementById('add-bubble-modal');const cancelBtn = document.getElementById('cancel-bubble');const saveBtn = document.getElementById('save-bubble');addBtn.addEventListener('click', () => addModal.classList.remove('hidden'));cancelBtn.addEventListener('click', () => {document.getElementById('bubble-text').value = '';addModal.classList.add('hidden');});saveBtn.addEventListener('click', () => {const text = document.getElementById('bubble-text').value.trim();if (text) {createBubble(text);document.getElementById('bubble-text').value = '';addModal.classList.add('hidden');}});// Edit modal functionalityconst editModal = document.getElementById('edit-bubble-modal');const cancelEditBtn = document.getElementById('cancel-edit');const saveEditBtn = document.getElementById('save-edit');const deleteBtn = document.getElementById('delete-bubble');let currentBubbleId = null;cancelEditBtn.addEventListener('click', () => {document.getElementById('edit-bubble-text').value = '';editModal.classList.add('hidden');});saveEditBtn.addEventListener('click', () => {const text = document.getElementById('edit-bubble-text').value.trim();if (text && currentBubbleId) {updateBubble(currentBubbleId, text);editModal.classList.add('hidden');}});deleteBtn.addEventListener('click', () => {if (currentBubbleId) {deleteBubble(currentBubbleId);editModal.classList.add('hidden');}});});// Bubble functionsfunction loadBubbles() {let bubbles = localStorage.getItem('bubbles');if (!bubbles) {// Create default bubblesbubbles = [{id: Date.now().toString(),text: "We are all just fragments of stardust trying to remember where we came from.",x: 20, y: 30, z: 0,color: 'rgba(180,100,255,0.2)'},{id: (Date.now() + 1).toString(),text: "Time is just the universe's way of preventing everything from happening at once.",x: 70, y: 20, z: 20,color: 'rgba(100,200,255,0.2)'},{id: (Date.now() + 2).toString(),text: "The trees are poems the earth writes upon the sky.",x: 30, y: 60, z: -20,color: 'rgba(255,100,200,0.2)'}];localStorage.setItem('bubbles', JSON.stringify(bubbles));} else {bubbles = JSON.parse(bubbles);}bubbles.forEach(bubble => createBubbleElement(bubble));}function createBubble(text) {const bubble = {id: Date.now().toString(),text: text,x: Math.random() * 80 + 10, // 10-90%y: Math.random() * 80 + 10, // 10-90%z: Math.random() * 40 - 20, // -20 to 20color: `rgba(${Math.floor(Math.random() * 100 + 155)}, ${Math.floor(Math.random() * 100 + 100)}, 255, 0.2)`};// Save to localStoragelet bubbles = JSON.parse(localStorage.getItem('bubbles') || '[]');bubbles.push(bubble);localStorage.setItem('bubbles', JSON.stringify(bubbles));createBubbleElement(bubble);}function createBubbleElement(bubble) {const container = document.getElementById('bubble-container');const bubbleEl = document.createElement('div');const size = Math.random() * 60 + 40; // 40-100pxbubbleEl.className = 'bubble cursor-pointer';bubbleEl.style.width = `${size}px`;bubbleEl.style.height = `${size}px`;bubbleEl.style.left = `${bubble.x}%`;bubbleEl.style.top = `${bubble.y}%`;bubbleEl.style.background = bubble.color;bubbleEl.dataset.id = bubble.id;// Set transform for z-depth parallax effectbubbleEl.style.transform = `translateZ(${bubble.z}px)`;// Create content divconst content = document.createElement('div');content.className = 'thought-content';content.textContent = bubble.text;bubbleEl.appendChild(content);// Add float animation with GSAPgsap.to(bubbleEl, {duration: 10 + Math.random() * 10,y: `+=${(Math.random() * 30 - 15) * (1 + bubble.z/100)}`,x: `+=${(Math.random() * 30 - 15) * (1 + bubble.z/100)}`,ease: "sine.inOut",repeat: -1,yoyo: true});// Click handlerbubbleEl.addEventListener('click', function(e) {e.stopPropagation();// Close any expanded bubbledocument.querySelectorAll('.bubble-expanded').forEach(el => {if (el !== bubbleEl) el.classList.remove('bubble-expanded');});// Toggle current bubblebubbleEl.classList.toggle('bubble-expanded');// If expanded, open edit modalif (bubbleEl.classList.contains('bubble-expanded')) {currentBubbleId = bubble.id;document.getElementById('edit-bubble-text').value = bubble.text;editModal.classList.remove('hidden');}});// Hover effectbubbleEl.addEventListener('mouseenter', () => {gsap.to(bubbleEl, {duration: 0.3,scale: 1.1,ease: "power2.out"});});bubbleEl.addEventListener('mouseleave', () => {if (!bubbleEl.classList.contains('bubble-expanded')) {gsap.to(bubbleEl, {duration: 0.3,scale: 1,ease: "power2.out"});}});container.appendChild(bubbleEl);}function updateBubble(id, text) {let bubbles = JSON.parse(localStorage.getItem('bubbles') || '[]');const index = bubbles.findIndex(b => b.id === id);if (index !== -1) {bubbles[index].text = text;localStorage.setItem('bubbles', JSON.stringify(bubbles));// Update DOMconst bubbleEl = document.querySelector(`.bubble[data-id="${id}"]`);if (bubbleEl) {bubbleEl.querySelector('.thought-content').textContent = text;}}}function deleteBubble(id) {let bubbles = JSON.parse(localStorage.getItem('bubbles') || '[]');bubbles = bubbles.filter(b => b.id !== id);localStorage.setItem('bubbles', JSON.stringify(bubbles));// Remove from DOMconst bubbleEl = document.querySelector(`.bubble[data-id="${id}"]`);if (bubbleEl) {gsap.to(bubbleEl, {duration: 0.3,scale: 0,opacity: 0,onComplete: () => bubbleEl.remove()});}}// Close modals when clicking outsidedocument.addEventListener('click', function(e) {if (!e.target.closest('#add-bubble-modal > div') && !e.target.closest('#add-bubble-btn')) {document.getElementById('add-bubble-modal').classList.add('hidden');}if (!e.target.closest('#edit-bubble-modal > div')) {document.getElementById('edit-bubble-modal').classList.add('hidden');}});</script></body></html>