-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
58 lines (49 loc) · 2.04 KB
/
Copy pathscript.js
File metadata and controls
58 lines (49 loc) · 2.04 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
document.addEventListener('DOMContentLoaded', function() {
const settingsIcon = document.getElementById('settingsIcon');
const editIcon = document.getElementById('editIcon');
const lockButton = document.getElementById('lockButton');
const githubButton = document.getElementById('githubButton');
const supportButton = document.getElementById('supportButton');
const aboutButton = document.getElementById('aboutButton');
const sidebar = document.getElementById('sidebar');
const backButton = document.getElementById('backButton'); // Changed to backButton
// Toggle sidebar visibility
settingsIcon.addEventListener('click', function() {
sidebar.classList.toggle('show');
});
// Hide sidebar when clicking outside of it
document.addEventListener('click', function(event) {
if (!sidebar.contains(event.target) && !settingsIcon.contains(event.target)) {
sidebar.classList.remove('show');
}
});
// Event listeners for buttons
editIcon.addEventListener('click', function() {
alert('Add code feature coming soon!');
});
lockButton.addEventListener('click', function() {
alert('Lock feature coming soon!');
});
githubButton.addEventListener('click', function() {
window.open('https://github.com/The-Real-Rylave/pro-auth', '_blank'); // Open GitHub link in new tab
});
supportButton.addEventListener('click', function() {
window.open('https://dsc.gg/rylave', '_blank'); // Open support link in new tab
});
// Event listener for back button
backButton.addEventListener('click', function() { // Changed to backButton
sidebar.classList.remove('show');
});
// Link About button to specified URL
aboutButton.addEventListener('click', function() {
window.open('https://pro-auth.static.domains/', '_blank');
});
});
// Debounce function to avoid multiple rapid events
function debounce(func, wait) {
let timeout;
return function(...args) {
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(this, args), wait);
};
}