summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.DS_Storebin8196 -> 8196 bytes
-rw-r--r--.idea/Argon.iml1
-rw-r--r--.idea/jsLibraryMappings.xml6
-rw-r--r--.idea/misc.xml8
-rw-r--r--_familine/index.php3
-rw-r--r--_frame/about/index.php6
-rw-r--r--_frame/home/index.php4
-rw-r--r--_frame/homeless/index.php1
-rw-r--r--_frame/library.internal/main.php2
-rw-r--r--_frame/library.internal/view.php2
-rw-r--r--_frame/library/index.php38
-rw-r--r--_frame/library/main.php59
-rw-r--r--_frame/settings/index.php31
-rw-r--r--api/get_song_cover.php28
-rw-r--r--css/dark.css54
-rw-r--r--css/frame-settings.css2
-rw-r--r--css/navigation.css33
-rw-r--r--css/player.css19
-rw-r--r--favicon.icobin0 -> 310725 bytes
-rw-r--r--index.php14
-rw-r--r--js/player.js67
-rw-r--r--unsupported/index.html1
-rw-r--r--version2
23 files changed, 309 insertions, 72 deletions
diff --git a/.DS_Store b/.DS_Store
index 75f1db5..9afe0ac 100644
--- a/.DS_Store
+++ b/.DS_Store
Binary files differ
diff --git a/.idea/Argon.iml b/.idea/Argon.iml
index c956989..fde5cfa 100644
--- a/.idea/Argon.iml
+++ b/.idea/Argon.iml
@@ -4,5 +4,6 @@
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="elac" level="application" />
</component>
</module> \ No newline at end of file
diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml
new file mode 100644
index 0000000..df11954
--- /dev/null
+++ b/.idea/jsLibraryMappings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="JavaScriptLibraryMappings">
+ <file url="PROJECT" libraries="{elac}" />
+ </component>
+</project> \ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 283b9b4..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
- <component name="SwUserDefinedSpecifications">
- <option name="specTypeByUrl">
- <map />
- </option>
- </component>
-</project> \ No newline at end of file
diff --git a/_familine/index.php b/_familine/index.php
new file mode 100644
index 0000000..7e2b2bb
--- /dev/null
+++ b/_familine/index.php
@@ -0,0 +1,3 @@
+<?php
+
+setcookie("familineMode", "1", 0, "/", "music.familine.minteck.org", true, true); \ No newline at end of file
diff --git a/_frame/about/index.php b/_frame/about/index.php
index 7bdd290..c566990 100644
--- a/_frame/about/index.php
+++ b/_frame/about/index.php
@@ -33,9 +33,7 @@
</div>
</div>
- <?php if (str_contains($_SERVER['HTTP_USER_AGENT'], "+AutomateCloud/") && !$_FAMILINE): ?>
- <p>For more details and legal notices, go to the About Argon screen in the app's menus.</p>
- <?php endif; ?>
+ <p><?= l("Powered by the Equestria Lossless Audio Codec", "Propulsé par le codec audio sans perte d'Equestria (ELAC)") ?></p>
<div id="frame-about-debug">
<b><?= l("Player Info", "Infos lecteur ") ?>:</b><br>
@@ -57,7 +55,7 @@
<span id="frame-about-debug--nextSong"><?= l("&lt;not playing&gt;", "&lt;pas de lecture&gt;") ?></span>
<span><?= l("Position", "Position ") ?>:</span>
- <span id="frame-about-debug--position"><?= l("&lt;not playing&gt;", "&lt;pas de lecture&gt;") ?></span>
+ <code id="frame-about-debug--position" style="font-family: monospace;"><?= l("&lt;not playing&gt;", "&lt;pas de lecture&gt;") ?></code>
<span><?= l("Playback Quality", "Qualité lecture ") ?>:</span>
<span id="frame-about-debug--quality"><?= l("&lt;not playing&gt;", "&lt;pas de lecture&gt;") ?></span>
diff --git a/_frame/home/index.php b/_frame/home/index.php
index 0ea9691..4dcbd8b 100644
--- a/_frame/home/index.php
+++ b/_frame/home/index.php
@@ -23,11 +23,13 @@
<div id="frame-home-intro" <?= $_FAMILINE ? "style=\"filter: hue-rotate(150deg);\"" : "" ?>>
<img src="<?= str_contains($_SERVER['HTTP_USER_AGENT'], "+AutomateCloud/") ? ("/native.svg") : ($_FAMILINE ? "https://familine.minteck.org/icns/familine-music.svg" : "/favicon.svg") ?>" id="frame-home-logo" <?= $_FAMILINE ? "style=\"filter: hue-rotate(-150deg);\"" : "" ?>>
<div id="frame-home-welcome"><?= l("Welcome to the Argon Media Platform!", "Bienvenue sur Familine Musique !") ?></div>
- <div id="frame-home-tagline"><?= l("High quality ad-free music from Minteck", "Musique de haute qualité et sans publicités de la famille") ?></div>
+ <div id="frame-home-tagline"><?= l("High quality ad-free music from Minteck, powered by ELAC", "Musique de haute qualité et sans publicités de la famille, propulsé par ELAC") ?></div>
<button onclick="location.href='/_frame/library';" id="frame-home-button"><?= l("Browse Library", "Explorer la bibliothèque") ?></button>
<div id="frame-home-links">
<a onclick="location.href='/_frame/about';" id="frame-home-link-about" class="frame-home-link"><?= l("About Argon", "À propos") ?></a>
·
+ <a onclick="window.open('https://git.equestria.dev/equestria.dev/elac');" id="frame-home-link-source" class="frame-home-link"><?= l("About ELAC", "À propos de ELAC") ?></a>
+ ·
<?php if (!$_FAMILINE): ?>
<a onclick="location.href='/_frame/copyright';" id="frame-home-link-about" class="frame-home-link"><?= l("Copyright", "Droits d'auteurs") ?></a>
·
diff --git a/_frame/homeless/index.php b/_frame/homeless/index.php
new file mode 100644
index 0000000..b65f416
--- /dev/null
+++ b/_frame/homeless/index.php
@@ -0,0 +1 @@
+homeless -_- \ No newline at end of file
diff --git a/_frame/library.internal/main.php b/_frame/library.internal/main.php
index 5ffc26b..0b0a52a 100644
--- a/_frame/library.internal/main.php
+++ b/_frame/library.internal/main.php
@@ -20,7 +20,7 @@
<?= l("Library", "Bibliothèque") ?>
</div>
<div id="frame-contents">
- <?php $data = json_decode(file_get_contents("https://argon.minteck.org/api/get_list.php"), true); ?>
+ <?php $data = json_decode(file_get_contents("https://forced.argon.minteck.org/api/get_list.php"), true); ?>
<div id="frame-library-listing">
<?php foreach ($data["listing"] as $item): ?>
<div onclick="if (!event.target.classList.contains('frame-library-item-part-song')) location.href='/_frame/library/<?= $item["_id"] ?>';" class="frame-library-item" id="frame-library-item--<?= $item["_type"] . "-" . $item["_id"] ?>">
diff --git a/_frame/library.internal/view.php b/_frame/library.internal/view.php
index e2c9d2a..54b3c85 100644
--- a/_frame/library.internal/view.php
+++ b/_frame/library.internal/view.php
@@ -1,6 +1,6 @@
<?php if (str_ends_with($_SERVER['HTTP_HOST'], ".familine.minteck.org")) { $_FAMILINE = true; setlocale(LC_TIME, array('fr_FR.UTF-8','fr_FR@euro','fr_FR','french')); } else { $_FAMILINE = false; } function l($en, $fr) { global $_FAMILINE; if ($_FAMILINE) { return $fr; } else { return $en; } } $root = $_SERVER['DOCUMENT_ROOT']; $root = $_SERVER['DOCUMENT_ROOT'];
-$data = json_decode(file_get_contents("https://argon.minteck.org/api/get_list.php"), true);
+$data = json_decode(file_get_contents("https://forced.argon.minteck.org/api/get_list.php"), true);
$views = json_decode(file_get_contents("/mnt/argon-cdn/3pad/data.json"), true);
if (str_starts_with($_GET['_'], ":")) {
diff --git a/_frame/library/index.php b/_frame/library/index.php
new file mode 100644
index 0000000..e3d14fc
--- /dev/null
+++ b/_frame/library/index.php
@@ -0,0 +1,38 @@
+<?php $root = $_SERVER['DOCUMENT_ROOT']; ?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Argon</title>
+ <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
+ <link rel="stylesheet" href="/css/fonts.css">
+ <link rel="stylesheet" href="/css/general.css">
+ <link rel="stylesheet" href="/css/header.css">
+ <link rel="stylesheet" href="/css/frame-home.css">
+ <link rel="stylesheet" href="/css/frame.css">
+ <meta name="HandheldFriendly" content="true" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+</head>
+<body>
+<div id="argon-frame">
+ <div id="frame-header">
+ Home
+ </div>
+ <div id="frame-contents">
+ <div id="frame-home-intro">
+ <img src="/logo/512.png" id="frame-home-logo">
+ <div id="frame-home-welcome">Welcome to the Argon Media Platform!</div>
+ <div id="frame-home-tagline">High quality ad-free music from Minteck</div>
+ <button onclick="location.href='/_frame/library';" id="frame-home-button">Browse Library</button>
+ <div id="frame-home-links">
+ <a onclick="location.href='/_frame/about';" id="frame-home-link-about" class="frame-home-link">About Argon</a>
+ ·
+ <a onclick="location.href='/_frame/settings';" id="frame-home-link-settings" class="frame-home-link">Preferences</a>
+ ·
+ <a onclick="window.open('https://gitlab.minteck.org/explore/projects/topics/Argon');" id="frame-home-link-source" class="frame-home-link">Source Code</a>
+ </div>
+ </div>
+ </div>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/_frame/library/main.php b/_frame/library/main.php
new file mode 100644
index 0000000..456838f
--- /dev/null
+++ b/_frame/library/main.php
@@ -0,0 +1,59 @@
+<?php $root = $_SERVER['DOCUMENT_ROOT']; ?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Argon</title>
+ <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
+ <link rel="stylesheet" href="/css/fonts.css">
+ <link rel="stylesheet" href="/css/general.css">
+ <link rel="stylesheet" href="/css/header.css">
+ <link rel="stylesheet" href="/css/frame-library.css">
+ <link rel="stylesheet" href="/css/frame.css">
+ <meta name="HandheldFriendly" content="true" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+</head>
+<body>
+<div id="argon-frame">
+ <div id="frame-header">
+ Library
+ </div>
+ <div id="frame-contents">
+ <?php $data = json_decode(file_get_contents("https://argon.minteck.org/api/get_list.php"), true); ?>
+ <div id="frame-library-listing">
+ <?php foreach ($data["listing"] as $item): ?>
+ <div onclick="if (!event.target.classList.contains('frame-library-item-part-song')) location.href='/_frame/library/<?= $item["_id"] ?>';" class="frame-library-item" id="frame-library-item--<?= $item["_type"] . "-" . $item["_id"] ?>">
+ <div class="frame-library-item-inner">
+ <div class="frame-library-item-cover">
+ <img alt="Album art" class="frame-library-item-cover-inner" src="/api/get_image.php?_=<?= $item["_id"] ?>">
+ </div>
+ <div class="frame-library-item-text">
+ <div class="frame-library-item-text-inner">
+ <div class="frame-library-item-text-title"><?= $item["name"] ?></div>
+ <div class="frame-library-item-text-info"><?= $item["author"] ?> · <?= substr($item["release"], 0, 4); ?></div>
+ <?php if ($item["_type"] === "song"): ?>
+ <div class="frame-library-item-text-original"><?= $item["original"] === null ? "Original Content" : "original by " . $item["original"] ?></div>
+ <?php else: ?>
+ <div class="frame-library-item-text-original"><?= count($item["songs"]) ?> tracks</div>
+ <?php endif; ?>
+ </div>
+ </div>
+ </div>
+ <?php if ($item["_type"] === "set"): ?>
+ <div class="frame-library-item-set">
+ <?php foreach ($item["songs"] as $index => $song): ?>
+ <div onclick="location.href='/_frame/library/<?= $song["_id"] ?>';" class="frame-library-item-set-song frame-library-item-part-song" id="frame-library-item-set-song--<?= $item["_id"] ?>--<?= $song["_id"] ?>">
+ <div class="frame-library-item-set-song-cover frame-library-item-part-song">
+ <img alt="Album art" class="frame-library-item-set-song-cover-inner frame-library-item-part-song" src="/api/get_image.php?_=<?= $song["_id"] ?>"></div>
+ <div class="frame-library-item-set-song-title frame-library-item-part-song"><?= $song["name"] ?></div>
+ </div>
+ <?php endforeach; ?>
+ </div>
+ <?php endif; ?>
+ </div>
+ <?php endforeach; ?>
+ </div>
+ </div>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/_frame/settings/index.php b/_frame/settings/index.php
index 2b3e840..bf828f9 100644
--- a/_frame/settings/index.php
+++ b/_frame/settings/index.php
@@ -21,24 +21,35 @@
<?= l("Preferences", "Préférences") ?>
</div>
<div id="frame-contents">
+ <?php
+
+ $supportsELACpl = true;
+ if (str_contains($_SERVER['HTTP_USER_AGENT'], "Safari/") && !str_contains($_SERVER['HTTP_USER_AGENT'], "Chrome/")) {
+ $supportsELACpl = false;
+ }
+
+ ?>
<?= l("Audio Quality", "Qualité audio") ?><br>
<select onchange="localStorage.setItem('quality', document.getElementById('frame-settings-quality').value); document.getElementById('frame-settings-quality-warning').style.display = document.getElementById('frame-settings-quality').value !== '0' ? '' : 'none'" id="frame-settings-quality">
- <optgroup label="<?= l("Recommended Settings", "Paramètres recommendés") ?>">
+ <optgroup label="<?= l("Recommended Settings", "Paramètres recommandés") ?>">
<option value="0"><?= l("Automatically depending on network (recommended)", "Automatiquement selon le réseau (recommandé)") ?></option>
- <option value="2"><?= l("Original audio quality", "Qualité audio originale") ?></option>
+ <option value="2"<?= $supportsELACpl ? "" : " disabled" ?>><?= l("Original audio quality", "Qualité audio originale") ?> (ELAC Physical Lossless)</option>
</optgroup>
<optgroup label="<?= l("Advanced", "Avancé") ?>">
- <option value="1:ultrahighpcm"><?= l("Highest quality", "Qualité la plus haute") ?> (<?= l("CBR", "constant") ?> 460<?= l("kbps", " ko/s") ?>, 32<?= l("bit", " bits") ?>)</option>
- <option value="1:veryhigh"><?= l("Higher quality", "Qualité plus haute") ?> (<?= l("CBR", "constant") ?> 320<?= l("kbps", " ko/s") ?>, 32<?= l("bit", " bits") ?>)</option>
- <option value="1:high"><?= l("High quality", "Haute qualité") ?> (<?= l("VBR", "variable") ?> 245<?= l("kbps", " ko/s") ?>, 32<?= l("bit", " bits") ?>)</option>
- <option value="1:medium"><?= l("Medium quality", "Qualité moyenne") ?> (<?= l("VBR", "variable") ?> 175<?= l("kbps", " ko/s") ?>, 16<?= l("bit", " bits") ?>)</option>
- <option value="1:low"><?= l("Low quality", "Basse qualité") ?> (<?= l("VBR", "variable") ?> 130<?= l("kbps", " ko/s") ?>, 16<?= l("bit", " bits") ?>)</option>
- <option value="1:verylow"><?= l("Slightly lower quality", "Qualité légèrement plus basse") ?> (<?= l("VBR", "variable") ?> 100<?= l("kbps", " ko/s") ?>, 16<?= l("bit", " bits") ?>)</option>
- <option value="1:ultralow"><?= l("Lower quality", "Qualité plus basse") ?> (<?= l("VBR", "variable") ?> 85<?= l("kbps", " ko/s") ?>, 16<?= l("bit", " bits") ?>)</option>
- <option value="1:superlow"><?= l("Lowest quality", "Qualité la plus basse") ?> (<?= l("VBR", "variable") ?> 65<?= l("kbps", " ko/s") ?>, 16<?= l("bit", " bits") ?>)</option>
+ <option value="1:ultrahigh"<?= $supportsELACpl ? "" : " disabled" ?>><?= l("Highest quality", "Qualité la plus haute") ?> (ELAC-PL 460<?= l("kbps", " ko/s") ?>, 32<?= l("bit", " bits") ?>)</option>
+ <option value="1:veryhigh"><?= l("Higher quality", "Qualité plus haute") ?> (ELAC-EL 320<?= l("kbps", " ko/s") ?>, 32<?= l("bit", " bits") ?>)</option>
+ <option value="1:high"><?= l("High quality", "Haute qualité") ?> (ELAC-EL 245<?= l("kbps", " ko/s") ?>, 32<?= l("bit", " bits") ?>)</option>
+ <option value="1:medium"><?= l("Medium quality", "Qualité moyenne") ?> (ELAC-EL 175<?= l("kbps", " ko/s") ?>, 16<?= l("bit", " bits") ?>)</option>
+ <option value="1:low"><?= l("Low quality", "Basse qualité") ?> (ELAC-EL 130<?= l("kbps", " ko/s") ?>, 16<?= l("bit", " bits") ?>)</option>
+ <option value="1:verylow"><?= l("Slightly lower quality", "Qualité légèrement plus basse") ?> (ELAC-EL 100<?= l("kbps", " ko/s") ?>, 16<?= l("bit", " bits") ?>)</option>
+ <option value="1:ultralow"><?= l("Lower quality", "Qualité plus basse") ?> (ELAC-EL 85<?= l("kbps", " ko/s") ?>, 16<?= l("bit", " bits") ?>)</option>
+ <option value="1:superlow"><?= l("Lowest quality", "Qualité la plus basse") ?> (ELAC-EL 65<?= l("kbps", " ko/s") ?>, 16<?= l("bit", " bits") ?>)</option>
</optgroup>
</select>
<div id="frame-settings-quality-warning" style="display:none;"><?= l("Using another audio quality setting than the default one may lead to audio not playing continuously due to low Internet connection or poor performance.", "Utiliser une autre option de qualité audio que celle par défaut peut empêcher l'audio d'être lu en continu en raison d'une mauvaise performance réseau ou système.") ?></div>
+ <?php if (!$supportsELACpl): ?>
+ <div id="frame-settings-unsupported-warning"><?= l("This browser does not support playing ELAC Physical Lossless audio.", "Ce navigateur ne supporte pas les lectures de flux ELAC Physical Lossless.") ?></div>
+ <?php endif; ?>
</div>
<script>
diff --git a/api/get_song_cover.php b/api/get_song_cover.php
new file mode 100644
index 0000000..b6fc53c
--- /dev/null
+++ b/api/get_song_cover.php
@@ -0,0 +1,28 @@
+<?php
+
+if (isset($_GET["_"])) {
+ $f = $_GET["_"];
+} else {
+ die();
+}
+
+header("Content-Type: application/json");
+
+$ua = str_replace("+", "_", str_replace("/", "-", base64_encode(substr($_SERVER["HTTP_USER_AGENT"], 0, 200))));
+$ip = str_replace("+", "_", str_replace("/", "-", base64_encode(substr($_SERVER["REMOTE_ADDR"], 0, 48))));
+
+$out = [
+ "original" => "https://mediacdn.argon.minteck.org" . file_get_contents("http://192.168.1.51:8875/authorize/$f/original/$ua/$ip"),
+ "originalpcm" => "https://mediacdn.argon.minteck.org" . file_get_contents("http://192.168.1.51:8875/authorize/$f/originalpcm/$ua/$ip"),
+ "ultrahigh" => "https://mediacdn.argon.minteck.org" . file_get_contents("http://192.168.1.51:8875/authorize/$f/ultrahigh/$ua/$ip"),
+ "ultrahighpcm" => "https://mediacdn.argon.minteck.org" . file_get_contents("http://192.168.1.51:8875/authorize/$f/ultrahighpcm/$ua/$ip"),
+ "veryhigh" => "https://mediacdn.argon.minteck.org" . file_get_contents("http://192.168.1.51:8875/authorize/$f/veryhigh/$ua/$ip"),
+ "high" => "https://mediacdn.argon.minteck.org" . file_get_contents("http://192.168.1.51:8875/authorize/$f/high/$ua/$ip"),
+ "medium" => "https://mediacdn.argon.minteck.org" . file_get_contents("http://192.168.1.51:8875/authorize/$f/medium/$ua/$ip"),
+ "low" => "https://mediacdn.argon.minteck.org" . file_get_contents("http://192.168.1.51:8875/authorize/$f/low/$ua/$ip"),
+ "verylow" => "https://mediacdn.argon.minteck.org" . file_get_contents("http://192.168.1.51:8875/authorize/$f/verylow/$ua/$ip"),
+ "ultralow" => "https://mediacdn.argon.minteck.org" . file_get_contents("http://192.168.1.51:8875/authorize/$f/ultralow/$ua/$ip"),
+ "superlow" => "https://mediacdn.argon.minteck.org" . file_get_contents("http://192.168.1.51:8875/authorize/$f/superlow/$ua/$ip"),
+];
+
+die(json_encode($out, JSON_PRETTY_PRINT)); \ No newline at end of file
diff --git a/css/dark.css b/css/dark.css
new file mode 100644
index 0000000..5cd9a0f
--- /dev/null
+++ b/css/dark.css
@@ -0,0 +1,54 @@
+@media (prefers-color-scheme: dark) {
+ body, html {
+ background: rgb(18, 18, 18);
+ color: white;
+ }
+
+ #frame-viewer-header {
+ background: rgba(28, 28, 28, 1) !important;
+ }
+
+ #frame-viewer-header-play {
+ color: black;
+ }
+
+ #frame-header, #navigation-outer, #player {
+ border-color: rgba(255, 255, 255, .25);
+ }
+
+ .frame-library-item, .frame-library-item-inner, .frame-library-item-set-song-cover, .frame-library-item-set-song-title, #frame-viewer-set, .navigation-item-icon, .player-button-icon, #frame-viewer-header-play {
+ filter: invert(1);
+ }
+
+ #player-seekbar {
+ background: #ffffff;
+ }
+
+ #player-seekbar::-webkit-slider-thumb {
+ background: #aaaaaa;
+ }
+
+ #player-seekbar::-moz-range-thumb {
+ background: #aaaaaa;
+ }
+
+ #player-seekbar::-webkit-slider-thumb:hover {
+ background: #aaaaaabf;
+ }
+
+ #player-seekbar::-moz-range-thumb:hover {
+ background: #aaaaaabf;
+ }
+
+ #frame-header, #navigation-outer, #player {
+ background: rgb(32, 32, 32);
+ }
+
+ #frame-header:hover, #navigation-outer:hover, #player:hover {
+ background: rgb(48, 48, 48);
+ }
+
+ .frame-about-link, .frame-home-link {
+ filter: contrast(0.3) brightness(2);
+ }
+} \ No newline at end of file
diff --git a/css/frame-settings.css b/css/frame-settings.css
index d004710..1125235 100644
--- a/css/frame-settings.css
+++ b/css/frame-settings.css
@@ -8,7 +8,7 @@
padding-top: 5px;
}
-#frame-settings-quality-notImplemented {
+#frame-settings-unsupported-warning {
color: #9f0000;
font-size: 12px;
padding-top: 5px;
diff --git a/css/navigation.css b/css/navigation.css
index 2be100e..3b9ac26 100644
--- a/css/navigation.css
+++ b/css/navigation.css
@@ -53,4 +53,37 @@
#navigation-about:active #navigation-about-icon {
opacity: .5;
+}
+
+#outofsupport {
+ white-space: nowrap;
+ position: fixed;
+ z-index: 99;
+ background: #cdb100;
+ font-size: 14px;
+ color: black;
+ left: 0;
+ right: 0;
+ text-align: center;
+ height: 24px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ overflow: hidden;
+}
+
+@media (max-width: 740px) {
+ #outofsupport {
+ font-size: 12px !important;
+ }
+}
+
+@media (max-width: 637px) {
+ #oos-desktop {
+ display: none;
+ }
+}
+
+#navigation-outer, #frame {
+ top: 24px;
} \ No newline at end of file
diff --git a/css/player.css b/css/player.css
index 08da44f..8ff1caf 100644
--- a/css/player.css
+++ b/css/player.css
@@ -1,6 +1,5 @@
#player {
position: fixed;
- bottom: 0;
left: 0;
right: 0;
height: 56px;
@@ -91,4 +90,22 @@
.player-button-disabled .player-button-icon {
opacity: .25 !important;
+}
+
+body #player {
+ bottom: -57px;
+ transition: bottom 200ms, background-color 200ms;
+}
+
+body #navigation-outer, body #frame {
+ bottom: 0;
+ transition: bottom 200ms, background-color 200ms;
+}
+
+body.playing #player {
+ bottom: 0;
+}
+
+body.playing #navigation-outer, body.playing #frame {
+ bottom: 57px;
} \ No newline at end of file
diff --git a/favicon.ico b/favicon.ico
new file mode 100644
index 0000000..a037397
--- /dev/null
+++ b/favicon.ico
Binary files differ
diff --git a/index.php b/index.php
index 1db7b51..efb9487 100644
--- a/index.php
+++ b/index.php
@@ -1,4 +1,4 @@
-<?php if (str_ends_with($_SERVER['HTTP_HOST'], ".familine.minteck.org")) { $_FAMILINE = true; } else { $_FAMILINE = false; } function l($en, $fr) { global $_FAMILINE; if ($_FAMILINE) { return $fr; } else { return $en; } } $root = $_SERVER['DOCUMENT_ROOT']; $root = $_SERVER['DOCUMENT_ROOT']; if ($_FAMILINE) { require_once "/mnt/familine/app/session.php"; } ?>
+<?php if (str_ends_with($_SERVER['HTTP_HOST'], ".familine.minteck.org")) { $_FAMILINE = true; } else { $_FAMILINE = false; } function l($en, $fr) { global $_FAMILINE; if ($_FAMILINE) { return $fr; } else { return $en; } } $root = $_SERVER['DOCUMENT_ROOT']; $root = $_SERVER['DOCUMENT_ROOT']; if ($_FAMILINE) { require_once "/mnt/familine/app/session.php"; }; if (!str_contains($_SERVER['HTTP_USER_AGENT'], "Chrome/")) header("Location: /unsupported") and die(); ?>
<!DOCTYPE html>
<html lang="en" style="overflow:hidden;">
<head>
@@ -21,6 +21,7 @@
}
}
</script>
+ <script src="https://git.equestria.dev/equestria.dev/elac/raw/branch/mane/browser/elac.js"></script>
<style>
#argon-loader {
@@ -78,39 +79,31 @@
}
await sleep(100);
document.getElementById("argon-loader-message").innerText = l("Running JavaScript startup hooks...", "Exécution des modules JavaScript de démarrage...");
- if (window.electronAPI && window.electronAPI.affectMessage) window.electronAPI.affectMessage(document.getElementById("argon-loader-message").innerText);
for (hook of _argonLoadedHooks) {
await sleep(100);
if (hook.name.trim() !== "") {
document.getElementById("argon-loader-message").innerText = l("Running JavaScript startup hooks... ", "Exécution des modules JavaScript de démarrage... ") + hook.name;
- if (window.electronAPI && window.electronAPI.affectMessage) window.electronAPI.affectMessage(document.getElementById("argon-loader-message").innerText);
} else {
document.getElementById("argon-loader-message").innerText = l("Running JavaScript startup hooks... <!>", "Exécution des modules JavaScript de démarrage... <!>");
- if (window.electronAPI && window.electronAPI.affectMessage) window.electronAPI.affectMessage(document.getElementById("argon-loader-message").innerText);
}
hook();
}
document.getElementById("argon-loader-message").innerText = l("Importing style definitions...", "Importation des définitions de style...");
- if (window.electronAPI && window.electronAPI.affectMessage) window.electronAPI.affectMessage(document.getElementById("argon-loader-message").innerText);
window.fetch("/api/get_app_css.php").then(async (a) => {
a.text().then(async (b) => {
files = JSON.parse(b);
for (file of files) {
await sleep(100);
document.getElementById("argon-loader-message").innerText = l("Importing style definitions... ", "Importation des définitions de style... ") + file;
- if (window.electronAPI && window.electronAPI.affectMessage) window.electronAPI.affectMessage(document.getElementById("argon-loader-message").innerText);
await loadStyle(file + "?" + Math.random());
}
await sleep(100);
document.getElementById("argon-loader-message").innerText = l("Resolving songs...", "Résolution des morceaux...");
- if (window.electronAPI && window.electronAPI.affectMessage) window.electronAPI.affectMessage(document.getElementById("argon-loader-message").innerText);
window.fetch("/api/get_list.php").then(async (a) => {
a.text().then(async (b) => {
_argonSongsData = JSON.parse(b);
document.getElementById("argon-loader-message").innerText = l("Loading interface...", "Chargement de l'interface...");
- if (window.electronAPI && window.electronAPI.affectMessage) window.electronAPI.affectMessage(document.getElementById("argon-loader-message").innerText);
document.getElementById("argon-loader").style.display = "none";
- if (window.electronAPI.finishStartup) window.electronAPI.finishStartup();
})
})
})
@@ -122,6 +115,9 @@
</script>
</head>
<body>
+ <div id="outofsupport">
+ Argon is not maintained anymore and will stop working soon<span id="oos-desktop">, we are currently working on an alternative.</span>
+ </div>
<?php if ($_FAMILINE): ?>
<iframe style="position:fixed;left:0;right:0;top:0;border: none;width: 100%;height:32px;" src="https://cdn.familine.minteck.org/statusbar.php"></iframe>
<style>
diff --git a/js/player.js b/js/player.js
index 2c73333..b623eee 100644
--- a/js/player.js
+++ b/js/player.js
@@ -22,7 +22,7 @@ _argonLoadedHooks.push(function ArgonStartupPlayer() {
ArgonPlayer._player.currentTime = 0;
ArgonPlayer._player.play().catch(e => {
console.error(e);
- alert("An error occurred while trying to play this song. Please try again later.");
+ if (e.name !== "NotAllowedError") alert("An error occurred while trying to play this song. Please try again later.");
}).then(() => {
ArgonPlayer._endTriggered = false;
});
@@ -54,25 +54,24 @@ _argonLoadedHooks.push(function ArgonStartupPlayer() {
_setQualityTo: (quality) => {
log("Resolving track " + ArgonPlayer._current + "...");
ArgonPlayer._qualityChangeTime = ArgonPlayer._player.currentTime;
- window.fetch("/api/get_audio_files.php?_=" + ArgonPlayer._current).then((a) => {
- a.text().then((b) => {
- let data = JSON.parse(b);
- ArgonPlayer._currentQuality = quality;
- ArgonPlayer._player.src = data[ArgonPlayer._currentQuality];
- log("Playing " + ArgonPlayer._current);
- ArgonPlayer._player.play().catch(e => {
- console.error(e);
- alert("An error occurred while trying to play this song. Please try again later.");
- }).then(() => {
- ArgonPlayer._player.currentTime = ArgonPlayer._qualityChangeTime;
- ArgonPlayer._endTriggered = false;
- ArgonPlayer._qualityGoingDown = false;
- });
+ ArgonPlayer._currentQuality = quality;
+ // noinspection JSUnresolvedVariable,JSUnresolvedFunction
+ ELAC.quickBlob("https://" + (AppName === "Argon" ? "mediacdn.argon.minteck.org" : "music-audio-media01.familine.minteck.org") + "/" + song + "/" + ArgonPlayer._currentQuality + ".elac", 0).then((blob) => {
+ ArgonPlayer._player.src = blob;
+ log("Playing " + ArgonPlayer._current);
+ ArgonPlayer._player.play().catch(e => {
+ console.error(e);
+ if (e.name !== "NotAllowedError") alert("An error occurred while trying to play this song. Please try again later.");
+ }).then(() => {
+ ArgonPlayer._player.currentTime = ArgonPlayer._qualityChangeTime;
+ ArgonPlayer._endTriggered = false;
+ ArgonPlayer._qualityGoingDown = false;
});
});
},
play: (song) => {
+ document.body.classList.add("playing");
ArgonPlayer._current = song;
document.getElementById("player-artwork").src = "";
@@ -85,28 +84,26 @@ _argonLoadedHooks.push(function ArgonStartupPlayer() {
}
log("Resolving track " + song + "...");
- window.fetch("/api/get_audio_files.php?_=" + song).then((a) => {
- a.text().then((b) => {
- let data = JSON.parse(b);
- if (ArgonPlayer._preferredQualityPreference[0] === "2") {
- ArgonPlayer._currentQuality = "originalpcm";
- } else if (ArgonPlayer._preferredQualityPreference[0] === "0") {
- ArgonPlayer._currentQuality = "high";
- } else {
- ArgonPlayer._currentQuality = ArgonPlayer._preferredQualityPreference[1];
+ if (ArgonPlayer._preferredQualityPreference[0] === "2") {
+ ArgonPlayer._currentQuality = "original";
+ } else if (ArgonPlayer._preferredQualityPreference[0] === "0") {
+ ArgonPlayer._currentQuality = "high";
+ } else {
+ ArgonPlayer._currentQuality = ArgonPlayer._preferredQualityPreference[1];
+ }
+ // noinspection JSUnresolvedVariable,JSUnresolvedFunction
+ ELAC.quickBlob("https://" + (AppName === "Argon" ? "mediacdn.argon.minteck.org" : "music-audio-media01.familine.minteck.org") + "/" + song + "/" + ArgonPlayer._currentQuality + ".elac", 0).then((blob) => {
+ ArgonPlayer._player.src = blob;
+ log("Playing " + song);
+ ArgonPlayer._player.play().catch(e => {
+ if (e.name !== "DOMException") {
+ console.error(e);
+ if (e.name !== "NotAllowedError") alert("An error occurred while trying to play this song. Please try again later.");
}
- ArgonPlayer._player.src = data[ArgonPlayer._currentQuality];
- log("Playing " + song);
- ArgonPlayer._player.play().catch(e => {
- if (e.name !== "DOMException") {
- console.error(e);
- alert("An error occurred while trying to play this song. Please try again later.");
- }
- }).then(() => {
- ArgonPlayer._endTriggered = false;
- });
+ }).then(() => {
+ ArgonPlayer._endTriggered = false;
});
- });
+ })
},
shuffle: () => {
diff --git a/unsupported/index.html b/unsupported/index.html
new file mode 100644
index 0000000..dca612c
--- /dev/null
+++ b/unsupported/index.html
@@ -0,0 +1 @@
+<html><head><title>Argon is not supported on this browser</title></head><body style="margin: 0; display: flex; align-items: center; justify-content: center; background: whitesmoke; color: black;"><div style="text-align: center;"><img src="https://gitlab.minteck.org/uploads/-/system/project/avatar/60/Argon.png" style="width: 96px; border-radius: 10px;"><h2>Argon is not supported on this browser</h2><p>Safari is unable to play Equestria Lossless Audio Codec files, therefore you need to use another browser.</p></div></body></html> \ No newline at end of file
diff --git a/version b/version
index b1d7abc..d876a08 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-0.6.2 \ No newline at end of file
+0.7.1-eol \ No newline at end of file