-
Couldn't load subscription status.
- Fork 1.6k
Added jock app #935
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
Open
Open
Added jock app #935
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
39 changes: 39 additions & 0 deletions
joke app/README.md
This file contains hidden or 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,39 @@ | ||
| # Random Joke Generator | ||
|
|
||
| A tiny, beautiful Random Joke Generator built with HTML, CSS and a small client-side JavaScript fetch call. | ||
|
|
||
| This mini project shows a single-page app that fetches a random joke from the "Official Joke API" and displays it with a simple glassmorphism UI. | ||
|
|
||
| ## Features | ||
|
|
||
| - Click a button to fetch and display a random joke (setup + punchline). | ||
| - Lightweight: no build tools or server required — just a browser. | ||
| - Responsive layout and simple animations. | ||
|
|
||
| ## Files | ||
|
|
||
| - `index.html` — the single HTML page. Contains the UI and the small `fetchJoke()` script. | ||
| - `style.css` — styling (glassmorphism effect, responsive rules, and animations). | ||
|
|
||
| ## How to run | ||
|
|
||
| 1. Clone or download the repository to your machine. | ||
| 2. Open `index.html` in a modern browser (Chrome, Edge, Firefox, Safari). | ||
|
|
||
| No installation is required. The app uses the public "Official Joke API" endpoint: | ||
|
|
||
| ``` | ||
| https://official-joke-api.appspot.com/random_joke | ||
| ``` | ||
| if you use VS code then live server will work. | ||
| here are some images for reference | ||
|  | ||
|  | ||
| ## Notes & Troubleshooting | ||
|
|
||
| - The app fetches jokes from a public API. If the API is down or rate-limited, the button may fail silently — try refreshing the page or check the browser console for fetch errors. | ||
| - If you need to support older browsers, consider adding a small fallback or polyfill for `fetch`. | ||
|
|
||
| --- | ||
|
|
||
| Enjoy the jokes! 😄 |
Binary file added
joke app/images/image.png
Binary file added
joke app/images/image1.png
25 changes: 25 additions & 0 deletions
joke app/index.html
This file contains hidden or 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,25 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>JOKE</title> | ||
| <link rel="stylesheet" href="style.css"> | ||
| </head> | ||
| <body> | ||
| <div class="joke-container"> | ||
| <h2>Random Joke Generator</h2> | ||
| <p id="joke">Click the button for a joke!</p> | ||
| <button onclick="fetchJoke()">😂 Get Joke</button> | ||
| </div> | ||
|
|
||
| <script> | ||
| async function fetchJoke() { | ||
| let response = await fetch("https://official-joke-api.appspot.com/random_joke"); | ||
| let data = await response.json(); | ||
|
|
||
| document.getElementById("joke").textContent = `${data.setup} - ${data.punchline}`; | ||
| } | ||
| </script> | ||
| </body> | ||
| </html> |
112 changes: 112 additions & 0 deletions
joke app/style.css
This file contains hidden or 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,112 @@ | ||
| /* Global Styles */ | ||
| body { | ||
| font-family: 'Poppins', sans-serif; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| height: 100vh; | ||
| background: linear-gradient(135deg, #f0f0f0, #d9d9d9); | ||
| background-size: 400% 400%; | ||
| margin: 0; | ||
| } | ||
|
|
||
| /* Joke Container with Glassmorphism Effect */ | ||
| .joke-container { | ||
| background: rgba(255, 255, 255, 0.1); | ||
| backdrop-filter: blur(10px); | ||
| -webkit-backdrop-filter: blur(10px); | ||
| padding: 30px; | ||
| border-radius: 15px; | ||
| box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.3); | ||
| text-align: center; | ||
| width: 400px; | ||
| color: black; | ||
| } | ||
|
|
||
| /* Title */ | ||
| h2 { | ||
| font-size: 24px; | ||
| margin-bottom: 15px; | ||
| } | ||
|
|
||
| /* Joke Text */ | ||
| #joke { | ||
| font-size: 18px; | ||
| font-weight: bold; | ||
| margin-bottom: 20px; | ||
| color: black; | ||
| } | ||
|
|
||
| /* Fetch Button */ | ||
| button { | ||
| padding: 12px; | ||
| background: rgba(255, 255, 255); | ||
| border: solid 2px black; | ||
| border-radius: 10px; | ||
| cursor: pointer; | ||
| font-size: 18px; | ||
| transition: 0.3s ease-in-out; | ||
| color: black; | ||
| } | ||
|
|
||
| button:hover { | ||
| color: white; | ||
| background: rgba(0, 0, 0, 0.5); | ||
| } | ||
|
|
||
| /* Smooth Fade-in Animation */ | ||
| .joke-container { | ||
| animation: fadeIn 0.8s ease-in-out; | ||
| } | ||
|
|
||
| @keyframes fadeIn { | ||
| from { | ||
| opacity: 0; | ||
| transform: scale(0.9); | ||
| } | ||
| to { | ||
| opacity: 1; | ||
| transform: scale(1); | ||
| } | ||
| } | ||
|
|
||
| /* Responsive Adjustments */ | ||
| @media screen and (max-width: 768px) { | ||
| .joke-container { | ||
| width: 90%; | ||
| padding: 20px; | ||
| } | ||
|
|
||
| h2 { | ||
| font-size: 20px; | ||
| } | ||
|
|
||
| #joke { | ||
| font-size: 16px; | ||
| } | ||
|
|
||
| button { | ||
| font-size: 16px; | ||
| padding: 10px; | ||
| } | ||
| } | ||
|
|
||
| @media screen and (max-width: 480px) { | ||
| .joke-container { | ||
| width: 95%; | ||
| padding: 15px; | ||
| } | ||
|
|
||
| h2 { | ||
| font-size: 18px; | ||
| } | ||
|
|
||
| #joke { | ||
| font-size: 14px; | ||
| } | ||
|
|
||
| button { | ||
| font-size: 14px; | ||
| padding: 8px; | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.