-
Notifications
You must be signed in to change notification settings - Fork 3
/
popup.html
65 lines (61 loc) · 2.04 KB
/
popup.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NPC Comment Blocker</title>
<!-- Font Awesome CDN for icons -->
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
/>
<!-- Link to external CSS -->
<link rel="stylesheet" href="/popup.css" />
</head>
<body>
<div class="container">
<h1>NPC Comment Blocker</h1>
<input
type="text"
id="keywords"
placeholder="What should the comment be replaced with?"
/>
<button id="save">Save Replace Text</button>
<div class="toggle-container">
<label for="replace-toggle">Replace Comments Instead</label>
<input type="checkbox" id="replace-toggle" />
</div>
<!-- Box around Extension On/Off Toggle -->
<div class="extension-box">
<div class="toggle-container">
<label for="extension-toggle">Extension On/Off</label>
<label class="toggle-switch">
<input type="checkbox" id="extension-toggle" />
<span class="slider"></span>
</label>
</div>
</div>
<div class="refresh-container" id="reload">
<i class="fas fa-sync-alt"></i>
<p>Reload to apply</p>
</div>
</div>
<script>
// Refresh the page when the "Reload to apply" is clicked
document.getElementById('reload').addEventListener('click', function () {
location.reload();
});
// Logic to toggle the extension on/off
const extensionToggle = document.getElementById('extension-toggle');
extensionToggle.addEventListener('change', function () {
if (extensionToggle.checked) {
console.log('Extension is ON');
// Add your logic to enable the extension here
} else {
console.log('Extension is OFF');
// Add your logic to disable the extension here
}
});
</script>
</body>
</html>