-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4940de
commit a8dd9ac
Showing
5 changed files
with
104 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,22 @@ | ||
# Random Number Generator | ||
|
||
This is a simple Random Number Generator built using HTML, CSS, and JavaScript. | ||
|
||
## Features | ||
|
||
- Generates a random number between 1 and 100. | ||
- Attractive blue-themed design. | ||
- Responsive and centered layout. | ||
|
||
## How to Use | ||
|
||
1. Clone the repository or download the files. | ||
2. Open the `index.html` file in your web browser. | ||
3. Click the "Generate Number" button to see a random number displayed. | ||
|
||
## File Structure | ||
|
||
- `index.html`: The main HTML file. | ||
- `styles.css`: The CSS file for styling the page. | ||
- `script.js`: The JavaScript file containing the logic for generating a random number. | ||
|
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,18 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Random Number Generator</title> | ||
<link rel="stylesheet" href="styles.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>Random Number Generator</h1> | ||
<p>Click the button to generate a random number.</p> | ||
<button onclick="generateRandomNumber()">Generate Number</button> | ||
<div id="result"></div> | ||
</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,4 @@ | ||
function generateRandomNumber() { | ||
const randomNumber = Math.floor(Math.random() * 100) + 1; | ||
document.getElementById('result').innerText = 'Random Number: ' + randomNumber; | ||
} |
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,46 @@ | ||
body { | ||
background-color: #e0f7fa; | ||
font-family: Arial, sans-serif; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
margin: 0; | ||
} | ||
|
||
.container { | ||
text-align: center; | ||
background-color: #0288d1; | ||
padding: 20px; | ||
border-radius: 10px; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
color: #fff; | ||
} | ||
|
||
h1 { | ||
margin: 0 0 20px; | ||
} | ||
|
||
button { | ||
background-color: #0277bd; | ||
border: none; | ||
color: white; | ||
padding: 15px 32px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 16px; | ||
margin: 10px 0; | ||
cursor: pointer; | ||
border-radius: 5px; | ||
} | ||
|
||
button:hover { | ||
background-color: #01579b; | ||
} | ||
|
||
#result { | ||
margin-top: 20px; | ||
font-size: 24px; | ||
font-weight: bold; | ||
} |
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