Spaces:
Running
Running
Add 2 files
Browse files- index.html +575 -62
- prompts.txt +2 -1
index.html
CHANGED
|
@@ -3,17 +3,19 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>Cosmic
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.4/gsap.min.js"></script>
|
|
|
|
| 9 |
<style>
|
| 10 |
body {
|
| 11 |
overflow-x: hidden;
|
| 12 |
-
background: radial-gradient(ellipse at bottom, #
|
| 13 |
-
height:
|
| 14 |
margin: 0;
|
| 15 |
perspective: 1000px;
|
| 16 |
cursor: none;
|
|
|
|
| 17 |
}
|
| 18 |
|
| 19 |
.star {
|
|
@@ -22,43 +24,50 @@
|
|
| 22 |
border-radius: 50%;
|
| 23 |
animation: twinkle var(--duration) infinite ease-in-out;
|
| 24 |
opacity: 0;
|
|
|
|
| 25 |
}
|
| 26 |
|
| 27 |
@keyframes twinkle {
|
| 28 |
-
0%, 100% { opacity: 0; transform: scale(0.
|
| 29 |
50% { opacity: var(--opacity); transform: scale(1); }
|
| 30 |
}
|
| 31 |
|
| 32 |
.comet {
|
| 33 |
-
position:
|
| 34 |
-
width:
|
| 35 |
-
height:
|
| 36 |
border-radius: 50%;
|
| 37 |
-
background:
|
| 38 |
-
box-shadow: 0 0
|
| 39 |
pointer-events: none;
|
| 40 |
-
z-index:
|
|
|
|
|
|
|
| 41 |
}
|
| 42 |
|
| 43 |
.comet-tail {
|
| 44 |
-
position:
|
| 45 |
-
width:
|
| 46 |
-
height:
|
| 47 |
-
background: linear-gradient(90deg, rgba(
|
| 48 |
border-radius: 50%;
|
| 49 |
pointer-events: none;
|
| 50 |
-
z-index:
|
| 51 |
transform-origin: left center;
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
|
| 54 |
.galaxy {
|
| 55 |
position: absolute;
|
| 56 |
-
width:
|
| 57 |
-
height:
|
| 58 |
border-radius: 50%;
|
| 59 |
-
background: radial-gradient(circle at center, rgba(138, 43, 226, 0.
|
| 60 |
-
filter: blur(
|
| 61 |
-
animation: rotate
|
|
|
|
|
|
|
| 62 |
}
|
| 63 |
|
| 64 |
@keyframes rotate {
|
|
@@ -69,78 +78,209 @@
|
|
| 69 |
.planet {
|
| 70 |
position: absolute;
|
| 71 |
border-radius: 50%;
|
| 72 |
-
box-shadow: inset 0 0
|
|
|
|
|
|
|
| 73 |
}
|
| 74 |
|
| 75 |
.scroll-text {
|
| 76 |
-
position:
|
| 77 |
-
bottom:
|
| 78 |
left: 50%;
|
| 79 |
transform: translateX(-50%);
|
| 80 |
-
color: rgba(255,255,255,0.
|
| 81 |
font-family: 'Arial', sans-serif;
|
| 82 |
text-transform: uppercase;
|
| 83 |
-
letter-spacing:
|
| 84 |
-
font-size:
|
| 85 |
-
animation: pulse
|
|
|
|
|
|
|
| 86 |
}
|
| 87 |
|
| 88 |
@keyframes pulse {
|
| 89 |
-
0%, 100% { opacity: 0.
|
| 90 |
-
50% { opacity: 1; }
|
| 91 |
}
|
| 92 |
|
| 93 |
.depth-layer {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
position: absolute;
|
| 95 |
width: 100%;
|
| 96 |
height: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
top: 0;
|
| 98 |
left: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
}
|
| 100 |
</style>
|
| 101 |
</head>
|
| 102 |
<body>
|
|
|
|
| 103 |
<div class="depth-layer" id="far-stars"></div>
|
| 104 |
<div class="depth-layer" id="mid-stars"></div>
|
| 105 |
<div class="depth-layer" id="near-stars"></div>
|
| 106 |
-
<div class="galaxy" style="top: 30%; left: 20%;"></div>
|
| 107 |
-
<div class="galaxy" style="top: 70%; left: 80%;"></div>
|
| 108 |
|
| 109 |
-
<div class="
|
| 110 |
-
<div class="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
<div class="planet" id="planet1"></div>
|
| 113 |
<div class="planet" id="planet2"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
-
<div class="scroll-text">Scroll to
|
| 116 |
|
| 117 |
<script>
|
| 118 |
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
|
|
|
|
|
|
| 119 |
// Create stars at different depth layers
|
| 120 |
-
createStars('far-stars',
|
| 121 |
-
createStars('mid-stars',
|
| 122 |
-
createStars('near-stars',
|
| 123 |
|
| 124 |
// Create planets
|
| 125 |
-
createPlanet('planet1',
|
| 126 |
-
createPlanet('planet2',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
|
| 128 |
// Mouse move effects
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
document.addEventListener('mousemove', function(e) {
|
| 130 |
const comet = document.getElementById('comet');
|
| 131 |
const tail = document.getElementById('comet-tail');
|
| 132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
// Calculate angle for tail direction
|
| 134 |
-
const
|
| 135 |
-
const prevY = parseFloat(comet.dataset.prevY) || e.clientY;
|
| 136 |
-
const angle = Math.atan2(e.clientY - prevY, e.clientX - prevX) * 180 / Math.PI;
|
| 137 |
|
| 138 |
-
// Update comet position with
|
| 139 |
gsap.to(comet, {
|
| 140 |
-
x:
|
| 141 |
-
y:
|
| 142 |
-
duration: 0.
|
| 143 |
-
ease: "
|
| 144 |
});
|
| 145 |
|
| 146 |
// Update tail position and rotation
|
|
@@ -148,13 +288,14 @@
|
|
| 148 |
x: e.clientX,
|
| 149 |
y: e.clientY,
|
| 150 |
rotation: angle,
|
| 151 |
-
duration: 0.
|
| 152 |
ease: "power2.out"
|
| 153 |
});
|
| 154 |
|
| 155 |
-
//
|
| 156 |
-
|
| 157 |
-
|
|
|
|
| 158 |
|
| 159 |
// Parallax effect for depth layers
|
| 160 |
const xOffset = (window.innerWidth / 2 - e.clientX) / 20;
|
|
@@ -163,28 +304,158 @@
|
|
| 163 |
document.getElementById('far-stars').style.transform = `translate(${xOffset * 0.3}px, ${yOffset * 0.3}px)`;
|
| 164 |
document.getElementById('mid-stars').style.transform = `translate(${xOffset * 0.6}px, ${yOffset * 0.6}px)`;
|
| 165 |
document.getElementById('near-stars').style.transform = `translate(${xOffset}px, ${yOffset}px)`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
});
|
| 167 |
|
| 168 |
// Scroll effects
|
| 169 |
let scrollY = 0;
|
|
|
|
|
|
|
|
|
|
| 170 |
window.addEventListener('scroll', function() {
|
|
|
|
| 171 |
scrollY = window.scrollY;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
-
//
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
|
| 178 |
-
//
|
| 179 |
-
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
});
|
| 182 |
|
| 183 |
-
//
|
| 184 |
-
window.addEventListener('resize', positionPlanets);
|
| 185 |
positionPlanets();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
});
|
| 187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
function createStars(layerId, count, sizeMultiplier, speedMultiplier) {
|
| 189 |
const layer = document.getElementById(layerId);
|
| 190 |
for (let i = 0; i < count; i++) {
|
|
@@ -196,6 +467,7 @@
|
|
| 196 |
const opacity = Math.random() * 0.8 + 0.2;
|
| 197 |
const duration = (Math.random() * 5 + 3) / speedMultiplier;
|
| 198 |
const delay = Math.random() * 5;
|
|
|
|
| 199 |
|
| 200 |
// Apply styles
|
| 201 |
star.style.width = `${size}px`;
|
|
@@ -205,28 +477,269 @@
|
|
| 205 |
star.style.setProperty('--opacity', opacity);
|
| 206 |
star.style.setProperty('--duration', `${duration}s`);
|
| 207 |
star.style.animationDelay = `${delay}s`;
|
|
|
|
| 208 |
|
| 209 |
layer.appendChild(star);
|
| 210 |
}
|
| 211 |
}
|
| 212 |
|
| 213 |
-
function createPlanet(id, size, gradient) {
|
| 214 |
const planet = document.getElementById(id);
|
| 215 |
planet.style.width = `${size}px`;
|
| 216 |
planet.style.height = `${size}px`;
|
| 217 |
planet.style.background = gradient;
|
| 218 |
-
planet.style.
|
|
|
|
| 219 |
}
|
| 220 |
|
| 221 |
function positionPlanets() {
|
| 222 |
const planet1 = document.getElementById('planet1');
|
| 223 |
const planet2 = document.getElementById('planet2');
|
|
|
|
| 224 |
|
| 225 |
planet1.style.left = `${window.innerWidth * 0.7}px`;
|
| 226 |
planet1.style.top = `${window.innerHeight * 0.2}px`;
|
| 227 |
|
| 228 |
planet2.style.left = `${window.innerWidth * 0.2}px`;
|
| 229 |
planet2.style.top = `${window.innerHeight * 0.6}px`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
}
|
| 231 |
</script>
|
| 232 |
<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=dhishooooom/space-pointer" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Cosmic Odyssey</title>
|
| 7 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.4/gsap.min.js"></script>
|
| 9 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
|
| 10 |
<style>
|
| 11 |
body {
|
| 12 |
overflow-x: hidden;
|
| 13 |
+
background: radial-gradient(ellipse at bottom, #0a0e1a 0%, #000000 100%);
|
| 14 |
+
height: 500vh; /* Increased for scroll effect */
|
| 15 |
margin: 0;
|
| 16 |
perspective: 1000px;
|
| 17 |
cursor: none;
|
| 18 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 19 |
}
|
| 20 |
|
| 21 |
.star {
|
|
|
|
| 24 |
border-radius: 50%;
|
| 25 |
animation: twinkle var(--duration) infinite ease-in-out;
|
| 26 |
opacity: 0;
|
| 27 |
+
will-change: transform;
|
| 28 |
}
|
| 29 |
|
| 30 |
@keyframes twinkle {
|
| 31 |
+
0%, 100% { opacity: 0; transform: scale(0.3); }
|
| 32 |
50% { opacity: var(--opacity); transform: scale(1); }
|
| 33 |
}
|
| 34 |
|
| 35 |
.comet {
|
| 36 |
+
position: fixed;
|
| 37 |
+
width: 10px;
|
| 38 |
+
height: 10px;
|
| 39 |
border-radius: 50%;
|
| 40 |
+
background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(100,200,255,0.8) 70%);
|
| 41 |
+
box-shadow: 0 0 15px 5px rgba(100, 200, 255, 0.7);
|
| 42 |
pointer-events: none;
|
| 43 |
+
z-index: 1000;
|
| 44 |
+
will-change: transform;
|
| 45 |
+
mix-blend-mode: screen;
|
| 46 |
}
|
| 47 |
|
| 48 |
.comet-tail {
|
| 49 |
+
position: fixed;
|
| 50 |
+
width: 150px;
|
| 51 |
+
height: 6px;
|
| 52 |
+
background: linear-gradient(90deg, rgba(100,200,255,0.9), transparent);
|
| 53 |
border-radius: 50%;
|
| 54 |
pointer-events: none;
|
| 55 |
+
z-index: 999;
|
| 56 |
transform-origin: left center;
|
| 57 |
+
will-change: transform;
|
| 58 |
+
mix-blend-mode: screen;
|
| 59 |
}
|
| 60 |
|
| 61 |
.galaxy {
|
| 62 |
position: absolute;
|
| 63 |
+
width: 400px;
|
| 64 |
+
height: 400px;
|
| 65 |
border-radius: 50%;
|
| 66 |
+
background: radial-gradient(circle at center, rgba(138, 43, 226, 0.3) 0%, transparent 70%);
|
| 67 |
+
filter: blur(30px);
|
| 68 |
+
animation: rotate var(--speed) linear infinite;
|
| 69 |
+
will-change: transform;
|
| 70 |
+
mix-blend-mode: screen;
|
| 71 |
}
|
| 72 |
|
| 73 |
@keyframes rotate {
|
|
|
|
| 78 |
.planet {
|
| 79 |
position: absolute;
|
| 80 |
border-radius: 50%;
|
| 81 |
+
box-shadow: inset 0 0 30px rgba(255,255,255,0.3), 0 0 50px rgba(255,255,255,0.2);
|
| 82 |
+
will-change: transform;
|
| 83 |
+
filter: drop-shadow(0 0 20px currentColor);
|
| 84 |
}
|
| 85 |
|
| 86 |
.scroll-text {
|
| 87 |
+
position: fixed;
|
| 88 |
+
bottom: 30px;
|
| 89 |
left: 50%;
|
| 90 |
transform: translateX(-50%);
|
| 91 |
+
color: rgba(255,255,255,0.8);
|
| 92 |
font-family: 'Arial', sans-serif;
|
| 93 |
text-transform: uppercase;
|
| 94 |
+
letter-spacing: 3px;
|
| 95 |
+
font-size: 14px;
|
| 96 |
+
animation: pulse 3s infinite;
|
| 97 |
+
z-index: 1000;
|
| 98 |
+
text-shadow: 0 0 10px rgba(100,200,255,0.7);
|
| 99 |
}
|
| 100 |
|
| 101 |
@keyframes pulse {
|
| 102 |
+
0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(0.95); }
|
| 103 |
+
50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
|
| 104 |
}
|
| 105 |
|
| 106 |
.depth-layer {
|
| 107 |
+
position: fixed;
|
| 108 |
+
width: 100%;
|
| 109 |
+
height: 100%;
|
| 110 |
+
top: 0;
|
| 111 |
+
left: 0;
|
| 112 |
+
will-change: transform;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
.nebula {
|
| 116 |
+
position: absolute;
|
| 117 |
+
width: 800px;
|
| 118 |
+
height: 800px;
|
| 119 |
+
border-radius: 50%;
|
| 120 |
+
filter: blur(80px);
|
| 121 |
+
opacity: 0.4;
|
| 122 |
+
mix-blend-mode: screen;
|
| 123 |
+
will-change: transform;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
.constellation {
|
| 127 |
position: absolute;
|
| 128 |
width: 100%;
|
| 129 |
height: 100%;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
.constellation-line {
|
| 133 |
+
position: absolute;
|
| 134 |
+
height: 2px;
|
| 135 |
+
background: linear-gradient(90deg, rgba(255,255,255,0.3), transparent);
|
| 136 |
+
transform-origin: left center;
|
| 137 |
+
will-change: transform;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
.constellation-star {
|
| 141 |
+
position: absolute;
|
| 142 |
+
width: 6px;
|
| 143 |
+
height: 6px;
|
| 144 |
+
border-radius: 50%;
|
| 145 |
+
background: white;
|
| 146 |
+
box-shadow: 0 0 10px 2px white;
|
| 147 |
+
will-change: transform;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
.black-hole {
|
| 151 |
+
position: absolute;
|
| 152 |
+
border-radius: 50%;
|
| 153 |
+
background: radial-gradient(circle, #000000 0%, #330066 70%);
|
| 154 |
+
box-shadow: inset 0 0 50px #000000, 0 0 100px #330066;
|
| 155 |
+
filter: blur(2px);
|
| 156 |
+
will-change: transform;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
.black-hole-accretion {
|
| 160 |
+
position: absolute;
|
| 161 |
+
border-radius: 50%;
|
| 162 |
+
background: transparent;
|
| 163 |
+
border: 2px solid rgba(100,50,255,0.5);
|
| 164 |
+
animation: rotate-accretion 60s linear infinite;
|
| 165 |
+
will-change: transform;
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
@keyframes rotate-accretion {
|
| 169 |
+
from { transform: rotate(0deg) scale(1.1); }
|
| 170 |
+
to { transform: rotate(360deg) scale(1.1); }
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
.cosmic-text {
|
| 174 |
+
position: absolute;
|
| 175 |
+
color: rgba(255,255,255,0.8);
|
| 176 |
+
font-size: 24px;
|
| 177 |
+
text-transform: uppercase;
|
| 178 |
+
letter-spacing: 5px;
|
| 179 |
+
text-shadow: 0 0 15px rgba(100,200,255,0.7);
|
| 180 |
+
opacity: 0;
|
| 181 |
+
will-change: transform, opacity;
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
.particle {
|
| 185 |
+
position: absolute;
|
| 186 |
+
border-radius: 50%;
|
| 187 |
+
background: white;
|
| 188 |
+
will-change: transform;
|
| 189 |
+
mix-blend-mode: screen;
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
#threejs-container {
|
| 193 |
+
position: fixed;
|
| 194 |
top: 0;
|
| 195 |
left: 0;
|
| 196 |
+
width: 100%;
|
| 197 |
+
height: 100%;
|
| 198 |
+
z-index: -1;
|
| 199 |
+
opacity: 0.5;
|
| 200 |
}
|
| 201 |
</style>
|
| 202 |
</head>
|
| 203 |
<body>
|
| 204 |
+
<div id="threejs-container"></div>
|
| 205 |
<div class="depth-layer" id="far-stars"></div>
|
| 206 |
<div class="depth-layer" id="mid-stars"></div>
|
| 207 |
<div class="depth-layer" id="near-stars"></div>
|
|
|
|
|
|
|
| 208 |
|
| 209 |
+
<div class="galaxy" style="top: 20%; left: 15%; --speed: 180s;"></div>
|
| 210 |
+
<div class="galaxy" style="top: 70%; left: 75%; --speed: 240s;"></div>
|
| 211 |
+
<div class="galaxy" style="top: 40%; left: 80%; --speed: 300s;"></div>
|
| 212 |
+
|
| 213 |
+
<div class="nebula" style="background: radial-gradient(circle, rgba(100,50,200,0.5) 0%, transparent 70%); top: 30%; left: 10%;"></div>
|
| 214 |
+
<div class="nebula" style="background: radial-gradient(circle, rgba(50,150,255,0.4) 0%, transparent 70%); top: 60%; left: 70%;"></div>
|
| 215 |
+
|
| 216 |
+
<div class="constellation" id="constellation1"></div>
|
| 217 |
+
<div class="constellation" id="constellation2"></div>
|
| 218 |
+
|
| 219 |
+
<div class="black-hole" id="black-hole1"></div>
|
| 220 |
+
<div class="black-hole-accretion" id="black-hole-accretion1"></div>
|
| 221 |
|
| 222 |
<div class="planet" id="planet1"></div>
|
| 223 |
<div class="planet" id="planet2"></div>
|
| 224 |
+
<div class="planet" id="planet3"></div>
|
| 225 |
+
|
| 226 |
+
<div class="cosmic-text" id="cosmic-text1">Explore the Cosmos</div>
|
| 227 |
+
<div class="cosmic-text" id="cosmic-text2">Infinite Possibilities</div>
|
| 228 |
+
|
| 229 |
+
<div class="comet" id="comet"></div>
|
| 230 |
+
<div class="comet-tail" id="comet-tail"></div>
|
| 231 |
|
| 232 |
+
<div class="scroll-text">Scroll to journey through the universe</div>
|
| 233 |
|
| 234 |
<script>
|
| 235 |
document.addEventListener('DOMContentLoaded', function() {
|
| 236 |
+
// Initialize Three.js for background particles
|
| 237 |
+
initThreeJS();
|
| 238 |
+
|
| 239 |
// Create stars at different depth layers
|
| 240 |
+
createStars('far-stars', 200, 0.5, 1);
|
| 241 |
+
createStars('mid-stars', 300, 1, 1.5);
|
| 242 |
+
createStars('near-stars', 400, 1.5, 2);
|
| 243 |
|
| 244 |
// Create planets
|
| 245 |
+
createPlanet('planet1', 100, 'linear-gradient(45deg, #4b6cb7, #182848)', '#4b6cb7');
|
| 246 |
+
createPlanet('planet2', 150, 'linear-gradient(45deg, #c31432, #240b36)', '#c31432');
|
| 247 |
+
createPlanet('planet3', 80, 'linear-gradient(45deg, #3a7bd5, #00d2ff)', '#3a7bd5');
|
| 248 |
+
|
| 249 |
+
// Create constellations
|
| 250 |
+
createConstellation('constellation1', 5);
|
| 251 |
+
createConstellation('constellation2', 7);
|
| 252 |
+
|
| 253 |
+
// Create black hole
|
| 254 |
+
createBlackHole('black-hole1', 'black-hole-accretion1', 120);
|
| 255 |
+
|
| 256 |
+
// Position cosmic text
|
| 257 |
+
positionCosmicText();
|
| 258 |
|
| 259 |
// Mouse move effects
|
| 260 |
+
let lastX = window.innerWidth / 2;
|
| 261 |
+
let lastY = window.innerHeight / 2;
|
| 262 |
+
let velocityX = 0;
|
| 263 |
+
let velocityY = 0;
|
| 264 |
+
|
| 265 |
document.addEventListener('mousemove', function(e) {
|
| 266 |
const comet = document.getElementById('comet');
|
| 267 |
const tail = document.getElementById('comet-tail');
|
| 268 |
|
| 269 |
+
// Calculate velocity for smoother motion
|
| 270 |
+
velocityX = (e.clientX - lastX) * 0.3;
|
| 271 |
+
velocityY = (e.clientY - lastY) * 0.3;
|
| 272 |
+
lastX = e.clientX;
|
| 273 |
+
lastY = e.clientY;
|
| 274 |
+
|
| 275 |
// Calculate angle for tail direction
|
| 276 |
+
const angle = Math.atan2(velocityY, velocityX) * 180 / Math.PI;
|
|
|
|
|
|
|
| 277 |
|
| 278 |
+
// Update comet position with physics-based movement
|
| 279 |
gsap.to(comet, {
|
| 280 |
+
x: `+=${velocityX}`,
|
| 281 |
+
y: `+=${velocityY}`,
|
| 282 |
+
duration: 0.5,
|
| 283 |
+
ease: "power1.out"
|
| 284 |
});
|
| 285 |
|
| 286 |
// Update tail position and rotation
|
|
|
|
| 288 |
x: e.clientX,
|
| 289 |
y: e.clientY,
|
| 290 |
rotation: angle,
|
| 291 |
+
duration: 0.7,
|
| 292 |
ease: "power2.out"
|
| 293 |
});
|
| 294 |
|
| 295 |
+
// Create particles along comet path
|
| 296 |
+
if (Math.random() > 0.7) {
|
| 297 |
+
createParticle(e.clientX, e.clientY);
|
| 298 |
+
}
|
| 299 |
|
| 300 |
// Parallax effect for depth layers
|
| 301 |
const xOffset = (window.innerWidth / 2 - e.clientX) / 20;
|
|
|
|
| 304 |
document.getElementById('far-stars').style.transform = `translate(${xOffset * 0.3}px, ${yOffset * 0.3}px)`;
|
| 305 |
document.getElementById('mid-stars').style.transform = `translate(${xOffset * 0.6}px, ${yOffset * 0.6}px)`;
|
| 306 |
document.getElementById('near-stars').style.transform = `translate(${xOffset}px, ${yOffset}px)`;
|
| 307 |
+
|
| 308 |
+
// Interactive galaxy movement
|
| 309 |
+
const galaxies = document.querySelectorAll('.galaxy');
|
| 310 |
+
galaxies.forEach(galaxy => {
|
| 311 |
+
const speed = parseFloat(getComputedStyle(galaxy).getPropertyValue('--speed')) || 120;
|
| 312 |
+
gsap.to(galaxy, {
|
| 313 |
+
x: xOffset * 0.2,
|
| 314 |
+
y: yOffset * 0.2,
|
| 315 |
+
duration: speed / 360,
|
| 316 |
+
ease: "none"
|
| 317 |
+
});
|
| 318 |
+
});
|
| 319 |
});
|
| 320 |
|
| 321 |
// Scroll effects
|
| 322 |
let scrollY = 0;
|
| 323 |
+
let lastScrollY = 0;
|
| 324 |
+
let scrollVelocity = 0;
|
| 325 |
+
|
| 326 |
window.addEventListener('scroll', function() {
|
| 327 |
+
lastScrollY = scrollY;
|
| 328 |
scrollY = window.scrollY;
|
| 329 |
+
scrollVelocity = scrollY - lastScrollY;
|
| 330 |
+
|
| 331 |
+
// Move stars based on scroll with velocity
|
| 332 |
+
document.getElementById('far-stars').style.transform = `translateY(${-scrollY * 0.1}px)`;
|
| 333 |
+
document.getElementById('mid-stars').style.transform = `translateY(${-scrollY * 0.3}px)`;
|
| 334 |
+
document.getElementById('near-stars').style.transform = `translateY(${-scrollY * 0.6}px)`;
|
| 335 |
+
|
| 336 |
+
// Scale and move planets based on scroll (simulating movement through space)
|
| 337 |
+
const scrollProgress = scrollY / (document.body.scrollHeight - window.innerHeight);
|
| 338 |
+
|
| 339 |
+
document.getElementById('planet1').style.transform = `
|
| 340 |
+
translate(${scrollY * 0.1}px, ${-scrollY * 0.3}px)
|
| 341 |
+
scale(${1 + scrollY * 0.0003})
|
| 342 |
+
rotate(${scrollY * 0.1}deg)
|
| 343 |
+
`;
|
| 344 |
+
|
| 345 |
+
document.getElementById('planet2').style.transform = `
|
| 346 |
+
translate(${-scrollY * 0.2}px, ${-scrollY * 0.4}px)
|
| 347 |
+
scale(${1 + scrollY * 0.0005})
|
| 348 |
+
rotate(${-scrollY * 0.15}deg)
|
| 349 |
+
`;
|
| 350 |
+
|
| 351 |
+
document.getElementById('planet3').style.transform = `
|
| 352 |
+
translate(${scrollY * 0.15}px, ${-scrollY * 0.2}px)
|
| 353 |
+
scale(${1 + scrollY * 0.0004})
|
| 354 |
+
rotate(${scrollY * 0.2}deg)
|
| 355 |
+
`;
|
| 356 |
+
|
| 357 |
+
// Black hole interaction
|
| 358 |
+
const blackHole = document.getElementById('black-hole1');
|
| 359 |
+
const blackHoleRect = blackHole.getBoundingClientRect();
|
| 360 |
+
const blackHoleX = blackHoleRect.left + blackHoleRect.width / 2;
|
| 361 |
+
const blackHoleY = blackHoleRect.top + blackHoleRect.height / 2;
|
| 362 |
|
| 363 |
+
// Animate cosmic text based on scroll
|
| 364 |
+
gsap.to('#cosmic-text1', {
|
| 365 |
+
y: -scrollY * 0.5,
|
| 366 |
+
opacity: 1 - Math.min(scrollY / 500, 1),
|
| 367 |
+
duration: 0.5
|
| 368 |
+
});
|
| 369 |
+
|
| 370 |
+
gsap.to('#cosmic-text2', {
|
| 371 |
+
y: -scrollY * 0.5,
|
| 372 |
+
opacity: Math.max(0, (scrollY - 800) / 200),
|
| 373 |
+
duration: 0.5
|
| 374 |
+
});
|
| 375 |
|
| 376 |
+
// Create scroll particles
|
| 377 |
+
if (Math.abs(scrollVelocity) > 5 && Math.random() > 0.7) {
|
| 378 |
+
createParticle(
|
| 379 |
+
Math.random() * window.innerWidth,
|
| 380 |
+
Math.random() * window.innerHeight,
|
| 381 |
+
scrollVelocity > 0 ? 'down' : 'up'
|
| 382 |
+
);
|
| 383 |
+
}
|
| 384 |
+
});
|
| 385 |
+
|
| 386 |
+
// Window resize - reposition elements
|
| 387 |
+
window.addEventListener('resize', function() {
|
| 388 |
+
positionPlanets();
|
| 389 |
+
positionBlackHole();
|
| 390 |
+
positionCosmicText();
|
| 391 |
});
|
| 392 |
|
| 393 |
+
// Initial positioning
|
|
|
|
| 394 |
positionPlanets();
|
| 395 |
+
positionBlackHole();
|
| 396 |
+
positionCosmicText();
|
| 397 |
+
|
| 398 |
+
// Animate cosmic text on load
|
| 399 |
+
gsap.from('#cosmic-text1', {
|
| 400 |
+
y: 100,
|
| 401 |
+
opacity: 0,
|
| 402 |
+
duration: 2,
|
| 403 |
+
ease: "power2.out"
|
| 404 |
+
});
|
| 405 |
+
|
| 406 |
+
// Create occasional shooting stars
|
| 407 |
+
setInterval(createShootingStar, 3000);
|
| 408 |
});
|
| 409 |
|
| 410 |
+
function initThreeJS() {
|
| 411 |
+
const container = document.getElementById('threejs-container');
|
| 412 |
+
const scene = new THREE.Scene();
|
| 413 |
+
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
|
| 414 |
+
const renderer = new THREE.WebGLRenderer({ alpha: true });
|
| 415 |
+
|
| 416 |
+
renderer.setSize(window.innerWidth, window.innerHeight);
|
| 417 |
+
container.appendChild(renderer.domElement);
|
| 418 |
+
|
| 419 |
+
// Create particles
|
| 420 |
+
const particlesGeometry = new THREE.BufferGeometry();
|
| 421 |
+
const particlesCnt = 2000;
|
| 422 |
+
|
| 423 |
+
const posArray = new Float32Array(particlesCnt * 3);
|
| 424 |
+
for(let i = 0; i < particlesCnt * 3; i++) {
|
| 425 |
+
posArray[i] = (Math.random() - 0.5) * 10;
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
particlesGeometry.setAttribute('position', new THREE.BufferAttribute(posArray, 3));
|
| 429 |
+
|
| 430 |
+
const particlesMaterial = new THREE.PointsMaterial({
|
| 431 |
+
size: 0.02,
|
| 432 |
+
color: 0xffffff,
|
| 433 |
+
transparent: true,
|
| 434 |
+
opacity: 0.8,
|
| 435 |
+
blending: THREE.AdditiveBlending
|
| 436 |
+
});
|
| 437 |
+
|
| 438 |
+
const particlesMesh = new THREE.Points(particlesGeometry, particlesMaterial);
|
| 439 |
+
scene.add(particlesMesh);
|
| 440 |
+
|
| 441 |
+
camera.position.z = 3;
|
| 442 |
+
|
| 443 |
+
function animate() {
|
| 444 |
+
requestAnimationFrame(animate);
|
| 445 |
+
particlesMesh.rotation.x += 0.0005;
|
| 446 |
+
particlesMesh.rotation.y += 0.0005;
|
| 447 |
+
renderer.render(scene, camera);
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
animate();
|
| 451 |
+
|
| 452 |
+
window.addEventListener('resize', function() {
|
| 453 |
+
camera.aspect = window.innerWidth / window.innerHeight;
|
| 454 |
+
camera.updateProjectionMatrix();
|
| 455 |
+
renderer.setSize(window.innerWidth, window.innerHeight);
|
| 456 |
+
});
|
| 457 |
+
}
|
| 458 |
+
|
| 459 |
function createStars(layerId, count, sizeMultiplier, speedMultiplier) {
|
| 460 |
const layer = document.getElementById(layerId);
|
| 461 |
for (let i = 0; i < count; i++) {
|
|
|
|
| 467 |
const opacity = Math.random() * 0.8 + 0.2;
|
| 468 |
const duration = (Math.random() * 5 + 3) / speedMultiplier;
|
| 469 |
const delay = Math.random() * 5;
|
| 470 |
+
const colorHue = Math.random() * 60 + 180; // Blue to purple range
|
| 471 |
|
| 472 |
// Apply styles
|
| 473 |
star.style.width = `${size}px`;
|
|
|
|
| 477 |
star.style.setProperty('--opacity', opacity);
|
| 478 |
star.style.setProperty('--duration', `${duration}s`);
|
| 479 |
star.style.animationDelay = `${delay}s`;
|
| 480 |
+
star.style.background = `hsl(${colorHue}, 100%, ${Math.random() * 30 + 70}%)`;
|
| 481 |
|
| 482 |
layer.appendChild(star);
|
| 483 |
}
|
| 484 |
}
|
| 485 |
|
| 486 |
+
function createPlanet(id, size, gradient, glowColor) {
|
| 487 |
const planet = document.getElementById(id);
|
| 488 |
planet.style.width = `${size}px`;
|
| 489 |
planet.style.height = `${size}px`;
|
| 490 |
planet.style.background = gradient;
|
| 491 |
+
planet.style.boxShadow = `inset 0 0 ${size/3}px rgba(255,255,255,0.3), 0 0 ${size}px ${glowColor}`;
|
| 492 |
+
planet.style.filter = `drop-shadow(0 0 ${size/3}px ${glowColor})`;
|
| 493 |
}
|
| 494 |
|
| 495 |
function positionPlanets() {
|
| 496 |
const planet1 = document.getElementById('planet1');
|
| 497 |
const planet2 = document.getElementById('planet2');
|
| 498 |
+
const planet3 = document.getElementById('planet3');
|
| 499 |
|
| 500 |
planet1.style.left = `${window.innerWidth * 0.7}px`;
|
| 501 |
planet1.style.top = `${window.innerHeight * 0.2}px`;
|
| 502 |
|
| 503 |
planet2.style.left = `${window.innerWidth * 0.2}px`;
|
| 504 |
planet2.style.top = `${window.innerHeight * 0.6}px`;
|
| 505 |
+
|
| 506 |
+
planet3.style.left = `${window.innerWidth * 0.8}px`;
|
| 507 |
+
planet3.style.top = `${window.innerHeight * 0.7}px`;
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
function createConstellation(id, starCount) {
|
| 511 |
+
const constellation = document.getElementById(id);
|
| 512 |
+
constellation.innerHTML = '';
|
| 513 |
+
|
| 514 |
+
const stars = [];
|
| 515 |
+
|
| 516 |
+
// Create stars
|
| 517 |
+
for (let i = 0; i < starCount; i++) {
|
| 518 |
+
const star = document.createElement('div');
|
| 519 |
+
star.className = 'constellation-star';
|
| 520 |
+
|
| 521 |
+
const size = Math.random() * 4 + 3;
|
| 522 |
+
const x = Math.random() * 90 + 5;
|
| 523 |
+
const y = Math.random() * 90 + 5;
|
| 524 |
+
|
| 525 |
+
star.style.width = `${size}px`;
|
| 526 |
+
star.style.height = `${size}px`;
|
| 527 |
+
star.style.left = `${x}%`;
|
| 528 |
+
star.style.top = `${y}%`;
|
| 529 |
+
|
| 530 |
+
constellation.appendChild(star);
|
| 531 |
+
stars.push({ x, y, element: star });
|
| 532 |
+
|
| 533 |
+
// Make stars twinkle
|
| 534 |
+
gsap.to(star, {
|
| 535 |
+
opacity: Math.random() * 0.5 + 0.5,
|
| 536 |
+
duration: Math.random() * 3 + 1,
|
| 537 |
+
repeat: -1,
|
| 538 |
+
yoyo: true,
|
| 539 |
+
ease: "sine.inOut"
|
| 540 |
+
});
|
| 541 |
+
}
|
| 542 |
+
|
| 543 |
+
// Create connections between stars
|
| 544 |
+
for (let i = 0; i < stars.length - 1; i++) {
|
| 545 |
+
for (let j = i + 1; j < stars.length; j++) {
|
| 546 |
+
if (Math.random() > 0.7) { // 30% chance to connect
|
| 547 |
+
const line = document.createElement('div');
|
| 548 |
+
line.className = 'constellation-line';
|
| 549 |
+
|
| 550 |
+
const star1 = stars[i];
|
| 551 |
+
const star2 = stars[j];
|
| 552 |
+
|
| 553 |
+
const dx = star2.x - star1.x;
|
| 554 |
+
const dy = star2.y - star1.y;
|
| 555 |
+
const distance = Math.sqrt(dx * dx + dy * dy);
|
| 556 |
+
const angle = Math.atan2(dy, dx) * 180 / Math.PI;
|
| 557 |
+
|
| 558 |
+
line.style.width = `${distance}%`;
|
| 559 |
+
line.style.left = `${star1.x}%`;
|
| 560 |
+
line.style.top = `${star1.y}%`;
|
| 561 |
+
line.style.transform = `rotate(${angle}deg)`;
|
| 562 |
+
line.style.opacity = Math.random() * 0.3 + 0.2;
|
| 563 |
+
|
| 564 |
+
constellation.appendChild(line);
|
| 565 |
+
|
| 566 |
+
// Animate line
|
| 567 |
+
gsap.to(line, {
|
| 568 |
+
opacity: Math.random() * 0.2 + 0.1,
|
| 569 |
+
duration: Math.random() * 4 + 2,
|
| 570 |
+
repeat: -1,
|
| 571 |
+
yoyo: true,
|
| 572 |
+
ease: "sine.inOut"
|
| 573 |
+
});
|
| 574 |
+
}
|
| 575 |
+
}
|
| 576 |
+
}
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
function createBlackHole(id, accretionId, size) {
|
| 580 |
+
const blackHole = document.getElementById(id);
|
| 581 |
+
const accretion = document.getElementById(accretionId);
|
| 582 |
+
|
| 583 |
+
blackHole.style.width = `${size}px`;
|
| 584 |
+
blackHole.style.height = `${size}px`;
|
| 585 |
+
|
| 586 |
+
accretion.style.width = `${size * 1.8}px`;
|
| 587 |
+
accretion.style.height = `${size * 1.8}px`;
|
| 588 |
+
accretion.style.borderWidth = `${size * 0.03}px`;
|
| 589 |
+
|
| 590 |
+
positionBlackHole();
|
| 591 |
+
|
| 592 |
+
// Pulsing effect
|
| 593 |
+
gsap.to(blackHole, {
|
| 594 |
+
boxShadow: `inset 0 0 ${size/2}px #000000, 0 0 ${size}px #6600cc`,
|
| 595 |
+
duration: 3,
|
| 596 |
+
repeat: -1,
|
| 597 |
+
yoyo: true,
|
| 598 |
+
ease: "sine.inOut"
|
| 599 |
+
});
|
| 600 |
+
|
| 601 |
+
gsap.to(accretion, {
|
| 602 |
+
borderColor: 'rgba(150,50,255,0.7)',
|
| 603 |
+
duration: 4,
|
| 604 |
+
repeat: -1,
|
| 605 |
+
yoyo: true,
|
| 606 |
+
ease: "sine.inOut"
|
| 607 |
+
});
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
function positionBlackHole() {
|
| 611 |
+
const blackHole = document.getElementById('black-hole1');
|
| 612 |
+
const accretion = document.getElementById('black-hole-accretion1');
|
| 613 |
+
|
| 614 |
+
blackHole.style.left = `${window.innerWidth * 0.4}px`;
|
| 615 |
+
blackHole.style.top = `${window.innerHeight * 0.4}px`;
|
| 616 |
+
|
| 617 |
+
accretion.style.left = `${parseFloat(blackHole.style.left) - parseFloat(blackHole.style.width) * 0.4}px`;
|
| 618 |
+
accretion.style.top = `${parseFloat(blackHole.style.top) - parseFloat(blackHole.style.height) * 0.4}px`;
|
| 619 |
+
}
|
| 620 |
+
|
| 621 |
+
function positionCosmicText() {
|
| 622 |
+
const text1 = document.getElementById('cosmic-text1');
|
| 623 |
+
const text2 = document.getElementById('cosmic-text2');
|
| 624 |
+
|
| 625 |
+
text1.style.left = `${window.innerWidth * 0.5}px`;
|
| 626 |
+
text1.style.top = `${window.innerHeight * 0.3}px`;
|
| 627 |
+
text1.style.transform = 'translateX(-50%)';
|
| 628 |
+
|
| 629 |
+
text2.style.left = `${window.innerWidth * 0.5}px`;
|
| 630 |
+
text2.style.top = `${window.innerHeight * 0.7}px`;
|
| 631 |
+
text2.style.transform = 'translateX(-50%)';
|
| 632 |
+
}
|
| 633 |
+
|
| 634 |
+
function createParticle(x, y, direction = 'random') {
|
| 635 |
+
const particle = document.createElement('div');
|
| 636 |
+
particle.className = 'particle';
|
| 637 |
+
|
| 638 |
+
const size = Math.random() * 3 + 1;
|
| 639 |
+
const opacity = Math.random() * 0.7 + 0.3;
|
| 640 |
+
const colorHue = Math.random() * 60 + 180; // Blue to purple range
|
| 641 |
+
|
| 642 |
+
particle.style.width = `${size}px`;
|
| 643 |
+
particle.style.height = `${size}px`;
|
| 644 |
+
particle.style.left = `${x}px`;
|
| 645 |
+
particle.style.top = `${y}px`;
|
| 646 |
+
particle.style.background = `hsl(${colorHue}, 100%, 80%)`;
|
| 647 |
+
particle.style.opacity = opacity;
|
| 648 |
+
|
| 649 |
+
document.body.appendChild(particle);
|
| 650 |
+
|
| 651 |
+
let xVelocity, yVelocity;
|
| 652 |
+
|
| 653 |
+
if (direction === 'up') {
|
| 654 |
+
xVelocity = (Math.random() - 0.5) * 2;
|
| 655 |
+
yVelocity = -Math.random() * 3 - 1;
|
| 656 |
+
} else if (direction === 'down') {
|
| 657 |
+
xVelocity = (Math.random() - 0.5) * 2;
|
| 658 |
+
yVelocity = Math.random() * 3 + 1;
|
| 659 |
+
} else {
|
| 660 |
+
xVelocity = (Math.random() - 0.5) * 4;
|
| 661 |
+
yVelocity = (Math.random() - 0.5) * 4;
|
| 662 |
+
}
|
| 663 |
+
|
| 664 |
+
gsap.to(particle, {
|
| 665 |
+
x: `+=${xVelocity * 50}`,
|
| 666 |
+
y: `+=${yVelocity * 50}`,
|
| 667 |
+
opacity: 0,
|
| 668 |
+
scale: 0.1,
|
| 669 |
+
duration: Math.random() * 2 + 1,
|
| 670 |
+
ease: "power1.out",
|
| 671 |
+
onComplete: () => {
|
| 672 |
+
particle.remove();
|
| 673 |
+
}
|
| 674 |
+
});
|
| 675 |
+
}
|
| 676 |
+
|
| 677 |
+
function createShootingStar() {
|
| 678 |
+
const shootingStar = document.createElement('div');
|
| 679 |
+
shootingStar.className = 'particle';
|
| 680 |
+
|
| 681 |
+
const size = Math.random() * 2 + 1;
|
| 682 |
+
const startX = Math.random() * window.innerWidth;
|
| 683 |
+
const startY = -10;
|
| 684 |
+
const endX = startX + (Math.random() - 0.5) * 200;
|
| 685 |
+
const endY = window.innerHeight + 10;
|
| 686 |
+
|
| 687 |
+
shootingStar.style.width = `${size}px`;
|
| 688 |
+
shootingStar.style.height = `${size * 4}px`;
|
| 689 |
+
shootingStar.style.left = `${startX}px`;
|
| 690 |
+
shootingStar.style.top = `${startY}px`;
|
| 691 |
+
shootingStar.style.background = 'linear-gradient(to bottom, white, cyan)';
|
| 692 |
+
shootingStar.style.opacity = '0';
|
| 693 |
+
shootingStar.style.transform = `rotate(${Math.atan2(endY - startY, endX - startX)}rad)`;
|
| 694 |
+
shootingStar.style.borderRadius = '50%';
|
| 695 |
+
|
| 696 |
+
document.body.appendChild(shootingStar);
|
| 697 |
+
|
| 698 |
+
// Create tail
|
| 699 |
+
const tail = document.createElement('div');
|
| 700 |
+
tail.className = 'comet-tail';
|
| 701 |
+
tail.style.width = '100px';
|
| 702 |
+
tail.style.height = '2px';
|
| 703 |
+
tail.style.left = `${startX}px`;
|
| 704 |
+
tail.style.top = `${startY}px`;
|
| 705 |
+
tail.style.transform = `rotate(${Math.atan2(endY - startY, endX - startX)}rad)`;
|
| 706 |
+
tail.style.opacity = '0';
|
| 707 |
+
|
| 708 |
+
document.body.appendChild(tail);
|
| 709 |
+
|
| 710 |
+
// Animate shooting star
|
| 711 |
+
gsap.to(shootingStar, {
|
| 712 |
+
x: endX - startX,
|
| 713 |
+
y: endY - startY,
|
| 714 |
+
opacity: 1,
|
| 715 |
+
duration: 1,
|
| 716 |
+
ease: "power2.in",
|
| 717 |
+
onComplete: () => {
|
| 718 |
+
shootingStar.remove();
|
| 719 |
+
}
|
| 720 |
+
});
|
| 721 |
+
|
| 722 |
+
gsap.to(tail, {
|
| 723 |
+
x: endX - startX,
|
| 724 |
+
y: endY - startY,
|
| 725 |
+
opacity: 0.8,
|
| 726 |
+
duration: 1,
|
| 727 |
+
ease: "power2.in",
|
| 728 |
+
onComplete: () => {
|
| 729 |
+
tail.remove();
|
| 730 |
+
}
|
| 731 |
+
});
|
| 732 |
+
|
| 733 |
+
// Create trail particles
|
| 734 |
+
const particles = 10;
|
| 735 |
+
for (let i = 0; i < particles; i++) {
|
| 736 |
+
setTimeout(() => {
|
| 737 |
+
const progress = i / particles;
|
| 738 |
+
const particleX = startX + (endX - startX) * progress;
|
| 739 |
+
const particleY = startY + (endY - startY) * progress;
|
| 740 |
+
createParticle(particleX, particleY);
|
| 741 |
+
}, i * 100);
|
| 742 |
+
}
|
| 743 |
}
|
| 744 |
</script>
|
| 745 |
<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=dhishooooom/space-pointer" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
prompts.txt
CHANGED
|
@@ -1 +1,2 @@
|
|
| 1 |
-
Develop a cosmic mouse tracking animation that feels like everytime user moves the mouse or scroll they are traveling through infinite space
|
|
|
|
|
|
| 1 |
+
Develop a cosmic mouse tracking animation that feels like everytime user moves the mouse or scroll they are traveling through infinite space
|
| 2 |
+
Make it more complex more cosmic more interactive also scroll is not working fix it
|