-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
105 lines (102 loc) · 3.33 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en-US">
<style>
h1, h2, h3 {
text-align: center;
margin-right: 50%;
}
h1 {
line-height: 0.7em;
}
td {
text-align: center;
font-weight: 1000;
font-size: 120%;
padding: 0;
-webkit-text-fill-color: transparent;
text-fill-color: transparent;
}
tbody tr td
{
width: 1.125em;
}
</style>
<head style="text-align: center;">
<title>Crash Bandicoot Password Generator (2020 Epic Edition)</title>
<script type="text/javascript" src="pwgen_new.js"></script>
<script type="text/javascript">
function selectGems(selected) {
var inputs = document.querySelectorAll('#gems input');
for (var i = 0; i < inputs.length; ++i)
inputs[i].checked = selected;
}
function makepage() {
var levels = levelDataENG;
for (var i = 0; i < 31; ++i) {
document.getElementById('levelselect').innerHTML += '<option value="'+i+'">'+levels[i].name+'</option>';
}
for (var i = 0; i < 26; ++i) {
for (var l = 0; l < levels.length; ++l) {
if (levels[l].gem != "none" && levels[l].passgemid == i) {
document.getElementById('gems').innerHTML += '<input type="checkbox" id="gem-'+i+'" /><label for="gem-'+i+'" id="gem-'+i+'-text"> Gem '+i+' ('+levels[l].name+')</label><br />';
if (levels[l].gem != "clear") {
document.getElementById('gem-'+i+'-text').style.color = levels[l].gem;
}
}
}
}
generate()
setInterval(generate, 20)
}
var oldlevels = -1, oldkeys = -1, oldgems = -1;
function generate() {
var levels = 0
var keys = 0;
var gems = 0;
levels = Number(document.getElementById('levelselect').selectedOptions[0].value)+1;
for (var i = 0; i < 2; ++i) {
if (document.getElementById('key-'+i).checked) {
keys |= 1 << i;
}
}
for (var i = 0; i < 26; ++i) {
if (document.getElementById('gem-'+i).checked) {
gems |= 1 << i;
}
}
if (levels != oldlevels || keys != oldkeys || gems != oldgems) {
var password = makePassword(levels, keys, gems);
document.getElementById('outcode').innerHTML = stringify(typePassword(password));
oldlevels = levels;
oldkeys = keys;
oldgems = gems;
}
}
</script>
<h1>Crash Bandicoot Password Generator</h1>
<h2>2020 Epic Edition</h2>
<h3>Based on <a href="https://github.com/dezgeg/crash-bandicoot-password-cracking">the original version by dezgeg</a>.</h3>
</head>
<body onload="makepage()">
<label for="levelselect">Select Level: </label><select id="levelselect"></select>
<p></p>
<div id="keys">
<input type="checkbox" id="key-0" /><label for="key-0"> Key 0 (Jaws of Darkness → Fumbling in the Dark)</label><br />
<input type="checkbox" id="key-1" /><label for="key-1"> Key 1 (Sunset Vista → Whole Hog)</label>
</div>
<p></p>
<div id="gems">
</div>
<p></p>
<!-- <button onclick="generate()">Generate</button> -->
<input type="checkbox" id="force-super" onclick="forcesuper = this.checked; oldlevels = -1;" /><label for="force-super"> Force Super Password output</label><br />
<div id="outcode"></div>
<button onclick="selectGems(true)">Select all gems</button>
<button onclick="selectGems(false)">Select no gems</button>
<hr/>
<p>
¹ - "Road to Nowhere and "The High Road" have swapped names in the password screen.<br />
² - "Sunset Vista" and "Slippery Climb" are swapped in NTSC-J.
</p>
</body>
</html>