Streamixph05 commited on
Commit
7911a73
·
verified ·
1 Parent(s): 089a46e

Update templates/show.html

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