├── image
├── screenshot.png
├── icons8-twitter-circled-92.png
├── icons8-linkedin.svg
└── icons8-github.svg
├── README.md
├── LICENSE
├── .github
└── workflows
│ └── jekyll-gh-pages.yml
├── script.js
├── style.css
└── index.html
/image/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarshSingh21/Pass--Generator/HEAD/image/screenshot.png
--------------------------------------------------------------------------------
/image/icons8-twitter-circled-92.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HarshSingh21/Pass--Generator/HEAD/image/icons8-twitter-circled-92.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Pass--Generator
2 | A password generator is a software tool that creates random and complex passwords for increased security. It typically uses combination of uppercase and lowercase letters, numbers, and special characters to create complex passwords. The length and complexity of the generated passwords can usually be customized by the user .
3 |
4 |
5 |
6 |
7 | Tech Stack : Html, Css,Javascript
8 |
9 |
10 | 
11 |
12 |
--------------------------------------------------------------------------------
/image/icons8-linkedin.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Harsh Singh
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/image/icons8-github.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.github/workflows/jekyll-gh-pages.yml:
--------------------------------------------------------------------------------
1 | # Sample workflow for building and deploying a Jekyll site to GitHub Pages
2 | name: Deploy Jekyll with GitHub Pages dependencies preinstalled
3 |
4 | on:
5 | # Runs on pushes targeting the default branch
6 | push:
7 | branches: ["main"]
8 |
9 | # Allows you to run this workflow manually from the Actions tab
10 | workflow_dispatch:
11 |
12 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13 | permissions:
14 | contents: read
15 | pages: write
16 | id-token: write
17 |
18 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20 | concurrency:
21 | group: "pages"
22 | cancel-in-progress: false
23 |
24 | jobs:
25 | # Build job
26 | build:
27 | runs-on: ubuntu-latest
28 | steps:
29 | - name: Checkout
30 | uses: actions/checkout@v3
31 | - name: Setup Pages
32 | uses: actions/configure-pages@v3
33 | - name: Build with Jekyll
34 | uses: actions/jekyll-build-pages@v1
35 | with:
36 | source: ./
37 | destination: ./_site
38 | - name: Upload artifact
39 | uses: actions/upload-pages-artifact@v1
40 |
41 | # Deployment job
42 | deploy:
43 | environment:
44 | name: github-pages
45 | url: ${{ steps.deployment.outputs.page_url }}
46 | runs-on: ubuntu-latest
47 | needs: build
48 | steps:
49 | - name: Deploy to GitHub Pages
50 | id: deployment
51 | uses: actions/deploy-pages@v1
52 |
--------------------------------------------------------------------------------
/script.js:
--------------------------------------------------------------------------------
1 | const lengthSlider = document.querySelector(".pass-length input");
2 | const options = document.querySelectorAll(".option input");
3 | const copyIcon = document.querySelector(".input-box span");
4 | const passwordInput = document.querySelector(".input-box input");
5 | const passIndicator = document.querySelector(".pass-indicator");
6 | const generateBtn = document.querySelector(".generate-btn");
7 | const characters = {
8 | lowercase: "abcdefghijklmnopqrstuvwxyz",
9 | uppercase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
10 | numbers: "0123456789",
11 | symbols: "!$%&|[](){}:;.,*+-#@<>~"
12 | }
13 |
14 | const generatePassword = () => {
15 | let staticPassword = "",
16 | randomPassword = "",
17 | excludeDuplicate = false,
18 | passLength = lengthSlider.value;
19 |
20 | options.forEach(option => {
21 | if (option.checked) {
22 | if (option.id !== "exc-duplicate" && option.id !== "spaces") {
23 | staticPassword += characters[option.id];
24 | } else if (option.id === "spaces") {
25 | staticPassword += ` ${staticPassword} `;
26 | } else {
27 | excludeDuplicate = true;
28 | }
29 | }
30 | });
31 |
32 | for (let i = 0; i < passLength; i++) {
33 | let randomChar = staticPassword[Math.floor(Math.random() * staticPassword.length)];
34 | if (excludeDuplicate) {
35 | !randomPassword.includes(randomChar) || randomChar == " " ? randomPassword += randomChar : i--;
36 | } else {
37 | randomPassword += randomChar;
38 | }
39 | }
40 | passwordInput.value = randomPassword;
41 |
42 | }
43 |
44 | const updatePassIndicator = () => {
45 | passIndicator.id = lengthSlider.value <= 8 ? "weak" : lengthSlider.value <= 16 ? "medium" : "strong";
46 | }
47 |
48 | const updateSlider = () => {
49 | document.querySelector(".pass-length span").innerText = lengthSlider.value;
50 | generatePassword();
51 | updatePassIndicator();
52 | }
53 | updateSlider();
54 |
55 | const copyPassword = () => {
56 | navigator.clipboard.writeText(passwordInput.value);
57 | copyIcon.innerText = "check";
58 | copyIcon.style.color = "#4285f4";
59 | setTimeout(() => {
60 | copyIcon.innerText = "copy_all";
61 | copyIcon.style.color = "#707070";
62 | }, 1500);
63 | }
64 |
65 | copyIcon.addEventListener("click", copyPassword);
66 | lengthSlider.addEventListener("input", updateSlider);
67 | generateBtn.addEventListener("click", generatePassword);
68 |
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
2 | *{
3 | margin: 0;
4 |
5 | padding-top: 0px;
6 | padding-right: 0px;
7 | padding-bottom: 0px;
8 | padding-left: 0px;
9 | box-sizing: border-box;
10 | font-family: 'Poppins', sans-serif;
11 | }
12 |
13 | body{
14 | display: flex;
15 | align-items: center;
16 | justify-content: center;
17 | min-height: 100vh;
18 | background: rgb(160,156,226);
19 | background: linear-gradient(90deg, rgba(160,156,226,1) 2%, rgba(238,153,237,1) 47%, rgba(177,127,189,1) 89%, rgba(208,52,207,1) 100%);
20 | }
21 |
22 | .container{
23 | width: 450px;
24 | background: #fff;
25 | border-radius: 8px;
26 | box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
27 | }
28 |
29 | .container h2{
30 | font-weight: 600;
31 | font-size: 1.31rem;
32 | padding: 1rem 1.75rem;
33 | border-bottom: 1px solid #d4dbe5;
34 | }
35 |
36 | .wrapper{
37 | margin: 1.25rem 1.75rem;
38 | }
39 |
40 | .wrapper .input-box{
41 | position: relative;
42 | }
43 |
44 | .input-box input{
45 | width: 100%;
46 | height: 53px;
47 | color: #000;
48 | background: none;
49 | font-size: 1.06rem;
50 | font-weight: 500;
51 | border-radius: 4px;
52 | letter-spacing: 1.4px;
53 | border: 1px solid #aaa;
54 | padding: 0 2.85rem 0 1rem;
55 | }
56 |
57 | .input-box span{
58 | position: absolute;
59 | right: 13px;
60 | cursor: pointer;
61 | line-height: 53px;
62 | color: #707070;
63 | }
64 |
65 | .input-box span:hover{
66 | color: #43A047 !important;
67 | }
68 |
69 | .wrapper .pass-indicator{
70 | width: 100%;
71 | height: 4px;
72 | position: relative;
73 | margin-top: 0.75rem;
74 | border-radius: 25px;
75 | }
76 |
77 | .pass-indicator::before{
78 | position: absolute;
79 | content: "";
80 | height: 100%;
81 | width: 50%;
82 | border-radius: inherit;
83 | transition: width 0.3s ease;
84 | }
85 |
86 | .pass-indicator#weak::before{
87 | width: 20%;
88 | background: #e64a4a;
89 | }
90 |
91 | .pass-indicator#medium::before{
92 | width: 50%;
93 | background: #f1c80b;
94 | }
95 |
96 | .pass-indicator#strong::before{
97 | width: 100%;
98 | background: #43A047;
99 | }
100 |
101 | .wrapper .pass-length{
102 | margin: 1.56rem 0 1.25rem;
103 | }
104 |
105 | .pass-length .details{
106 | display: flex;
107 | justify-content: space-between;
108 | }
109 |
110 | .pass-length input{
111 | width: 100%;
112 | height: 5px;
113 | }
114 |
115 | .pass-settings .options{
116 | display: flex;
117 | list-style: none;
118 | flex-wrap: wrap;
119 | margin-top: 1rem;
120 | }
121 |
122 | .pass-settings .options .option{
123 | display: flex;
124 | align-items: center;
125 | margin-bottom: 1rem;
126 | width: calc(100% / 2);
127 | }
128 |
129 | .options .option:first-child{
130 | pointer-events: none;
131 | }
132 |
133 | .options .option:first-child input{
134 | opacity: 0.7;
135 | }
136 |
137 | .options .option input{
138 | height: 16px;
139 | width: 16px;
140 | cursor: pointer;
141 | }
142 |
143 | .options .option label{
144 | cursor: pointer;
145 | color: #4f4f4f;
146 | padding-left: 0.63rem;
147 | }
148 |
149 | .wrapper .generate-btn{
150 | width: 100%;
151 | color: #fff;
152 | border: none;
153 | outline: none;
154 | cursor: pointer;
155 | background: #43A047;
156 | font-size: 1.06rem;
157 | padding: 0.94rem 0;
158 | border-radius: 5px;
159 | text-transform: uppercase;
160 | margin: 0.94rem 0 1.3rem;
161 | }
162 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |