Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added random emoji generator made using HTML, CSS and Javascript #16

Merged
merged 5 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)];
})