-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
195 lines (168 loc) · 7.82 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
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
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<meta name="msapplication-TileColor" content="#da532c">
<meta property="og:title" content="BetterCensorship" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<meta property="og:description" content="Censor and decensor images quickly." />
<link rel="stylesheet" href="styles/icomoon.css">
<link rel="stylesheet" href="https://necolas.github.io/normalize.css/8.0.1/normalize.css">
<link rel="stylesheet" href="styles/styles.css">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
<title>BetterCensorship</title>
</head>
<body>
<div class="pageContainer">
<div class="langRight">
<div class="languageSelector">
<span onclick="dropDownFlipper()"></span>
<div class="languageList">
</div>
</div>
</div>
<div class="contentContainer">
<div class="flexContainer d-flex flex-column justify-content-between align-items-center">
<div class="navContainer d-flex">
<div class="censor d-flex flex-column align-items-center" onclick="window.location.assign('censor.html')">
<span class="icon-eye-blocked"></span>
<span class="censorText">
Censor Image
</span>
</div>
<div class="index-divider"></div>
<div class="decensor d-flex flex-column align-items-center" onclick="window.location.assign('decensor.html')">
<span class="icon-eye"></span>
<span class="decensorText">
Decensor Image
</span>
</div>
</div>
<div class="dataContainer">
<div class="dataFlex">
<p class="title">
BetterCensorship
</p>
<span class="content d-flex flex-column align-items-center">
<span>A tool that allows the generation of censored images, with the original image data hidden inside.</span>
<span>Simply use the censorer to generate your image, add a password, and you're off to the races.</span>
<span>To decensor, simply select the image, add in the password and voila, censorship laws bypassed in style!</span>
<span>All of this is done on the client-side, with nothing being uploaded to a backend server. Use this tool worry-free!</span>
<span>Note: This tool isn't magic. Only images censored with this tool, can be decensored by this tool.</span>
</span>
</div>
</div>
</div>
</div>
<footer>
<div class="navLeft">
<div class="navigationContainer ">
<a href="/index.html">Home</a> /
<a href="/censor.html">Censor</a> /
<a href="/decensor.html">Decensor</a> /
<a href="/faq.html">FAQ</a>
</div>
</div>
<div class="versionRight">
<div class="versionContainer">
<span id="versionString">BetterCensorship vX.X.X</span><br>
<span><a href="https://www.patreon.com/BetterRepack">Patreon</a> /
<a href="https://subscribestar.adult/betterrepack">SubscribeStar</a> /
<a href="https://twitter.com/ProjRailgun">Twitter</a>
</span>
</div>
</div>
</footer>
</div>
<script>
let globalVersion = "BetterCensorship v1.1"
$("#versionString").text(globalVersion);
//This is code for the language selector
let configDump, linesetDump;
function getCountryFlag(cc) {
// Mild sanity check.
if (cc.length !== 2)
return cc;
// Convert char to Regional Indicator Symbol Letter
function risl(chr) {
return String.fromCodePoint(0x1F1E6 - 65 + chr.toUpperCase().charCodeAt(0));
}
// Create RISL sequence from country code.
return risl(cc[0]) + risl(cc[1]);
}
function dropDownFlipper() {
let display = $(".languageList").css("display");
if (display === "none") {
display = "block"
} else {
display = "none";
}
$(".languageList").css("display", display);
}
function languageSetter(language) {
localStorage.setItem("lang", language)
location.href = location.href.split("?")[0];
}
$.getJSON("languages/config.json")
.done(langConfigArray=>{
let language;
configDump = langConfigArray;
let setLang = localStorage.getItem("lang");
if (setLang) {
language = setLang
} else {
language = "English"
}
configDump.forEach((item)=>{
if (item["name"] === language || item["country-code"] === language) {
$(".languageSelector span").text(getCountryFlag(item["country-code"]))
$.getJSON(`languages/${item["filename"]}`)
.done(lang=>{
linesetDump = lang[0]["lineset"];
$(".title").text(linesetDump[0]);
$(".censorText").text(linesetDump[1]);
$(".decensorText").text(linesetDump[2]);
$(".content span:nth-child(1)").text(linesetDump[3]);
$(".content span:nth-child(2)").text(linesetDump[4]);
$(".content span:nth-child(3)").text(linesetDump[5]);
$(".content span:nth-child(4)").text(linesetDump[6]);
$(".content span:nth-child(5)").text(linesetDump[7]);
$(".navigationContainer a:nth-child(1)").text(linesetDump[8]);
$(".navigationContainer a:nth-child(2)").text(linesetDump[9]);
$(".navigationContainer a:nth-child(3)").text(linesetDump[10]);
$(".navigationContainer a:nth-child(4)").text(linesetDump[11]);
$(".versionContainer a:nth-child(1)").text(linesetDump[12]);
$(".versionContainer a:nth-child(2)").text(linesetDump[13]);
$(".versionContainer a:nth-child(3)").text(linesetDump[14]);
})
}
$(".languageSelector .languageList").append(
`
<div class="lang-item" title="${item["country-code"]}" onclick="languageSetter('${item["name"]}')">
${getCountryFlag(item["country-code"])}
</div>
`
)
})
//Additional patch for url based language setting
try {
let langCode = window.location.search.substr(1).split("&")[0].split("=")[1]
configDump.forEach((item)=>{
if (item["country-code"] === langCode) {
languageSetter(langCode)
}
})
} catch {
//Catch added to avoid undefined errors.
}
//End patch
})
//This is the end of the code for the language selector
</script>
</body>
</html>