Skip to content

Commit

Permalink
PR #16: Random-Emoji-Generator
Browse files Browse the repository at this point in the history
Added random emoji generator made using HTML, CSS and Javascript
Merge pull request #16 from urjabahad/main
  • Loading branch information
iamwatchdogs authored Oct 31, 2023
2 parents 4f40fdf + e50200f commit 668b9dc
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
7 changes: 7 additions & 0 deletions EmojiGenerator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This random emoji generator is made using HTML, CSS and Javascript.
CSS styling and JS is included in the index.html file itself.
Working Demonstration:


https://github.com/urjabahad/Javascript-Projects/assets/127567639/c109278a-cc5d-4102-b767-6f4736ea1d25

35 changes: 35 additions & 0 deletions EmojiGenerator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Emoji Generator</title>
</head>
<body>
<style>
*{
margin: 0;
padding: 0;
}
body{
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
flex-direction: column;
background-color: darkseagreen;
}
#emoji{
font-size: 15rem;
transition-duration: 200ms;
filter: grayscale(1);
cursor: pointer;
}
#emoji:hover{
filter: grayscale(0);
}
</style>
<div id="emoji">😃</div>
<script src="script.js"></script>
</body>
</html>
9 changes: 9 additions & 0 deletions EmojiGenerator/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const btn=document.querySelector("#emoji");
const emojis = [
"😄", "😁", "😆", "😅", "😂", "🤣", "😊", "😇", "🙂", "🙃", "😉", "😌", "😍",
"🥰", "😘", "😗", "😙", "😚", "😋", "😛", "😝", "😜", "🤪", "🤨", "🧐", "🤓", "😎", "🤩",
"🥳", "😏", "😒", "😞", "😔", "😟", "😕", "🙁", "☹️", "😣", "😖", "😫", "😩"
];
btn.addEventListener("mouseover",()=>{
btn.innerHTML=emojis[Math.floor(Math.random()*emojis.length)];
})

0 comments on commit 668b9dc

Please sign in to comment.