This commit is contained in:
eduardprigoana 2025-11-17 21:43:33 +02:00
parent 34c6c45439
commit ae7fae9b3d
15 changed files with 666 additions and 653 deletions

View file

@ -1,3 +1,4 @@
//js/api.js
import { RATE_LIMIT_ERROR_MESSAGE, deriveTrackQuality, delay } from './utils.js';
import { APICache } from './cache.js';

View file

@ -1,3 +1,5 @@
//js/app.js
import { LosslessAPI } from './api.js';
import { apiSettings, themeManager, nowPlayingSettings } from './storage.js';
import { UIRenderer } from './ui.js';

View file

@ -1,4 +1,4 @@
//cache.js
//js/cache.js
export class APICache {
constructor(options = {}) {
this.memoryCache = new Map();

View file

@ -1,3 +1,4 @@
//js/downloads.js
import { buildTrackFilename, sanitizeForFilename, RATE_LIMIT_ERROR_MESSAGE, getTrackArtists, getTrackTitle, formatTemplate } from './utils.js';
import { lyricsSettings } from './storage.js';

View file

@ -1,3 +1,4 @@
//js/events.js
import { SVG_PLAY, SVG_PAUSE, SVG_VOLUME, SVG_MUTE, REPEAT_MODE, trackDataStore, RATE_LIMIT_ERROR_MESSAGE, buildTrackFilename } from './utils.js';
import { lastFMStorage } from './storage.js';
import { addDownloadTask, updateDownloadProgress, completeDownloadTask } from './downloads.js';

View file

@ -1,4 +1,4 @@
//lastfm.js
//js/lastfm.js
import { delay } from './utils.js';
export class LastFMScrobbler {

View file

@ -1,3 +1,4 @@
//js/lyrics.js
import { getTrackTitle, getTrackArtists } from './utils.js';
export class LyricsManager {

View file

@ -1,3 +1,4 @@
//js/player.js
import { REPEAT_MODE, formatTime, getTrackArtists, getTrackTitle} from './utils.js';
export class Player {

View file

@ -1,3 +1,4 @@
//router.js
export function createRouter(ui) {
const router = () => {
const path = window.location.hash.substring(1) || "home";

View file

@ -1,3 +1,4 @@
//js/settings
import { themeManager, lastFMStorage, nowPlayingSettings, lyricsSettings } from './storage.js';
export function initializeSettings(scrobbler, player, api, ui) {

View file

@ -1,3 +1,4 @@
//storage.js
export const apiSettings = {
STORAGE_KEY: 'monochrome-api-instances',
INSTANCES_URL: 'https://raw.githubusercontent.com/EduardPrigoana/hifi-instances/refs/heads/main/instances.json',

View file

@ -1,3 +1,4 @@
//js/ui-interactions.js
import { formatTime, trackDataStore, getTrackTitle, getTrackArtists } from './utils.js';
export function initializeUIInteractions(player, api) {

View file

@ -1,3 +1,4 @@
//js/ui.js
import { formatTime, createPlaceholder, trackDataStore, hasExplicitContent, getTrackArtists, getTrackTitle, calculateTotalDuration, formatDuration } from './utils.js';
import { recentActivityManager } from './storage.js';

View file

@ -1,4 +1,4 @@
// utils.js
//js/utils.js
export const QUALITY = 'LOSSLESS';

View file

@ -1,3 +1,4 @@
:root {
--spacing-xs: 0.5rem;
--spacing-sm: 0.75rem;