Skip to content

Commit 37e96b5

Browse files
committed
Update README
1 parent 0314c90 commit 37e96b5

File tree

4 files changed

+76
-1
lines changed

4 files changed

+76
-1
lines changed

Password-generator/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Random Password Generator
2+
3+
**A simple and fun project that generates secure random passwords using HTML, CSS, and JavaScript.**
4+
This project allows users to create customized passwords based on selected criteria.
5+
6+
![Password Generator](img.png)
7+
8+
## Features
9+
- **Customizable Password Generation**: Specify the length and character types (uppercase, lowercase, numbers, and symbols) for the password.
10+
- **Dynamic Content**: The generated password is displayed instantly upon creation.
11+
- **Clipboard Functionality**: Easily copy the generated password to your clipboard with a button click.
12+
- **Error Handling**: Alerts the user if there is an attempt to copy an empty password.
13+
14+
## Description
15+
This project provides a user-friendly interface for generating secure passwords. Users can select options for password length and desired character types, including:
16+
- Lowercase letters
17+
- Uppercase letters
18+
- Numbers
19+
- Symbols
20+
- Text
21+
22+
Upon clicking the "Generate Password" button, a new password is created based on the selected options and displayed on the screen. Users can also copy the generated password to their clipboard with a dedicated button, receiving confirmation via an alert.
23+
24+
The project uses:
25+
- **HTML** for structure
26+
- **CSS** for styling and layout
27+
- **JavaScript** for password generation logic and user interaction management
28+
29+
## Prerequisites
30+
Before running this project, ensure you have a basic understanding of the following technologies:
31+
- **HTML**: For structuring the user interface of the password generator.
32+
- **CSS**: For styling the interface and providing an appealing layout.
33+
- **JavaScript**: For handling password generation and user interactions.
34+
35+
## How to Use
36+
1. Open the `index.html` file in your web browser.
37+
2. Select the desired password length and the types of characters to include.
38+
3. Click the "Generate Password" button to create a new password.
39+
4. The generated password will be displayed on the screen.
40+
5. Click the "Copy to Clipboard" button to copy the password. An alert will confirm the action.
41+
6. If no character types are selected, a default password will be generated based on the specified length.
42+
43+
## Installation
44+
To run this project locally:
45+
1. Clone the repository or download the files.
46+
2. Open `index.html` in any web browser.
47+
48+
### Installation Instructions
49+
1. Clone the repository:
50+
```bash
51+
git clone https://github.com/yourusername/password-generator.git
52+
```
53+
2. Navigate to the project directory:
54+
```bash
55+
cd password-generator
56+
```
57+
3. Open `index.html` in a web browser.
58+
59+
## Author
60+
- Basset Gaëtan (@[gbasset](https://github.com/gbasset))

Password-generator/img.png

51.8 KB
Loading

Password-generator/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ clipboardBtn.addEventListener('click', () => {
1919
const password = resultEl.innerText
2020
if (!password) return
2121
navigator.clipboard.writeText(password)
22+
resultEl.classList.add('copied')
2223
})
2324

2425
generateEl.addEventListener('click', () => {
@@ -30,6 +31,7 @@ generateEl.addEventListener('click', () => {
3031
const text = textEl.value
3132

3233
resultEl.innerText = generatePassword(hasLower, hasUpper, hasNumber, hasSymbol, text, length)
34+
clipboardBtn.classList.add('visible')
3335
})
3436

3537
function generatePassword(lower, upper, number, symbol, text, length) {
@@ -49,7 +51,7 @@ function generatePassword(lower, upper, number, symbol, text, length) {
4951
})
5052
}
5153

52-
54+
resultEl.classList.remove('copied')
5355
return generatedPassword.slice(0, length)
5456
}
5557

Password-generator/style.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ body{
1212
font-size: 30px;
1313
font-weight: bold;
1414
}
15+
16+
17+
1518
.input_class {
1619
border: 0;
1720
outline: 0;
@@ -46,6 +49,16 @@ h1, h2 {
4649
}
4750
#clipboard{
4851
opacity: 0;
52+
display: flex;
53+
width: 20%;
54+
margin: 10px auto;
55+
text-align: center;
56+
}
57+
#result.copied{
58+
color: #0bfb68;
59+
}
60+
#clipboard.visible {
61+
opacity: 1;
4962
}
5063

5164
.settings{

0 commit comments

Comments
 (0)