Skip to content

Commit 1c7e2fe

Browse files
Added Infinite Scroll Emoji Background (#1391)
1 parent 60519e7 commit 1c7e2fe

File tree

4 files changed

+99
-0
lines changed

4 files changed

+99
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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>Infinite Scroll Emoji Background</title>
8+
</head>
9+
<body>
10+
<div class="emoji-container"></div>
11+
12+
<script src="script.js"></script>
13+
</body>
14+
</html>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
document.addEventListener('DOMContentLoaded', function () {
2+
const emojiContainer = document.querySelector('.emoji-container');
3+
const emojis = ['😂', '🤣', '😁', '🤭', '😈', '👻', '💀', '👀', '🐼', '🐸', '🐣', '🐳', '🦀', '🌝', '🌟', '🌈', '🌞', '🥑', '🌽', '🍔', '🍟', '🍺', '🍕', '🍿', '🗿', '💎', '🍀', '🚀', '🗽', '🗼', '🏯'];
4+
5+
const numberOfLines = Math.floor(window.innerWidth / 40);
6+
7+
for (let i = 0; i < numberOfLines; i++) {
8+
const line = document.createElement('div');
9+
line.classList.add('emoji-line');
10+
const emojiDiv = document.createElement('div');
11+
12+
for (let j = 0; j < 30; j++) {
13+
const randomEmoji = emojis[Math.floor(Math.random() * emojis.length)];
14+
const emojiElement = document.createElement('div');
15+
emojiElement.classList.add('emoji');
16+
emojiElement.textContent = randomEmoji;
17+
emojiDiv.appendChild(emojiElement);
18+
}
19+
20+
line.appendChild(emojiDiv);
21+
line.appendChild(emojiDiv.cloneNode(true));
22+
emojiContainer.appendChild(line);
23+
}
24+
});
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
body {
2+
margin: 0;
3+
overflow: hidden;
4+
background-color: #000000;
5+
display: flex;
6+
align-items: center;
7+
justify-content: center;
8+
height: 100vh;
9+
font-family: monospace;
10+
}
11+
12+
.emoji-container {
13+
display: flex;
14+
width: 100%;
15+
height: 100vh;
16+
overflow: hidden;
17+
}
18+
19+
.emoji-line {
20+
display: flex;
21+
flex-direction: column;
22+
flex-grow: 1;
23+
margin: 0 5px;
24+
position: relative;
25+
overflow: hidden;
26+
}
27+
28+
@keyframes scroll {
29+
0% {
30+
transform: translateY(0);
31+
}
32+
100% {
33+
transform: translateY(-100%);
34+
}
35+
}
36+
37+
.emoji-line div {
38+
display: flex;
39+
flex-direction: column;
40+
animation: scroll linear infinite;
41+
animation-duration: 20s; /* Adjust speed here */
42+
}
43+
44+
.emoji {
45+
font-size: 1rem; /* Emoji size */
46+
padding: 5px;
47+
text-align: center;
48+
}

assets/html_files/backgrounds.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,19 @@ <h1>Gradient Waves Background</h1>
352352
</a>
353353
</div>
354354
</div>
355+
<div class="box">
356+
<h1>Infinite Scroll Emoji Background</h1>
357+
<div class="preview">
358+
<a href="../../Components/Backgrounds/Infinite-Scroll-Emoji-Background/index.html" title="Live Preview" target="_blank">
359+
<img src="../images/link.png">
360+
</a>
361+
</div>
362+
<div class="source">
363+
<a href="https://github.com/Rakesh9100/Beautiify/tree/main/Components/Backgrounds/Infinite-Scroll-Emoji-Background" title="Source Code" target="_blank">
364+
<img src="../images/github.png">
365+
</a>
366+
</div>
367+
</div>
355368
<div class="box">
356369
<h1>Interactive Balls Background</h1>
357370
<div class="preview">

0 commit comments

Comments
 (0)