Spaces:
Running
Running
make the blobs larger, vary their alpha or transparency and make them overlap somewhat
Browse files- index.html +34 -37
index.html
CHANGED
|
@@ -17,15 +17,15 @@
|
|
| 17 |
.blob {
|
| 18 |
position: absolute;
|
| 19 |
border-radius: 50%;
|
| 20 |
-
filter: blur(
|
| 21 |
-
opacity: 0.
|
| 22 |
mix-blend-mode: screen;
|
| 23 |
}
|
| 24 |
.orbit-blob {
|
| 25 |
position: absolute;
|
| 26 |
border-radius: 50%;
|
| 27 |
-
filter: blur(
|
| 28 |
-
opacity: 0.
|
| 29 |
mix-blend-mode: screen;
|
| 30 |
}
|
| 31 |
.container {
|
|
@@ -70,32 +70,30 @@
|
|
| 70 |
const blob2 = document.getElementById('blob2');
|
| 71 |
const blob3 = document.getElementById('blob3');
|
| 72 |
// Set initial positions for main blobs
|
| 73 |
-
blob1.style.width = '
|
| 74 |
-
blob1.style.height = '
|
| 75 |
-
blob1.style.top = '
|
| 76 |
-
blob1.style.left = '
|
| 77 |
-
|
| 78 |
-
blob2.style.width = '500px';
|
| 79 |
-
blob2.style.height = '500px';
|
| 80 |
-
blob2.style.top = '60%';
|
| 81 |
-
blob2.style.left = '70%';
|
| 82 |
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
|
| 88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
const orbitBlobs = [
|
| 90 |
-
{ el: document.getElementById('orbitBlob1'), size:
|
| 91 |
-
{ el: document.getElementById('orbitBlob2'), size:
|
| 92 |
-
{ el: document.getElementById('orbitBlob3'), size:
|
| 93 |
-
{ el: document.getElementById('orbitBlob4'), size:
|
| 94 |
-
{ el: document.getElementById('orbitBlob5'), size:
|
| 95 |
-
{ el: document.getElementById('orbitBlob6'), size:
|
| 96 |
];
|
| 97 |
-
|
| 98 |
-
orbitBlobs.forEach(blob => {
|
| 99 |
blob.el.style.width = `${blob.size}px`;
|
| 100 |
blob.el.style.height = `${blob.size}px`;
|
| 101 |
blob.el.className = `orbit-blob ${blob.color}`;
|
|
@@ -106,10 +104,10 @@
|
|
| 106 |
const x = e.clientX;
|
| 107 |
const y = e.clientY;
|
| 108 |
// Move blobs toward cursor with different speeds (increased by 30%)
|
| 109 |
-
blob1.style.transform = `translate(${x * 0.
|
| 110 |
-
blob2.style.transform = `translate(${x * -0.
|
| 111 |
-
blob3.style.transform = `translate(${x * 0.
|
| 112 |
-
|
| 113 |
|
| 114 |
// Animation loop for orbiting blobs
|
| 115 |
function animateOrbitBlobs() {
|
|
@@ -134,7 +132,7 @@
|
|
| 134 |
// Continuous animation with Anime.js for main blobs
|
| 135 |
anime({
|
| 136 |
targets: '#blob1',
|
| 137 |
-
scale: [1, 1.
|
| 138 |
borderRadius: ['50%', '40%', '50%'],
|
| 139 |
duration: 8000,
|
| 140 |
easing: 'easeInOutQuad',
|
|
@@ -143,7 +141,7 @@
|
|
| 143 |
|
| 144 |
anime({
|
| 145 |
targets: '#blob2',
|
| 146 |
-
scale: [1, 1.
|
| 147 |
borderRadius: ['50%', '60%', '50%'],
|
| 148 |
duration: 10000,
|
| 149 |
easing: 'easeInOutCubic',
|
|
@@ -152,19 +150,18 @@
|
|
| 152 |
|
| 153 |
anime({
|
| 154 |
targets: '#blob3',
|
| 155 |
-
scale: [1, 1.
|
| 156 |
borderRadius: ['50%', '45%', '50%'],
|
| 157 |
duration: 12000,
|
| 158 |
easing: 'easeInOutQuart',
|
| 159 |
loop: true
|
| 160 |
});
|
| 161 |
-
|
| 162 |
-
// Add subtle pulsing animation to orbiting blobs
|
| 163 |
orbitBlobs.forEach((blob, index) => {
|
| 164 |
anime({
|
| 165 |
targets: blob.el,
|
| 166 |
-
scale: [1, 1.
|
| 167 |
-
opacity: [0.
|
| 168 |
duration: 3000 + index * 500,
|
| 169 |
easing: 'easeInOutSine',
|
| 170 |
loop: true,
|
|
|
|
| 17 |
.blob {
|
| 18 |
position: absolute;
|
| 19 |
border-radius: 50%;
|
| 20 |
+
filter: blur(80px);
|
| 21 |
+
opacity: 0.8;
|
| 22 |
mix-blend-mode: screen;
|
| 23 |
}
|
| 24 |
.orbit-blob {
|
| 25 |
position: absolute;
|
| 26 |
border-radius: 50%;
|
| 27 |
+
filter: blur(60px);
|
| 28 |
+
opacity: 0.6;
|
| 29 |
mix-blend-mode: screen;
|
| 30 |
}
|
| 31 |
.container {
|
|
|
|
| 70 |
const blob2 = document.getElementById('blob2');
|
| 71 |
const blob3 = document.getElementById('blob3');
|
| 72 |
// Set initial positions for main blobs
|
| 73 |
+
blob1.style.width = '800px';
|
| 74 |
+
blob1.style.height = '800px';
|
| 75 |
+
blob1.style.top = '15%';
|
| 76 |
+
blob1.style.left = '10%';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
+
blob2.style.width = '700px';
|
| 79 |
+
blob2.style.height = '700px';
|
| 80 |
+
blob2.style.top = '55%';
|
| 81 |
+
blob2.style.left = '65%';
|
| 82 |
|
| 83 |
+
blob3.style.width = '600px';
|
| 84 |
+
blob3.style.height = '600px';
|
| 85 |
+
blob3.style.top = '35%';
|
| 86 |
+
blob3.style.left = '45%';
|
| 87 |
+
// Set initial positions for orbiting blobs
|
| 88 |
const orbitBlobs = [
|
| 89 |
+
{ el: document.getElementById('orbitBlob1'), size: 200, color: 'bg-teal-500', angle: 0, speed: 0.005, distance: 350 },
|
| 90 |
+
{ el: document.getElementById('orbitBlob2'), size: 170, color: 'bg-yellow-500', angle: Math.PI/3, speed: 0.003, distance: 300 },
|
| 91 |
+
{ el: document.getElementById('orbitBlob3'), size: 230, color: 'bg-indigo-500', angle: Math.PI/1.5, speed: 0.004, distance: 400 },
|
| 92 |
+
{ el: document.getElementById('orbitBlob4'), size: 150, color: 'bg-green-500', angle: Math.PI, speed: 0.006, distance: 250 },
|
| 93 |
+
{ el: document.getElementById('orbitBlob5'), size: 190, color: 'bg-red-500', angle: Math.PI*1.5, speed: 0.0035, distance: 330 },
|
| 94 |
+
{ el: document.getElementById('orbitBlob6'), size: 210, color: 'bg-cyan-500', angle: Math.PI*1.8, speed: 0.0045, distance: 370 }
|
| 95 |
];
|
| 96 |
+
orbitBlobs.forEach(blob => {
|
|
|
|
| 97 |
blob.el.style.width = `${blob.size}px`;
|
| 98 |
blob.el.style.height = `${blob.size}px`;
|
| 99 |
blob.el.className = `orbit-blob ${blob.color}`;
|
|
|
|
| 104 |
const x = e.clientX;
|
| 105 |
const y = e.clientY;
|
| 106 |
// Move blobs toward cursor with different speeds (increased by 30%)
|
| 107 |
+
blob1.style.transform = `translate(${x * 0.03}px, ${y * 0.03}px)`;
|
| 108 |
+
blob2.style.transform = `translate(${x * -0.022}px, ${y * -0.022}px)`;
|
| 109 |
+
blob3.style.transform = `translate(${x * 0.015}px, ${y * 0.015}px)`;
|
| 110 |
+
});
|
| 111 |
|
| 112 |
// Animation loop for orbiting blobs
|
| 113 |
function animateOrbitBlobs() {
|
|
|
|
| 132 |
// Continuous animation with Anime.js for main blobs
|
| 133 |
anime({
|
| 134 |
targets: '#blob1',
|
| 135 |
+
scale: [1, 1.3, 1],
|
| 136 |
borderRadius: ['50%', '40%', '50%'],
|
| 137 |
duration: 8000,
|
| 138 |
easing: 'easeInOutQuad',
|
|
|
|
| 141 |
|
| 142 |
anime({
|
| 143 |
targets: '#blob2',
|
| 144 |
+
scale: [1, 1.4, 1],
|
| 145 |
borderRadius: ['50%', '60%', '50%'],
|
| 146 |
duration: 10000,
|
| 147 |
easing: 'easeInOutCubic',
|
|
|
|
| 150 |
|
| 151 |
anime({
|
| 152 |
targets: '#blob3',
|
| 153 |
+
scale: [1, 1.2, 1],
|
| 154 |
borderRadius: ['50%', '45%', '50%'],
|
| 155 |
duration: 12000,
|
| 156 |
easing: 'easeInOutQuart',
|
| 157 |
loop: true
|
| 158 |
});
|
| 159 |
+
// Add subtle pulsing animation to orbiting blobs
|
|
|
|
| 160 |
orbitBlobs.forEach((blob, index) => {
|
| 161 |
anime({
|
| 162 |
targets: blob.el,
|
| 163 |
+
scale: [1, 1.2, 1],
|
| 164 |
+
opacity: [0.6, 0.8, 0.6],
|
| 165 |
duration: 3000 + index * 500,
|
| 166 |
easing: 'easeInOutSine',
|
| 167 |
loop: true,
|