Skip to content

Commit 4e9d79e

Browse files
Merge pull request #409 from iamrahulmahato/randgen
Random jokes Generator
2 parents 4d50d68 + 35e693e commit 4e9d79e

File tree

6 files changed

+158
-0
lines changed

6 files changed

+158
-0
lines changed

Random Jokes Generator/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<p align="center">
2+
<img alt="" height="80" src="./img/256px-Icon-notepad.svg.png">
3+
</a>
4+
</p>
5+
<h1 align="center">Random Jokes Generator</h1>
6+
7+
<div align="center">
8+
Every click get you a joke
9+
</div>
10+
11+
12+
13+
## Description:
14+
15+
Random Jokes Generator will generate a random joke in every click
16+
---
17+
18+
## Tech Stack Used:
19+
HTML5,CSS3,JavaScript
20+
21+
---
22+
23+
## It Look's Like:
24+
25+
![image](./img/Screenshot%202022-05-30%20100612.png)
26+
27+
---
28+
29+
30+
## **Quick Start**
31+
- Clone this repository
32+
33+
```
34+
git clone https://github.com/Dezenix/frontend-html-css-js
35+
```
36+
- Change Directory
37+
38+
```
39+
cd Change Random Jokes Generator
40+
```
41+
42+
```
43+
cd index.html
44+
```
45+
> open ```index.html``` file in your default Browser.
46+
---
47+
## **Installation and Dependencies**
48+
- Install any Code Editors like : VS Code, Atom, etc.
49+
- Then follow the ```Quick Start``` steps given above and open the
50+
Change Random Jokes Generator in your Code Editor.
51+
- Then open ```index.html``` file then edit and save it .

Random Jokes Generator/css/style.css

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@import url(https://fonts.googleapis.com/css?family=Poppins:100,100italic,200,200italic,300,300italic,regular,italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic);
2+
* {
3+
margin: 0;
4+
padding: 0;
5+
box-sizing: border-box;
6+
font-family: 'Poppins', sans-serif;
7+
}
8+
9+
body {
10+
display: grid;
11+
place-items: center;
12+
min-height: 100vh;
13+
background-color: #000;
14+
}
15+
16+
.container {
17+
max-width: 800px;
18+
width: 90vw;
19+
background-color: #151515;
20+
padding: 3rem;
21+
border-radius: 1rem;
22+
box-shadow: 0 0 .3rem .2rem rgba(255, 255, 255, .3);
23+
}
24+
25+
p {
26+
color: #ffae43;
27+
font-size: 1.2rem;
28+
margin-bottom: 2rem;
29+
}
30+
31+
button {
32+
background-color: #ffae43;
33+
border: 2px solid transparent;
34+
padding: .5rem 2rem;
35+
font-size: 1.2rem;
36+
color: #151515;
37+
font-weight: 500;
38+
border-radius: 100vw;
39+
cursor: pointer;
40+
user-select: none;
41+
transition: 200ms ease-in-out background-color, 200ms ease-in-out border-color, 200ms ease-in-out color;
42+
}
43+
44+
button:hover {
45+
border-color: #ffae43;
46+
background-color: #151515;
47+
color: #ffae43;
48+
}
49+
50+
button:active {
51+
transform: scale(.93);
52+
}
18.6 KB
Loading
26.1 KB
Loading

Random Jokes Generator/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<link rel="stylesheet" href="./css/style.css">
9+
<title>Random Jokes Generator</title>
10+
</head>
11+
12+
<body>
13+
<div class="container">
14+
<p>Joke will be shown here...</p>
15+
<button>Generate a Joke</button>
16+
</div>
17+
<script src="./js/script.js"></script>
18+
</body>
19+
20+
</html>

Random Jokes Generator/js/script.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const jokesArr = [
2+
`"I'm afraid for the calendar. Its days are numbered."`,
3+
`"My wife said I should do lunges to stay in shape. That would be a big step forward."`,
4+
`"Why do fathers take an extra pair of socks when they go golfing?" "In case they get a hole in one!"`,
5+
`"Singing in the shower is fun until you get soap in your mouth. Then it's a soap opera."`,
6+
`"What do a tick and the Eiffel Tower have in common?" "They're both Paris sites."`,
7+
`"What do you call a fish wearing a bowtie?" "Sofishticated."`,
8+
`"How do you follow Will Smith in the snow?" "You follow the fresh prints."`,
9+
`"If April showers bring May flowers, what do May flowers bring?" "Pilgrims."`,
10+
`"I thought the dryer was shrinking my clothes. Turns out it was the refrigerator all along."`,
11+
`"What did the ocean say to the beach? Nothing, it just waved."`,
12+
`"Dear Math, grow up and solve your own problems."`,
13+
`"What did the janitor say when he jumped out of the closet?" "Supplies!"`,
14+
`"Have you heard about the chocolate record player? It sounds pretty sweet."`,
15+
`"Why do seagulls fly over the ocean?" "Because if they flew over the bay, we'd call them bagels."`,
16+
`"I only know 25 letters of the alphabet. I don't know y."`,
17+
`"How does the moon cut his hair?" "Eclipse it."`,
18+
`"What did one wall say to the other?" "I'll meet you at the corner."`,
19+
`"What did the zero say to the eight?" "That belt looks good on you."`,
20+
`"Where do fruits go on vacation?" "Pear-is!"`,
21+
`"I asked my dog what's two minus two. He said nothing."`,
22+
`"What did Baby Corn say to Mama Corn?" "Where's Pop Corn?"`,
23+
`"What's the best thing about Switzerland?" "I don't know, but the flag is a big plus."`,
24+
`"What does a sprinter eat before a race?" "Nothing, they fast!"`,
25+
`"What has more letters than the alphabet?" "The post office!"`,
26+
`"Dad, did you get a haircut?" "No, I got them all cut!"`,
27+
`"I don't trust stairs. They're always up to something."`
28+
]
29+
const button = document.querySelector('button')
30+
const pEl = document.querySelector('p')
31+
32+
button.addEventListener('click', () => {
33+
let random = Math.floor(Math.random() * jokesArr.length)
34+
pEl.innerText = jokesArr[random]
35+
})

0 commit comments

Comments
 (0)