-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #320 from kartikmehta18/kartik
Kartik
- Loading branch information
Showing
5 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Random Jokes API | ||
Welcome to the Joke Generator API! This API offers an innovative approach to accessing an this api is use for the generating random joke and which helps for bigger to learn the concept or how to use api | ||
|
||
## Features | ||
- **Get Random Jokes:** By usinf this api you get random jokes. | ||
## Technologies Used | ||
- HTML | ||
- CSS | ||
- JavaScript | ||
- API ( for fetching data ) | ||
|
||
# API Integration | ||
This application uses `https://v2.jokeapi.dev/joke/Any?blacklistFlags=nsfw,religious,political,racist,sexist,explicit&type=single` to fetch the data. | ||
|
||
## Installation | ||
To set up the Dictionary API locally, follow these steps: | ||
|
||
- Clone the repository | ||
- Switch to Existing_API_Collection folder `cd Existing_API_Collection` | ||
- Now switch to CountryAPI folder `cd Jokegenerator_API` | ||
- Run command `.\/index.html` | ||
|
||
## Screenshots | ||
![Screenshot (395)](![alt text](image.png)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="style.css" > | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
|
||
<div class="wrapper"> | ||
<span>😂</span> | ||
<p id="joke"> | ||
hiiiiiiiiii | ||
</p> | ||
<button id="btn" onclick="getJoke()">Get Joke</button> | ||
</div> | ||
|
||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const jokeContainer = document.getElementById("joke"); | ||
const btn = document.getElementById("btn"); | ||
const url = "https://v2.jokeapi.dev/joke/Any?blacklistFlags=nsfw,religious,political,racist,sexist,explicit&type=single"; | ||
|
||
let getJoke = () => { | ||
jokeContainer.classList.remove("fade"); | ||
fetch(url) | ||
.then(data => data.json()) | ||
.then(item =>{ | ||
jokeContainer.textContent = `${item.joke}`; | ||
jokeContainer.classList.add("fade"); | ||
}); | ||
} | ||
|
||
getJoke(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
*{ padding: 0; | ||
margin: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
body{ | ||
background-color: rgb(63, 182, 238); | ||
} | ||
.wrapper{ | ||
width: 80vmin; | ||
padding: 50px 40px; | ||
background-color: rgb(22, 22, 22); | ||
position: absolute; | ||
transform: translate(-50%, -50%); | ||
top:50%; | ||
left: 50%; | ||
border-radius:5px; | ||
box-shadow: rgba(184, 185, 185, 0.385) 20px 20px 40px ; | ||
} | ||
span{ | ||
display: block; | ||
text-align: center; | ||
font-size: 100px; | ||
} | ||
|
||
p{ | ||
font-size: 16px; | ||
color: white; | ||
font-weight: 400; | ||
text-align: center; | ||
word-break: break-word; | ||
line-height: 35px; | ||
margin: 30px; | ||
|
||
} | ||
button{ | ||
|
||
display: block; | ||
background-color:rgb(63, 182, 238) ; | ||
border: none; | ||
padding:15px ; | ||
color: aliceblue; | ||
border-radius: 4px; | ||
font-size: 18px; | ||
font-weight: 600; | ||
padding: 12px 25px; | ||
margin:0 auto; | ||
cursor: pointer; | ||
|
||
} | ||
button:hover{ | ||
color: black; | ||
background-color: rgb(255, 153, 0); | ||
} |