This repository was archived by the owner on Feb 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
103 lines (98 loc) · 5.1 KB
/
script.js
File metadata and controls
103 lines (98 loc) · 5.1 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
var first_integer = ""
var random_numbers_cycles = ["8","9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]
var how_many_cycles = parseInt(random_numbers_cycles[Math.floor(Math.random() * 13)]);
console.log(how_many_cycles);
cycle_passed = 0;
function end(){
// get_password_chosen_input.value = first_integer.slice(0, 9);
console.log("Program Ended")
}
function createPassword(first_integer){
var get_password_chosen_input = document.getElementById("password_chosen_input")
var integers = "ABCDEFGRSTUVWXYZabcdefghiIJKLMjklm6nopqHNOPQrstuvwxyz!@#$%^&*(){}[]\|:;'<>,.?/`~123457890"
// console.log(integers.length)
var first_integer_number = Math.floor(Math.random() * integers.length)
var random_num = integers[first_integer_number]
var first_integer = first_integer + String(random_num)
get_password_chosen_input.value = first_integer.slice(9,9+how_many_cycles)
//undefined - 9 charecters 9 + random length
// get_password_chosen_input.value =
// console.log(cycle_passed)
console.log(first_integer)
cycle_passed = cycle_passed + 1
if (cycle_passed == how_many_cycles){
end()
}
else{
createPassword(first_integer)
}
}
createPassword()
function resetTheAnimation(id) {
document.getElementById(id).style="visibility: hidden;"
}
function fadeOutAnimation(id) {
function timeoutTemp(){
resetTheAnimation(id)
}
document.getElementById(id).style="animation: fadeOutAnimation ease 0.5s;"
setTimeout(timeoutTemp, 500)
}
var letters = "abcdefghijklmnopqrstuvwxyz23468"
var random_numbers_cycles = ["8","9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"]
let scamEmailSubjects = ["Your account has been compromised!", "Immediate action required: Verify your account now", "You’ve won a $1000 gift card!", "Claim your free iPhone today!", "Your payment is overdue!", "You owe the IRS $5000"]
let realEmailSubjects = ["Your account has been successfully updated", "Your subscription is about to renew", "Account verification required: Please confirm your email address"]
var realEmailList = ["me@yahoo.com", "person@google.com", "help@openai.com"]
var correctAns
function expandOversizedMenu() {
document.getElementById("navbarText").classList.toggle("showResizeMenu")
}
function onStartup(){
console.log("onStartup()")
let subject
let randNum = Math.floor(Math.random() * 2) + 1;
if(randNum ==1){
subject = scamEmailSubjects[Math.floor(Math.random()*scamEmailSubjects.length)]
let fakeEmail = ""
let randCycle = random_numbers_cycles[Math.floor(Math.random()*random_numbers_cycles.length)]
randCycle = parseInt(randCycle)
// if (randNum == 1){
console.log(fakeEmail)
console.log(document.getElementById("question"))
console.log(randCycle)
for (let i = 0; i == randCycle; i++) {
fakeEmail = String(fakeEmail)
fakeEmail = fakeEmail + letters[Math.floor(Math.random()*letters.length)]
console.log(fakeEmail)
console.log(randCycle)
console.log(555)
}
fakeEmailEnding = letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)];
fakeEmail = String(fakeEmail)+"@"+String(fakeEmailEnding)
fakeEmailEnding = letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)];
fakeEmail = fakeEmailEnding + fakeEmail
fakeEmailEnding = letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)]+letters[Math.floor(Math.random()*letters.length)];
fakeEmail = fakeEmail + fakeEmailEnding + ".com"
document.getElementById("question").innerHTML = String(fakeEmail)
correctAns = 1
}
else{
subject = realEmailSubjects[Math.floor(Math.random()*realEmailSubjects.length)]
realEmail = realEmailList[Math.floor(Math.random() * realEmailList.length)]
document.getElementById("question").innerHTML = String(realEmail)
correctAns = 2
}
document.getElementById("subject").innerText = subject
}
function answered(el){
if(el.id == String(correctAns)){
document.getElementById("feedback").style.visibility = "visible"
fadeOutAnimation("feedback")
}
else{
document.getElementById("feedbackInc").style.visibility = "visible"
fadeOutAnimation("feedbackInc")
}
onStartup()
}
onStartup()