Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e125d46

Browse files
pass generator part one
1 parent 6e02075 commit e125d46

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

‎day18/STARTER-FILES/app.js

Whitespace-only changes.

‎day18/STARTER-FILES/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
</div>
6060

6161
</div>
62-
<script src="app.js"></script>
62+
<script src="/day18/app.js"></script>
6363
</body>
6464

6565
</html>

‎day18/app.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
const passwordInput = document.getElementById("password");
2+
3+
const passwordLength = document.querySelector("#length");
4+
const selectSymbols = document.querySelector("#symbols");
5+
const selectNumbers = document.querySelector("#numbers");
6+
const selectLowerCase = document.querySelector("#lowercase");
7+
const selectUpperCase = document.querySelector("#uppercase");
8+
const selectSimilar = document.querySelector("#similar");
9+
10+
const newPasswordArr = [];
11+
12+
passwordInput.onkeydown = showSymbol;
13+
14+
function showSymbol(e) {
15+
console.log(getRandomFromChartCode(10, 48));
16+
17+
// console.log(String.fromCharCode(getRandomNumber()));
18+
}
19+
20+
function getRandomLower() {
21+
return Math.floor(Math.random() * 26) + 97;
22+
} // 26, 97
23+
24+
function getRandomUpper() {
25+
return Math.floor(Math.random() * 26) + 65;
26+
} // 26, 65
27+
28+
function getRandomSymbol() {
29+
return Math.floor(Math.random() * 15) + 33;
30+
} // 15, 33
31+
32+
function getRandomNumber() {
33+
return Math.floor(Math.random() * 10) + 48;
34+
} // 11, 48
35+
36+
function getRandomFromChartCode(quantity, startFrom) {
37+
return String.fromCharCode(Math.floor(Math.random() * quantity) + startFrom);
38+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /