Added GET APP modal

This commit is contained in:
Aleksandr Bogomiakov committed 2026-11-24 14:53:38 +02:00
1 parent a301d89d56
commit 2352f359f4
8 files changed
+178 -4

No files matched your search

+9
View File
@@ -441,6 +441,15 @@ translations! {
player_settings_connect: "Connect" , "Подключить";
player_settings_reconnect: "Reconnect" , "Переподключить";
player_settings_disconnect: "Disconnect" , "Отключить";
player_get_app: "Get app", "Скачать приложение";
player_app_terminal_client: "Terminal client", "Консольный клиент";
player_app_binaries: "Binaries", "Бинарники";
player_app_latest_release: "Latest release", "Последний релиз";
player_app_arch_repo: "Arch repository", "Репозиторий Arch";
player_app_arch_guide: "Check the Arch repository for package availability. You can also download the Linux archive, extract it, and run the binary from the extracted folder.", "Проверьте наличие пакета в репозитории Arch. Также можно скачать архив для Linux, распаковать его и запустить бинарник из распакованной папки.";
player_app_macos_guide: "On an Apple Silicon Mac with Homebrew, run these commands in Terminal.", "На Mac с Apple Silicon и установленным Homebrew выполните эти команды в Терминале.";
player_app_windows_guide: "Download the Windows x86-64 ZIP from the release assets, extract it, and run this command in PowerShell from the extracted folder.", "Скачайте ZIP для Windows x86-64 из файлов релиза, распакуйте его и выполните эту команду в PowerShell из распакованной папки.";
player_app_binary_guide: "In the release assets, choose the archive for your system and processor. Extract it and run the executable from the extracted folder.", "Выберите в файлах релиза архив для вашей системы и процессора. Распакуйте его и запустите исполняемый файл из распакованной папки.";
player_log_out: "Log out" , "Выйти";
player_admin_panel: "Admin Panel" , "Админка";
player_info: "Info" , "Информация";
+4
View File
@@ -24,6 +24,9 @@ if ('serviceWorker' in navigator) {
{% include "player/collection_styles.html" %}
{% include "player/listening_styles.html" %}
<style>{% include "player/dialog_styles.css" %}</style>
{% if !guest %}
<style>{% include "player/get_app.css" %}</style>
{% endif %}
{% if downloads_enabled %}
<style>
{% include "player/download_manager.css" %}
@@ -36,6 +39,7 @@ if ('serviceWorker' in navigator) {
{% block body %}
{% include "player/shell.html" %}
{% include "player/modals.html" %}
{% if !guest %}{% include "player/get_app.html" %}{% endif %}
{% include "player/lyrics_modal.html" %}
{% include "player/offline_scripts.html" %}
{% include "player/offline_manager_scripts.html" %}
+5
View File
@@ -42,6 +42,11 @@
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 6h9m4 0h3M4 12h2m4 0h10M4 18h8m4 0h4"/><circle cx="15" cy="6" r="2"/><circle cx="8" cy="12" r="2"/><circle cx="14" cy="18" r="2"/></svg>
{{ t.nav_settings }}
</button>
<button type="button" aria-haspopup="dialog" aria-controls="get-app-dialog"
@click="$store.user.menuOpen = false; $store.user.getAppOpen = true">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3v12m-4-4 4 4 4-4M4 16v4h16v-4"/></svg>
{{ t.player_get_app }}
</button>
<a data-online-only href="/admin/" x-show="$store.user.profile?.role === 'admin'" x-cloak>
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3 4.5 6v5c0 4.5 3.2 8 7.5 10 4.3-2 7.5-5.5 7.5-10V6z"/><path d="m9 12 2 2 4-4"/></svg>
{{ t.player_admin_panel }}
+83
View File
@@ -0,0 +1,83 @@
.get-app-body {
display: grid;
gap: 12px;
padding: var(--dialog-gutter);
}
.get-app-client {
min-width: 0;
padding: 14px;
border: 1px solid var(--border-color);
border-radius: 12px;
}
.get-app-client h3, .get-app-guide h4 {
margin: 0;
font-size: 1rem;
}
.get-app-client-type, .get-app-guide p {
margin: 4px 0 0;
color: var(--text-secondary);
font-size: .875rem;
line-height: 1.5;
}
.get-app-tiles {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 8px;
margin-top: 12px;
}
.get-app-tile {
display: grid;
justify-items: center;
align-content: center;
gap: 6px;
min-height: 66px;
padding: 8px 4px;
border: 1px solid var(--border-color);
border-radius: 8px;
background: var(--bg-elevated);
color: var(--text-primary);
font: inherit;
font-size: .8125rem;
cursor: pointer;
}
.get-app-tile svg { width: 22px; height: 22px; fill: currentColor; }
.get-app-tile:hover { background: var(--bg-active); }
.get-app-tile[aria-expanded="true"] { border-color: var(--accent); }
.get-app-tile:focus-visible, .get-app-links a:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.get-app-guides { display: grid; }
.get-app-guide {
grid-area: 1 / 1;
min-width: 0;
margin-top: 12px;
padding: 12px;
border-radius: 8px;
background: var(--bg-elevated);
}
.get-app-guide[inert] { pointer-events: none; }
.get-app-guide pre {
margin: 8px 0 0;
padding: 8px 10px;
border-radius: 6px;
background: var(--bg-secondary);
white-space: pre-wrap;
overflow-wrap: anywhere;
font-size: .8125rem;
}
.get-app-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.get-app-links a {
color: var(--text-primary);
font-size: .875rem;
text-decoration: underline;
text-underline-offset: 3px;
}
@media (max-width: 480px) {
.get-app-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
.get-app-tile { transition: background-color 140ms, border-color 140ms; }
.get-app-guide-enter, .get-app-guide-leave { transition: opacity 140ms, transform 140ms; }
.get-app-guide-hidden { opacity: 0; transform: translateY(-3px); }
}
+18
View File
@@ -0,0 +1,18 @@
<template x-if="$store.user.getAppOpen">
<dialog id="get-app-dialog" class="player-dialog" aria-labelledby="get-app-title" style="--dialog-width: 570px"
x-data x-init="$nextTick(() => { if ($el.isConnected) { $el.showModal(); document.getElementById('get-app-title').focus() } })"
@dismiss-player-dialog.stop="$store.user.closeGetApp($el)"
@cancel.prevent="$store.user.closeGetApp($el)" @click.self="$store.user.closeGetApp($el)" @keydown.space.stop>
<div class="player-dialog-surface">
{% let dialog_head_class = "" %}
{% let dialog_title_id = "get-app-title" %}
{% let dialog_title = t.player_get_app %}
{% let dialog_icon = "M12 3v12m-4-4 4 4 4-4M4 16v4h16v-4" %}
{% let show_version = false %}
{% include "player/dialog_header.html" %}
<div class="get-app-body">
{% include "player/get_app_tui.html" %}
</div>
</div>
</dialog>
</template>
+27
View File
@@ -0,0 +1,27 @@
{% macro tile(guide, label, icon) %}
<button class="get-app-tile" type="button" aria-controls="{{ guide }}"
:aria-expanded="activeGuide === $el.getAttribute('aria-controls')"
@click="const guide = $el.getAttribute('aria-controls'); activeGuide = activeGuide === guide ? null : guide">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="{{ icon }}"/></svg>
{{ label }}
</button>
{% endmacro %}
{% macro guide(id, title, description, command, link, link_label, extra_link, extra_label) %}
<section class="get-app-guide" id="{{ id }}" x-cloak
x-show="activeGuide === $el.id" :inert="activeGuide === $el.id ? null : true"
x-transition:enter="get-app-guide-enter" x-transition:enter-start="get-app-guide-hidden"
x-transition:leave="get-app-guide-leave" x-transition:leave-end="get-app-guide-hidden">
<h4>{{ title }}</h4>
<p>{{ description }}</p>
{% if !command.is_empty() %}
<pre><code>{{ command }}</code></pre>
{% endif %}
<div class="get-app-links">
<a href="{{ link }}" target="_blank" rel="noopener noreferrer">{{ link_label }}</a>
{% if !extra_link.is_empty() %}
<a href="{{ extra_link }}" target="_blank" rel="noopener noreferrer">{{ extra_label }}</a>
{% endif %}
</div>
</section>
{% endmacro %}
+18
View File
@@ -0,0 +1,18 @@
{% import "player/get_app_platform.html" as platform %}
{% let releases = "https://github.com/Furumi-stack/furumi-tui/releases/latest" %}
<section class="get-app-client" aria-labelledby="get-app-tui-title" x-data="{ activeGuide: null }">
<h3 id="get-app-tui-title">Furumi TUI</h3>
<p class="get-app-client-type">{{ t.player_app_terminal_client }}</p>
<div class="get-app-tiles">
{% call platform::tile("get-app-tui-arch", "Arch Linux", "M12 2 9.2 8.6l1.5 1.8-2.1-.6L3 21c2.5-1.5 4.9-2.5 7-2.9-.2-.5-.3-1-.3-1.6 0-1.7 1-3 2.3-3s2.3 1.3 2.3 3c0 .6-.1 1.1-.3 1.6 2.1.4 4.5 1.4 7 2.9l-3.6-7.2-2.5-1.5 1.8.3z") %}{% endcall %}
{% call platform::tile("get-app-tui-macos", "macOS", "M17.1 12.3c0-1.8.9-3.1 2.4-4-1-1.4-2.4-2.1-4.2-2.2-1.7-.1-2.7 1-3.6 1-.9 0-2.2-1-3.6-1C5.6 6.2 3 8.2 3 12c0 2.1.8 4.4 1.9 6 1 1.5 2 3 3.6 3 1.5 0 2-1 3.7-1s2.1 1 3.7 1 2.6-1.4 3.6-2.9c.7-1 1.1-2.1 1.4-2.9-2.2-.9-3.8-2-3.8-3zm-2.6-7.6c.8-1 1.3-2.2 1.2-3.5-1.2.1-2.6.8-3.4 1.8-.8.9-1.4 2.2-1.3 3.4 1.3.1 2.7-.7 3.5-1.7z") %}{% endcall %}
{% call platform::tile("get-app-tui-windows", "Windows", "M3 3h8v8H3zm10 0h8v8h-8zM3 13h8v8H3zm10 0h8v8h-8z") %}{% endcall %}
{% call platform::tile("get-app-tui-binaries", t.player_app_binaries, "M11 3h2v10l3.5-3.5L18 11l-6 6-6-6 1.5-1.5L11 13zm-7 15h2v2h12v-2h2v4H4z") %}{% endcall %}
</div>
<div class="get-app-guides">
{% call platform::guide("get-app-tui-arch", "Arch Linux", t.player_app_arch_guide, "./furumi", releases, t.player_app_latest_release, "https://github.com/house-of-vanity/arch_repo", t.player_app_arch_repo) %}{% endcall %}
{% call platform::guide("get-app-tui-macos", "macOS · Homebrew", t.player_app_macos_guide, "brew install house-of-vanity/tap/furumi\nfurumi", "https://github.com/house-of-vanity/homebrew-tap", "Homebrew tap", "", "") %}{% endcall %}
{% call platform::guide("get-app-tui-windows", "Windows", t.player_app_windows_guide, ".\\furumi.exe", releases, t.player_app_latest_release, "", "") %}{% endcall %}
{% call platform::guide("get-app-tui-binaries", t.player_app_binaries, t.player_app_binary_guide, "", releases, t.player_app_latest_release, "", "") %}{% endcall %}
</div>
</section>
+14 -4
View File
@@ -592,6 +592,7 @@ document.addEventListener('alpine:init', () => {
accessStatus: "anonymous",
menuOpen: false,
settingsOpen: false,
getAppOpen: false,
settingsFocus: 'user-settings-title',
lastfm: { configured: false, connected: false, username: null, reauth_required: false, last_error: null },
lastfmBusy: false,
@@ -710,13 +711,22 @@ document.addEventListener('alpine:init', () => {
const dialog = document.querySelector('.user-settings-overlay[open]');
await finishPlayerDialog(dialog, () => {
this.settingsOpen = false;
Alpine.nextTick(() => {
const triggers = document.querySelectorAll('.sidebar-account-trigger, .mobile-account-chip');
Array.from(triggers).find(button => button.getClientRects().length)?.focus({preventScroll:true});
});
Alpine.nextTick(() => this.focusAccountTrigger());
});
},
async closeGetApp(dialog) {
await finishPlayerDialog(dialog, () => {
this.getAppOpen = false;
Alpine.nextTick(() => this.focusAccountTrigger());
});
},
focusAccountTrigger() {
const triggers = document.querySelectorAll('.sidebar-account-trigger, .mobile-account-chip');
Array.from(triggers).find(button => button.getClientRects().length)?.focus({preventScroll:true});
},
initials() {
const name = this.profile?.name || '';
return name.trim().charAt(0) || '?';