-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtool.html
More file actions
246 lines (222 loc) · 9.2 KB
/
tool.html
File metadata and controls
246 lines (222 loc) · 9.2 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#0d1117">
<title>Tool Details - TermuxVoid</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- ========== Header ========== -->
<header class="header">
<a class="header__logo" href="index.html">
<img src="https://termuxvoid.github.io/repo/img/termuxvoid_logo.png" alt="TermuxVoid Logo">
TermuxVoid
</a>
<button class="menu-btn" id="menuBtn" aria-label="Toggle menu">☰</button>
<nav class="header__nav" id="navLinks">
<a href="index.html">Home</a>
<a href="index.html#tools">Tools</a>
<a href="index.html#installation">Installation</a>
<a href="index.html#faq">FAQ</a>
</nav>
</header>
<!-- ========== Detail Content ========== -->
<main class="detail" id="toolDetail">
<div class="loader">
<div class="loader__spinner"></div>
<span class="loader__text">Loading tool details...</span>
</div>
</main>
<!-- ========== Footer ========== -->
<footer class="footer">
<div>
<h3>TermuxVoid</h3>
<p>Security tools excluded from official Termux repos, plus custom builds.</p>
</div>
<div>
<h3>Quick Links</h3>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="index.html#tools">Tools</a></li>
<li><a href="index.html#installation">Installation</a></li>
</ul>
</div>
<div>
<h3>Resources</h3>
<ul>
<li><a href="https://github.com/termuxvoid/repo">GitHub Repo</a></li>
<li><a href="https://github.com/TermuxVoid/repo/blob/main/assets/PACKAGES.md">Package List</a></li>
</ul>
</div>
<div class="footer__credits">
© 2026 TermuxVoid. Maintained by the Void Team.
</div>
</footer>
<!-- ========== Toast ========== -->
<div id="toast" class="toast"></div>
<!-- ========== Scripts ========== -->
<script src="js/packages.js"></script>
<script>
document.addEventListener('DOMContentLoaded', async () => {
const container = document.getElementById('toolDetail');
const params = new URLSearchParams(window.location.search);
const toolName = params.get('name');
if (!toolName) {
container.innerHTML = `
<a class="detail__back" href="index.html">← Back to tools</a>
<div class="error-state">
<div class="error-state__icon">⚠</div>
<p class="error-state__msg">No tool specified. Go back and search for a tool.</p>
<a class="detail__btn detail__btn--primary" href="index.html#tools">Browse Tools</a>
</div>
`;
return;
}
// Update page title
document.title = `${toolName} - TermuxVoid`;
try {
const packages = await PackagesParser.fetchPackages();
const tool = packages.find(p => p.name === toolName);
if (!tool) {
container.innerHTML = `
<a class="detail__back" href="index.html">← Back to tools</a>
<div class="error-state">
<div class="error-state__icon">🔍</div>
<p class="error-state__msg">Tool "<strong>${esc(toolName)}</strong>" not found in the repository.</p>
<a class="detail__btn detail__btn--primary" href="index.html#tools">Browse Tools</a>
</div>
`;
return;
}
document.title = `${tool.name} - TermuxVoid`;
const installCmd = `pkg install ${tool.name}`;
const deps = tool.depends ? tool.depends.split(',').map(d => d.trim()) : [];
const sizeKB = (parseInt(tool.size) / 1024).toFixed(1);
container.innerHTML = `
<a class="detail__back" href="index.html">← Back to tools</a>
<div class="detail__hero">
<h1 class="detail__name">${esc(tool.name)}</h1>
<p class="detail__version">Version ${esc(tool.version)} · ${esc(tool.section)}</p>
</div>
<div class="detail__meta">
<div class="meta-card">
<div class="meta-card__label">Section</div>
<div class="meta-card__value">${esc(tool.section)}</div>
</div>
<div class="meta-card">
<div class="meta-card__label">Version</div>
<div class="meta-card__value">${esc(tool.version)}</div>
</div>
<div class="meta-card">
<div class="meta-card__label">Architecture</div>
<div class="meta-card__value">${esc(tool.architecture)}</div>
</div>
<div class="meta-card">
<div class="meta-card__label">Maintainer</div>
<div class="meta-card__value">${esc(tool.maintainer)}</div>
</div>
<div class="meta-card">
<div class="meta-card__label">Package Size</div>
<div class="meta-card__value">${sizeKB} KB</div>
</div>
${tool.homepage ? `
<div class="meta-card">
<div class="meta-card__label">Homepage</div>
<div class="meta-card__value"><a href="${esc(tool.homepage)}" target="_blank" rel="noopener">${esc(tool.homepage)}</a></div>
</div>` : ''}
</div>
<div class="detail__section">
<h2 class="detail__section-title">Description</h2>
<p class="detail__desc">${esc(tool.description)}</p>
</div>
${deps.length ? `
<div class="detail__section">
<h2 class="detail__section-title">Dependencies</h2>
<div class="detail__deps">
${deps.map(d => `<span class="detail__dep-tag">${esc(d)}</span>`).join('')}
</div>
</div>` : ''}
<div class="detail__section">
<h2 class="detail__section-title">Install</h2>
<div class="code-block">
<button class="copy-btn" onclick="copyCmd(this)">Copy</button>
<pre><code>${esc(installCmd)}</code></pre>
</div>
</div>
${tool.sha256 ? `
<div class="detail__section">
<h2 class="detail__section-title">SHA256 Checksum</h2>
<div class="detail__checksum">
${esc(tool.sha256)}
<button class="copy-btn" onclick="copyChecksum(this)">Copy</button>
</div>
</div>` : ''}
<div class="detail__actions">
<button class="detail__btn detail__btn--primary" onclick="copyInstall('${esc(installCmd)}')">
Copy Install Command
</button>
${tool.homepage ? `
<a class="detail__btn detail__btn--secondary" href="${esc(tool.homepage)}" target="_blank" rel="noopener">
Visit Homepage →
</a>` : ''}
<a class="detail__btn detail__btn--secondary" href="index.html#tools">
Browse More Tools
</a>
</div>
`;
} catch (err) {
container.innerHTML = `
<a class="detail__back" href="index.html">← Back to tools</a>
<div class="error-state">
<div class="error-state__icon">⚠</div>
<p class="error-state__msg">Failed to load tool: ${esc(err.message)}</p>
<button class="error-state__retry" onclick="location.reload()">Retry</button>
</div>
`;
}
// Setup menu toggle
const btn = document.getElementById('menuBtn');
const nav = document.getElementById('navLinks');
btn.addEventListener('click', () => nav.classList.toggle('open'));
nav.querySelectorAll('a').forEach(a => a.addEventListener('click', () => nav.classList.remove('open')));
document.addEventListener('click', (e) => {
if (!e.target.closest('.header')) nav.classList.remove('open');
});
});
function esc(str) {
const div = document.createElement('div');
div.textContent = str;
return div.innerHTML;
}
function copyCmd(btn) {
const code = btn.closest('.code-block').querySelector('code').textContent;
navigator.clipboard.writeText(code).then(() => {
btn.textContent = 'Copied!';
btn.classList.add('copied');
setTimeout(() => { btn.textContent = 'Copy'; btn.classList.remove('copied'); }, 1500);
});
}
function copyChecksum(btn) {
const text = btn.parentElement.textContent.replace('Copy', '').trim();
navigator.clipboard.writeText(text).then(() => {
btn.textContent = 'Copied!';
btn.classList.add('copied');
setTimeout(() => { btn.textContent = 'Copy'; btn.classList.remove('copied'); }, 1500);
});
}
function copyInstall(cmd) {
navigator.clipboard.writeText(cmd).then(() => {
const toast = document.getElementById('toast');
toast.textContent = 'Copied: ' + cmd;
toast.classList.add('show', 'toast--success');
setTimeout(() => toast.classList.remove('show'), 2000);
});
}
</script>
</body>
</html>