-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
107 lines (96 loc) · 4.4 KB
/
index.php
File metadata and controls
107 lines (96 loc) · 4.4 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
<?php
// Directory to scan
$directory = __DIR__;
// Get the name of this script to exclude it
$self = basename(__FILE__);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Minitools</title>
<link href="https://minisoft.it/icons/fix.png" rel="shortcut icon" type="image/x-icon" />
<link href="https://minisoft.it/icons/fix.png" rel="apple-touch-icon" />
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#006E81',
'primary-dark': '#006E81',
secondary: '#814000',
}
}
}
}
</script>
</head>
<body class="bg-gray-100 flex flex-col min-h-screen">
<header class="bg-white border-b border-gray-200">
<div class="container mx-auto px-4 py-6 max-w-4xl">
<h1 class="text-3xl font-bold text-center text-gray-800">Minitools</h1>
<p class="text-gray-600 text-center mt-1">Utilities Collection <span class="opacity-50">v2.3</span></p>
</div>
</header>
<main class="container mx-auto px-4 py-8 max-w-md flex-grow">
<ul class="grid md:grid-cols-3 gap-4">
<?php
// Define groups and their files
$groups = [
'HTML Table tools' => ['magicTable.html', 'tabParse.html', 'tbodyExtr.html'],
'QR-Code tools' => ['bulkr.html', 'qrGen.html'],
'Extracting tools' => ['contentExtr.html', 'filesExtr.html', 'rangExtr.html']
// Add more groups as needed
];
if ($handle = opendir($directory)) {
$files = array();
$groupedFiles = array();
// Collect all valid files
while (false !== ($file = readdir($handle))) {
if (
$file != $self
&& $file != "index.php"
&& $file[0] != "."
&& !(is_dir($directory . "/" . $file) && $file[0] == ".")
&& !preg_match('/\.md$/', $file)
) {
$files[] = $file;
}
}
closedir($handle);
// Categorize files
foreach ($groups as $groupName => $groupFiles) {
$groupedFiles[$groupName] = array_intersect($files, $groupFiles);
$files = array_diff($files, $groupFiles);
}
// Add remaining files to "Other tools"
if (!empty($files)) {
sort($files);
$groupedFiles['Other tools'] = $files;
}
// Output grouped files
foreach ($groupedFiles as $groupName => $groupFiles) {
if (!empty($groupFiles)) {
echo "<li class='md:col-span-3'><h2 class='text-lg font-semibold text-gray-700 mb-2 pb-1 border-b border-gray-300'>$groupName</h2></li>";
foreach ($groupFiles as $file) {
$fileName = pathinfo($file, PATHINFO_FILENAME);
$filePath = htmlspecialchars($file);
echo "<li class='text-center'><a href='$filePath' class='inline-block w-full px-4 py-3 border border-gray-300 rounded-lg bg-white text-primary hover:scale-105 hover:shadow-md hover:bg-gray-50 transition duration-200'>$fileName</a></li>";
}
}
}
} else {
echo "<p class='text-center text-gray-700 md:col-span-3'>Could not open directory.</p>";
}
?>
</ul>
</main>
<footer class="bg-white border-t border-gray-200 mt-auto">
<div class="container mx-auto px-4 py-6 max-w-4xl">
<p class="text-gray-600 text-center">© <a href="https://minisoft.it/" class="text-primary hover:text-primary-dark">Minisoft</a> — All rights reserved</p>
</div>
</footer>
</body>
</html>