Skip to content

Commit ac1e06e

Browse files
authored
Added Bubbles Floating Background-2 (#1499)
1 parent bcc2e28 commit ac1e06e

File tree

6 files changed

+85
-4
lines changed

6 files changed

+85
-4
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
<link rel="stylesheet" href="style.css">
7+
<title>Bubbles Floating Background-2</title>
8+
</head>
9+
<body>
10+
<script src="script.js"></script>
11+
</body>
12+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function createBubble() {
2+
const bubble = document.createElement("div");
3+
bubble.classList.add("bubble");
4+
document.body.appendChild(bubble);
5+
6+
const size = Math.random() * 30 + 10 + "px";
7+
bubble.style.width = size;
8+
bubble.style.height = size;
9+
bubble.style.left = Math.random() * 100 + "vw";
10+
bubble.style.animationDuration = Math.random() * 5 + 3 + "s";
11+
12+
setTimeout(() => {
13+
bubble.remove();
14+
}, 8000);
15+
}
16+
17+
setInterval(createBubble, 500);
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
body {
2+
margin: 0;
3+
height: 100vh;
4+
display: flex;
5+
overflow: hidden;
6+
align-items: center;
7+
justify-content: center;
8+
background-size: 400% 400%;
9+
animation: gradientBG 10s ease infinite;
10+
background: linear-gradient(-45deg, rgba(251, 194, 235, 0.6), rgba(166, 193, 238, 0.6), rgba(251, 194, 235, 0.6), rgba(166, 193, 238, 0.6));
11+
}
12+
13+
@keyframes gradientBG {
14+
0% {
15+
background-position: 0% 50%;
16+
}
17+
18+
50% {
19+
background-position: 100% 50%;
20+
}
21+
22+
100% {
23+
background-position: 0% 50%;
24+
}
25+
}
26+
27+
.bubble {
28+
position: absolute;
29+
width: 20px;
30+
height: 20px;
31+
background: rgb(255, 255, 255); /* Increased opacity */
32+
border-radius: 50%;
33+
opacity: 1; /* Set full opacity */
34+
animation: floatUp linear infinite;
35+
}
36+
37+
@keyframes floatUp {
38+
0% {
39+
transform: translateY(100vh) scale(1);
40+
opacity: 1; /* Start with full opacity */
41+
}
42+
43+
100% {
44+
transform: translateY(-10vh) scale(1.3);
45+
opacity: 0.3; /* Reduced opacity slightly */
46+
}
47+
}

Components/Backgrounds/Bubble-Float-Background/index.html renamed to Components/Backgrounds/Bubbles-Floating-Background/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<link rel="stylesheet" href="style.css">
8-
<title>Bubble Float Background</title>
8+
<title>Bubbles Floating Background</title>
99
</head>
1010

1111
<body>
File renamed without changes.

assets/json_files/backgrounds.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@
4040
"sourceLink": "https://github.com/Rakesh9100/Beautiify/tree/main/Components/Backgrounds/Aurora-Borealis-Background"
4141
},
4242
{
43-
"title": "Bubble Float Background",
44-
"previewLink": "../../Components/Backgrounds/Bubble-Float-Background/index.html",
45-
"sourceLink": "https://github.com/Rakesh9100/Beautiify/tree/main/Components/Backgrounds/Bubble-Float-Background"
43+
"title": "Bubbles Floating Background",
44+
"previewLink": "../../Components/Backgrounds/Bubbles-Floating-Background/index.html",
45+
"sourceLink": "https://github.com/Rakesh9100/Beautiify/tree/main/Components/Backgrounds/Bubbles-Floating-Background"
46+
},
47+
{
48+
"title": "Bubbles Floating Background-2",
49+
"previewLink": "../../Components/Backgrounds/Bubbles-Floating-Background-2/index.html",
50+
"sourceLink": "https://github.com/Rakesh9100/Beautiify/tree/main/Components/Backgrounds/Bubbles-Floating-Background-2"
4651
},
4752
{
4853
"title": "Coalesce Animation Background",

0 commit comments

Comments
 (0)