Spaces:
Running
Running
I want the clouds to be like that. You can modify the background for sky atmosphere.
Browse files- components/background-clouds.js +5 -3
- script.js +36 -8
- style.css +48 -6
components/background-clouds.js
CHANGED
|
@@ -15,11 +15,13 @@ class BackgroundClouds extends HTMLElement {
|
|
| 15 |
width: 100%;
|
| 16 |
height: 100%;
|
| 17 |
pointer-events: none;
|
| 18 |
-
z-index:
|
| 19 |
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
| 20 |
}
|
| 21 |
-
|
| 22 |
-
.bg-cloud {
|
| 23 |
position: absolute;
|
| 24 |
background: white;
|
| 25 |
border-radius: 50%;
|
|
|
|
| 15 |
width: 100%;
|
| 16 |
height: 100%;
|
| 17 |
pointer-events: none;
|
| 18 |
+
z-index: 1;
|
| 19 |
overflow: hidden;
|
| 20 |
+
background: linear-gradient(135deg, var(--sky-gradient-start), var(--sky-gradient-end));
|
| 21 |
+
animation: sky-pulse 30s ease infinite;
|
| 22 |
+
background-size: 200% 200%;
|
| 23 |
}
|
| 24 |
+
.bg-cloud {
|
|
|
|
| 25 |
position: absolute;
|
| 26 |
background: white;
|
| 27 |
border-radius: 50%;
|
script.js
CHANGED
|
@@ -69,24 +69,52 @@ function createBackgroundClouds() {
|
|
| 69 |
const width = window.innerWidth;
|
| 70 |
const height = window.innerHeight;
|
| 71 |
|
| 72 |
-
|
|
|
|
| 73 |
const cloud = document.createElement('div');
|
| 74 |
-
const size = Math.random() *
|
| 75 |
-
const opacity = Math.random() * 0.
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
cloud.className = 'bg-cloud';
|
| 78 |
cloud.style.width = `${size}px`;
|
| 79 |
-
cloud.style.height = `${size * 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
cloud.style.left = `${Math.random() * width}px`;
|
| 81 |
-
cloud.style.top = `${Math.random() * height}px`;
|
| 82 |
cloud.style.opacity = opacity;
|
| 83 |
-
cloud.style.
|
| 84 |
-
cloud.style.
|
|
|
|
|
|
|
| 85 |
|
| 86 |
bgContainer.appendChild(cloud);
|
| 87 |
}
|
| 88 |
}
|
| 89 |
-
|
| 90 |
function createCloud(data, x, y, baseSize) {
|
| 91 |
const cloud = document.createElement('div');
|
| 92 |
cloud.className = 'cloud';
|
|
|
|
| 69 |
const width = window.innerWidth;
|
| 70 |
const height = window.innerHeight;
|
| 71 |
|
| 72 |
+
// Create more subtle background clouds
|
| 73 |
+
for (let i = 0; i < 25; i++) {
|
| 74 |
const cloud = document.createElement('div');
|
| 75 |
+
const size = Math.random() * 200 + 100;
|
| 76 |
+
const opacity = Math.random() * 0.3 + 0.2;
|
| 77 |
+
const blur = Math.random() * 10 + 5;
|
| 78 |
+
const left = Math.random() * width;
|
| 79 |
+
const top = Math.random() * height * 0.8;
|
| 80 |
|
| 81 |
cloud.className = 'bg-cloud';
|
| 82 |
cloud.style.width = `${size}px`;
|
| 83 |
+
cloud.style.height = `${size * 0.5}px`;
|
| 84 |
+
cloud.style.left = `${left}px`;
|
| 85 |
+
cloud.style.top = `${top}px`;
|
| 86 |
+
cloud.style.opacity = opacity;
|
| 87 |
+
cloud.style.filter = `blur(${blur}px)`;
|
| 88 |
+
cloud.style.animation = `float ${Math.random() * 20 + 10}s ease-in-out infinite`;
|
| 89 |
+
cloud.style.animationDelay = `${Math.random() * 20}s`;
|
| 90 |
+
|
| 91 |
+
// Add slight color variation
|
| 92 |
+
const hue = 210 + Math.random() * 20 - 10;
|
| 93 |
+
cloud.style.background = `hsla(${hue}, 80%, 90%, ${opacity})`;
|
| 94 |
+
|
| 95 |
+
bgContainer.appendChild(cloud);
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
// Add some distant clouds
|
| 99 |
+
for (let i = 0; i < 10; i++) {
|
| 100 |
+
const cloud = document.createElement('div');
|
| 101 |
+
const size = Math.random() * 300 + 150;
|
| 102 |
+
const opacity = Math.random() * 0.2 + 0.1;
|
| 103 |
+
|
| 104 |
+
cloud.className = 'bg-cloud';
|
| 105 |
+
cloud.style.width = `${size}px`;
|
| 106 |
+
cloud.style.height = `${size * 0.4}px`;
|
| 107 |
cloud.style.left = `${Math.random() * width}px`;
|
| 108 |
+
cloud.style.top = `${Math.random() * height * 0.5}px`;
|
| 109 |
cloud.style.opacity = opacity;
|
| 110 |
+
cloud.style.filter = `blur(${Math.random() * 15 + 10}px)`;
|
| 111 |
+
cloud.style.animation = `float ${Math.random() * 30 + 20}s linear infinite`;
|
| 112 |
+
cloud.style.animationDelay = `${Math.random() * 30}s`;
|
| 113 |
+
cloud.style.background = `hsla(210, 60%, 85%, ${opacity})`;
|
| 114 |
|
| 115 |
bgContainer.appendChild(cloud);
|
| 116 |
}
|
| 117 |
}
|
|
|
|
| 118 |
function createCloud(data, x, y, baseSize) {
|
| 119 |
const cloud = document.createElement('div');
|
| 120 |
cloud.className = 'cloud';
|
style.css
CHANGED
|
@@ -1,12 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
@keyframes float {
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
}
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
.cloud {
|
| 11 |
position: absolute;
|
| 12 |
background: white;
|
|
|
|
| 1 |
+
|
| 2 |
+
:root {
|
| 3 |
+
--sky-gradient-start: #87CEEB;
|
| 4 |
+
--sky-gradient-end: #1E90FF;
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
body {
|
| 8 |
+
background: linear-gradient(135deg, var(--sky-gradient-start), var(--sky-gradient-end));
|
| 9 |
+
min-height: 100vh;
|
| 10 |
+
overflow-x: hidden;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
@keyframes float {
|
| 14 |
+
0%, 100% {
|
| 15 |
+
transform: translateY(0);
|
| 16 |
+
}
|
| 17 |
+
50% {
|
| 18 |
+
transform: translateY(-10px);
|
| 19 |
+
}
|
| 20 |
}
|
| 21 |
|
| 22 |
+
@keyframes sky-pulse {
|
| 23 |
+
0%, 100% {
|
| 24 |
+
background-position: 0% 50%;
|
| 25 |
+
}
|
| 26 |
+
50% {
|
| 27 |
+
background-position: 100% 50%;
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.cloud-container {
|
| 32 |
+
position: relative;
|
| 33 |
+
background: transparent;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
.cloud {
|
| 37 |
+
position: absolute;
|
| 38 |
+
background: rgba(255, 255, 255, 0.9);
|
| 39 |
+
border-radius: 50%;
|
| 40 |
+
box-shadow: 0 4px 30px rgba(255, 255, 255, 0.3);
|
| 41 |
+
display: flex;
|
| 42 |
+
align-items: center;
|
| 43 |
+
justify-content: center;
|
| 44 |
+
font-weight: bold;
|
| 45 |
+
color: #333;
|
| 46 |
+
cursor: pointer;
|
| 47 |
+
transition: all 0.5s ease;
|
| 48 |
+
animation: float 3s ease-in-out infinite;
|
| 49 |
+
will-change: transform;
|
| 50 |
+
z-index: 10;
|
| 51 |
+
}
|
| 52 |
.cloud {
|
| 53 |
position: absolute;
|
| 54 |
background: white;
|