-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.html
More file actions
182 lines (160 loc) · 5.9 KB
/
1.html
File metadata and controls
182 lines (160 loc) · 5.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Neumorphism Password generator</title>
<link rel="stylesheet" href="style.css">
<style>
nav {
display: flex;
justify-content: flex-end;
padding: 20px 24px;
}
.navbtn {
position: absolute;
left: 2rem;
margin-top: 0.3rem;
}
.theme-switch-wrapper {
display: flex;
align-items: center;
}
.theme-switch-wrapper em {
margin-left: 10px;
font-size: 1rem;
}
.theme-switch {
display: inline-block;
height: 34px;
position: relative;
width: 60px;
}
.theme-switch input {
display: none;
}
.slider {
background-color: var(--togglebg);
bottom: 0;
cursor: pointer;
left: 0;
position: absolute;
right: 0;
top: 0;
transition: 0.4s;
}
.slider:before {
background-color: var(--roundcolor);
bottom: 4px;
content: "";
height: 26px;
left: 4px;
position: absolute;
transition: 0.4s;
width: 26px;
}
input:checked+.slider {
background-color: var(--toggleslider);
}
input:checked+.slider:before {
transform: translateX(26px);
}
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
em {
color: var(--togglesliderColor);
}
</style>
</head>
<body>
<nav>
<!-- <div class="navbtn">
<a class="github-button" href="https://github.com/smthari/Password-generator-using-html-css-javascript/fork"
data-color-scheme="no-preference: dark; light: light; dark: dark;" data-icon="octicon-repo-forked"
data-size="large" data-show-count="true"
aria-label="Fork smthari/Password-generator-using-html-css-javascript on GitHub">Fork</a>
<a class="github-button" href="https://github.com/smthari/Password-generator-using-html-css-javascript"
data-color-scheme="no-preference: dark; light: light; dark: dark;" data-icon="octicon-star"
data-size="large" data-show-count="true"
aria-label="Star smthari/Password-generator-using-html-css-javascript on GitHub">Star</a>
<a class="github-button" href="https://github.com/smthari"
data-color-scheme="no-preference: dark; light: light; dark: dark;" data-size="large"
data-show-count="true" aria-label="Follow @smthari on GitHub">Follow @smthari</a>
</div> -->
<div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox" />
<div class="slider round"></div>
</label>
<em>Switch Theme</em>
</div>
</nav>
<div class="container">
<h2>Password Generator</h2>
<div class="result-container">
<textarea id="PasswordResult"></textarea>
</div>
<div class="settings">
<div class="setting">
<label>Password length</label>
<input type="number" id="Passwordlength" min="4" max="20" value="8" />
</div>
<div class="setting">
<label>Include uppercase letters</label>
<input type="checkbox" id="uppercase" checked />
</div>
<div class="setting">
<label>Include lowercase letters</label>
<input type="checkbox" id="lowercase" checked />
</div>
<div class="setting">
<label>Include numbers</label>
<input type="checkbox" id="numbers" checked />
</div>
<div class="setting">
<label>Include symbols</label>
<input type="checkbox" id="symbols" checked />
</div>
</div>
<div class="buttons">
<button class="btn btn-large" id="generateBtn">
<i class="fas fa-key"></i> Genrate
</button>
<button class="btn" id="clipboardBtn">
<i class="far fa-clipboard"></i> Copy
</button>
</div>
</div>
<script src="script.js"></script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<script src="https://kit.fontawesome.com/dd8c49730d.js" crossorigin="anonymous"></script>
<script>
/* dark mode toggle */
const toggleSwitch = document.querySelector(
'.theme-switch input[type="checkbox"]'
);
const currentTheme = localStorage.getItem("theme");
if (currentTheme) {
document.documentElement.setAttribute("data-theme", currentTheme);
if (currentTheme === "dark") {
toggleSwitch.checked = true;
}
}
function switchTheme(e) {
if (e.target.checked) {
document.documentElement.setAttribute("data-theme", "dark");
localStorage.setItem("theme", "dark");
} else {
document.documentElement.setAttribute("data-theme", "light");
localStorage.setItem("theme", "light");
}
}
toggleSwitch.addEventListener("change", switchTheme, false);
</script>
</body>
</html>