aboutsummaryrefslogtreecommitdiff
path: root/aud/index.php
diff options
context:
space:
mode:
authorAda Isopods <me@bathynomus.xyz>2024-12-05 20:26:58 -0700
committerAda Isopods <me@bathynomus.xyz>2026-10-21 23:30:20 -0600
commite0406f8c60a05887c2670d633d1d8eb58c7332c1 (patch)
tree77fd790ff67921e35f5c0f10a1c1e375a5b4d566 /aud/index.php
parentb58b9832183c5dec8af2dfd580abf3d5d9bdc086 (diff)
overhauled the entire site basically
Diffstat (limited to 'aud/index.php')
-rwxr-xr-xaud/index.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/aud/index.php b/aud/index.php
new file mode 100755
index 0000000..fe53ce1
--- /dev/null
+++ b/aud/index.php
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="icon" type="image/x-icon" href="/favicon.ico">
+ <title>/log/aud</title>
+ <link href="../style.css" rel="stylesheet" type="text/css" media="all">
+ <style>
+ article {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ }
+ @media only screen and (hover: none) {
+ article {
+ flex-direction: column;
+ align-items: initial;
+ }
+ audio {
+ margin: 0.5rem;
+ }
+ }
+ </style>
+ </head>
+ <body>
+ <nav><a href="../"><<<</a></nav>
+ <p>$ pwd</p>
+ <h1 class="title">/log/aud</h1>
+ <p>$ ls -t</p>
+ <section class="dir">
+ <?php
+ // Code to automatically populate the page with every mp3 file in the directory.
+ // Should display filename - and date of creation and id3 comment if possible.
+
+ function test_audio($name) { // Returns true if a file is an mp3, false otherwise
+ return (strpos($name, ".mp3") > 0);
+ }
+
+ $files = array_filter(scandir("."), "test_audio");
+
+ usort($files, function($a, $b) { // Sort files by modification date of the files
+ return filemtime("$b") - filemtime("$a");
+ });
+
+ foreach($files as $fi) {
+ //$fitime = filemtime("$fi");
+ $fisize = filesize("$fi");
+ echo "<article><span>$fi</span><audio controls><source src='$fi' type='audio/mpeg'>your browser does not support embedded audio.</audio></article>";
+ }
+ ?>
+ </section>
+ <p>$</p>
+ </body>
+
+</html>