File size: 3,620 Bytes
4362d29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
// --- Navigation & UI Logic ---
let homeBtn = document.querySelector(".home-btn");
let abtBtn = document.querySelector(".about-btn");
let dldBtn_outer = document.querySelector(".downloadBtn");
let file_name = document.querySelector(".file-name");
let about_nav = document.querySelector(".about-nav");
let footer = document.querySelector('footer');

if (document.getElementById("heading")?.classList.contains("title")) {
    document.querySelector(".title").textContent = 'SYSTUMM';
}

homeBtn.classList.add('active');

abtBtn.addEventListener("click", () => {
    dldBtn_outer.style.display = "none";
    file_name.style.display = "none";
    footer.style.display = "none";
    about_nav.style.display = "block";
});

homeBtn.addEventListener("click", () => {
    dldBtn_outer.style.display = "flex";
    file_name.style.display = "block";
    footer.style.display = "block";
    window.location.href = "#main";
    about_nav.style.display = "none";
});

function toggleWidth(element) {
    let links = document.querySelectorAll('.about-nav a');
    links.forEach(link => link.classList.remove('active'));
    element.classList.add('active');
}

function toggleWidthnav(element) {
    let links = document.querySelectorAll('.nryt a');
    links.forEach(link => link.classList.remove('active'));
    element.classList.add('active');
}

// --- Player Initialization ---
var div = document.getElementById('myDiv');
if (div) {
    var text = div.textContent;
    if (text.length > 300) {
        div.textContent = text.slice(0, 300) + "....";
    }
}

const controls = [
    'play-large', 'rewind', 'play', 'fast-forward',
    'progress', 'current-time', 'duration',
    'captions', 'settings', 'pip', 'airplay', 'fullscreen'
];

document.addEventListener('DOMContentLoaded', () => {
    const player = Plyr.setup('.player', { controls });
});

// --- Security (Disable Right Click / Inspect) ---
document.addEventListener("contextmenu", e => e.preventDefault());
document.addEventListener('keydown', e => {
    if (e.key === 'F12' || (e.ctrlKey && e.shiftKey && e.key === 'I') || (e.ctrlKey && e.key === 'u') || e.ctrlKey || e.shiftKey || e.altKey) {
        e.preventDefault();
    }
});

// --- External Player Routing ---
const videolink = window.location.href;
const streamlink = videolink.replace("/watch/", "/dl/");

function vlc_player() { window.location.href = `vlc://${streamlink}`; }
function mx_player() { window.location.href = `intent:${streamlink}#Intent;package=com.mxtech.videoplayer.ad;end`; }
function n_player() { window.location.href = `nplayer-${streamlink}`; }
function streamDownload() { window.location.href = streamlink; }

function copyStreamLink() {
    const linkToCopy = streamlink.toLowerCase();
    if (!navigator.clipboard) {
        navigator.clipboard = {
            writeText: function(text) {
                return new Promise((resolve, reject) => {
                    try {
                        const textArea = document.createElement("textarea");
                        textArea.value = text;
                        document.body.appendChild(textArea);
                        textArea.focus();
                        textArea.select();
                        document.execCommand('copy');
                        document.body.removeChild(textArea);
                        resolve();
                    } catch (err) { reject(err); }
                });
            }
        };
    }
    navigator.clipboard.writeText(linkToCopy)
        .then(() => alert('Stream link copied successfully!'))
        .catch(err => alert('Failed to copy link. Please try manually.'));
}