Streamixph05 commited on
Commit
122eb6e
·
verified ·
1 Parent(s): 943987a

Update templates/show.html

Browse files
Files changed (1) hide show
  1. templates/show.html +148 -0
templates/show.html CHANGED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
6
+ <title>Secure File Access</title>
7
+
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+
10
+ <style>
11
+ body {
12
+ font-family: "Inter", system-ui, sans-serif;
13
+ background: radial-gradient(circle at top, #1f2937, #020617);
14
+ color: #e5e7eb;
15
+ user-select: none;
16
+ }
17
+ .glass {
18
+ background: rgba(255,255,255,0.06);
19
+ backdrop-filter: blur(18px);
20
+ border: 1px solid rgba(255,255,255,0.08);
21
+ }
22
+ .btn {
23
+ padding: 0.85rem 1.6rem;
24
+ border-radius: 0.75rem;
25
+ font-weight: 600;
26
+ transition: all 0.25s ease;
27
+ }
28
+ .btn-primary {
29
+ background: linear-gradient(135deg,#6366f1,#4f46e5);
30
+ box-shadow: 0 10px 30px rgba(99,102,241,.35);
31
+ }
32
+ .btn-primary:hover {
33
+ transform: translateY(-2px) scale(1.03);
34
+ box-shadow: 0 14px 40px rgba(99,102,241,.55);
35
+ }
36
+ .btn-secondary {
37
+ background: rgba(255,255,255,0.08);
38
+ border: 1px solid rgba(255,255,255,0.15);
39
+ }
40
+ .btn-secondary:hover {
41
+ background: rgba(255,255,255,0.15);
42
+ transform: translateY(-2px);
43
+ }
44
+ .loader {
45
+ width: 64px;
46
+ height: 64px;
47
+ border-radius: 50%;
48
+ border: 6px solid rgba(255,255,255,.15);
49
+ border-top-color: #6366f1;
50
+ animation: spin 1.2s linear infinite;
51
+ margin: auto;
52
+ }
53
+ @keyframes spin { to { transform: rotate(360deg); } }
54
+ </style>
55
+ </head>
56
+
57
+ <body class="min-h-screen flex flex-col">
58
+
59
+ <!-- HEADER -->
60
+ <header class="p-6 text-center">
61
+ <h1 class="text-2xl font-bold tracking-wide">
62
+ <span class="text-indigo-400">Secure</span> Access
63
+ </h1>
64
+ <p class="text-sm text-gray-400 mt-1">Private • Fast • Encrypted</p>
65
+ </header>
66
+
67
+ <!-- MAIN -->
68
+ <main class="flex-grow flex items-center justify-center px-4">
69
+ <div class="max-w-xl w-full glass rounded-2xl p-6 sm:p-8 text-center shadow-2xl">
70
+
71
+ <!-- Loader -->
72
+ <div id="loader-container">
73
+ <div class="loader"></div>
74
+ <p class="mt-4 text-gray-400">Fetching your file securely…</p>
75
+ </div>
76
+
77
+ <!-- Content -->
78
+ <div id="content-container" style="display:none">
79
+ <h2 id="file-name" class="text-xl sm:text-2xl font-bold break-words"></h2>
80
+ <p id="file-size" class="text-gray-400 mt-1 mb-6"></p>
81
+
82
+ <div id="button-container" class="flex flex-col gap-4"></div>
83
+
84
+ <p class="mt-6 text-xs text-gray-500">
85
+ Links are private & protected. Do not share publicly.
86
+ </p>
87
+ </div>
88
+
89
+ </div>
90
+ </main>
91
+
92
+ <!-- FOOTER -->
93
+ <footer class="p-4 text-center text-xs text-gray-500">
94
+ © 2025 • All Rights Reserved
95
+ </footer>
96
+
97
+ <script>
98
+ const BASE_URL = window.location.origin;
99
+ const FILE_ID = window.location.pathname.split("/").pop();
100
+
101
+ async function fetchFileData() {
102
+ const loader = document.getElementById("loader-container");
103
+ const content = document.getElementById("content-container");
104
+ const fileNameEl = document.getElementById("file-name");
105
+ const fileSizeEl = document.getElementById("file-size");
106
+ const buttonContainer = document.getElementById("button-container");
107
+
108
+ try {
109
+ const res = await fetch(`${BASE_URL}/api/file/${FILE_ID}`);
110
+ if (!res.ok) throw new Error();
111
+
112
+ const data = await res.json();
113
+ document.title = data.file_name;
114
+
115
+ fileNameEl.innerText = data.file_name;
116
+ fileSizeEl.innerText = `Size • ${data.file_size}`;
117
+
118
+ buttonContainer.innerHTML = "";
119
+
120
+ if (data.is_media) {
121
+ const mx = `intent:${data.direct_dl_link}#Intent;action=android.intent.action.VIEW;type=video/*;end`;
122
+ const vlc = `intent:${data.direct_dl_link}#Intent;action=android.intent.action.VIEW;type=video/*;package=org.videolan.vlc;end`;
123
+
124
+ buttonContainer.innerHTML = `
125
+ <a href="${data.direct_dl_link}" class="btn btn-primary">⬇ Download Now</a>
126
+ <a href="${mx}" class="btn btn-secondary">▶ Play in MX Player</a>
127
+ <a href="${vlc}" class="btn btn-secondary">▶ Play in VLC</a>
128
+ `;
129
+ } else {
130
+ buttonContainer.innerHTML = `
131
+ <a href="${data.direct_dl_link}" class="btn btn-primary">⬇ Download File</a>
132
+ `;
133
+ }
134
+
135
+ loader.style.display = "none";
136
+ content.style.display = "block";
137
+
138
+ } catch {
139
+ loader.innerHTML = "<p class='text-red-400'>❌ Link expired or invalid</p>";
140
+ }
141
+ }
142
+
143
+ fetchFileData();
144
+ document.addEventListener("contextmenu", e => e.preventDefault());
145
+ </script>
146
+
147
+ </body>
148
+ </html>