Skip to content

Commit 668b9dc

Browse files
authored
PR #16: Random-Emoji-Generator
Added random emoji generator made using HTML, CSS and Javascript Merge pull request #16 from urjabahad/main
2 parents 4f40fdf + e50200f commit 668b9dc

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

EmojiGenerator/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This random emoji generator is made using HTML, CSS and Javascript.
2+
CSS styling and JS is included in the index.html file itself.
3+
Working Demonstration:
4+
5+
6+
https://github.com/urjabahad/Javascript-Projects/assets/127567639/c109278a-cc5d-4102-b767-6f4736ea1d25
7+

EmojiGenerator/index.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
<title>Emoji Generator</title>
7+
</head>
8+
<body>
9+
<style>
10+
*{
11+
margin: 0;
12+
padding: 0;
13+
}
14+
body{
15+
display: flex;
16+
justify-content: center;
17+
align-items: center;
18+
height: 100vh;
19+
flex-direction: column;
20+
background-color: darkseagreen;
21+
}
22+
#emoji{
23+
font-size: 15rem;
24+
transition-duration: 200ms;
25+
filter: grayscale(1);
26+
cursor: pointer;
27+
}
28+
#emoji:hover{
29+
filter: grayscale(0);
30+
}
31+
</style>
32+
<div id="emoji">😃</div>
33+
<script src="script.js"></script>
34+
</body>
35+
</html>

EmojiGenerator/script.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const btn=document.querySelector("#emoji");
2+
const emojis = [
3+
"😄", "😁", "😆", "😅", "😂", "🤣", "😊", "😇", "🙂", "🙃", "😉", "😌", "😍",
4+
"🥰", "😘", "😗", "😙", "😚", "😋", "😛", "😝", "😜", "🤪", "🤨", "🧐", "🤓", "😎", "🤩",
5+
"🥳", "😏", "😒", "😞", "😔", "😟", "😕", "🙁", "☹️", "😣", "😖", "😫", "😩"
6+
];
7+
btn.addEventListener("mouseover",()=>{
8+
btn.innerHTML=emojis[Math.floor(Math.random()*emojis.length)];
9+
})

0 commit comments

Comments
 (0)