From 6ed58333e7061a2c4aafd86e0d2c465c8f05f09f Mon Sep 17 00:00:00 2001 From: edidealt <196915955+edidealt@users.noreply.github.com> Date: Sun, 22 Mar 2026 19:13:04 +0000 Subject: [PATCH] style: auto-fix linting issues --- capacitor.config.ts | 18 +-- .../AppIcon.appiconset/Contents.json | 24 +-- ios/App/App/Assets.xcassets/Contents.json | 10 +- .../Splash.imageset/Contents.json | 100 ++++++------- js/app.js | 1 - js/events.js | 5 +- js/haptics.js | 36 +++-- public/manifest.json | 139 +++++++++--------- 8 files changed, 172 insertions(+), 161 deletions(-) diff --git a/capacitor.config.ts b/capacitor.config.ts index a7235f4..2c24003 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -1,15 +1,15 @@ import type { CapacitorConfig } from '@capacitor/cli'; const config: CapacitorConfig = { - appId: 'tf.monochrome.music', - appName: 'monochrome', - webDir: 'dist', - assets: { - iconBackgroundColor: '#000000', - iconBackgroundColorDark: '#000000', - splashBackgroundColor: '#000000', - splashBackgroundColorDark: '#000000', - }, + appId: 'tf.monochrome.music', + appName: 'monochrome', + webDir: 'dist', + assets: { + iconBackgroundColor: '#000000', + iconBackgroundColorDark: '#000000', + splashBackgroundColor: '#000000', + splashBackgroundColorDark: '#000000', + }, }; export default config; diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json index b1a8483..fa7dcdd 100644 --- a/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,14 +1,14 @@ { - "images": [ - { - "idiom": "universal", - "size": "1024x1024", - "filename": "AppIcon-512@2x.png", - "platform": "ios" + "images": [ + { + "idiom": "universal", + "size": "1024x1024", + "filename": "AppIcon-512@2x.png", + "platform": "ios" + } + ], + "info": { + "author": "xcode", + "version": 1 } - ], - "info": { - "author": "xcode", - "version": 1 - } -} \ No newline at end of file +} diff --git a/ios/App/App/Assets.xcassets/Contents.json b/ios/App/App/Assets.xcassets/Contents.json index da4a164..9e0da7c 100644 --- a/ios/App/App/Assets.xcassets/Contents.json +++ b/ios/App/App/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file + "info": { + "version": 1, + "author": "xcode" + } +} diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json b/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json index 84a416d..5c8a45c 100644 --- a/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +++ b/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json @@ -1,56 +1,56 @@ { - "images": [ - { - "idiom": "universal", - "filename": "Default@1x~universal~anyany.png", - "scale": "1x" - }, - { - "idiom": "universal", - "filename": "Default@2x~universal~anyany.png", - "scale": "2x" - }, - { - "idiom": "universal", - "filename": "Default@3x~universal~anyany.png", - "scale": "3x" - }, - { - "appearances": [ + "images": [ { - "appearance": "luminosity", - "value": "dark" - } - ], - "idiom": "universal", - "scale": "1x", - "filename": "Default@1x~universal~anyany-dark.png" - }, - { - "appearances": [ + "idiom": "universal", + "filename": "Default@1x~universal~anyany.png", + "scale": "1x" + }, { - "appearance": "luminosity", - "value": "dark" - } - ], - "idiom": "universal", - "scale": "2x", - "filename": "Default@2x~universal~anyany-dark.png" - }, - { - "appearances": [ + "idiom": "universal", + "filename": "Default@2x~universal~anyany.png", + "scale": "2x" + }, { - "appearance": "luminosity", - "value": "dark" + "idiom": "universal", + "filename": "Default@3x~universal~anyany.png", + "scale": "3x" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "idiom": "universal", + "scale": "1x", + "filename": "Default@1x~universal~anyany-dark.png" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "idiom": "universal", + "scale": "2x", + "filename": "Default@2x~universal~anyany-dark.png" + }, + { + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ], + "idiom": "universal", + "scale": "3x", + "filename": "Default@3x~universal~anyany-dark.png" } - ], - "idiom": "universal", - "scale": "3x", - "filename": "Default@3x~universal~anyany-dark.png" + ], + "info": { + "version": 1, + "author": "xcode" } - ], - "info": { - "version": 1, - "author": "xcode" - } -} \ No newline at end of file +} diff --git a/js/app.js b/js/app.js index 61a7de9..6f54b0d 100644 --- a/js/app.js +++ b/js/app.js @@ -2913,7 +2913,6 @@ document.addEventListener('DOMContentLoaded', async () => { headerAccountIcon.style.display = 'block'; }); } - }); function showUpdateNotification(updateCallback) { diff --git a/js/events.js b/js/events.js index 9ed6b0a..5c77005 100644 --- a/js/events.js +++ b/js/events.js @@ -553,7 +553,10 @@ export function initializePlayerEvents(player, audioPlayer, scrobbler, ui) { setupMediaListeners(player.video); } - playPauseBtn.addEventListener('click', () => { hapticMedium(); player.handlePlayPause(); }); + playPauseBtn.addEventListener('click', () => { + hapticMedium(); + player.handlePlayPause(); + }); nextBtn.addEventListener('click', () => { hapticMedium(); trackSkipTrack(player.currentTrack, 'next'); diff --git a/js/haptics.js b/js/haptics.js index e1966f8..18ebeb1 100644 --- a/js/haptics.js +++ b/js/haptics.js @@ -6,13 +6,15 @@ let _ImpactStyle = null; let _NotificationStyle = null; // Single stored promise — subsequent calls reuse the same one -const _ready = import('@capacitor/haptics').then((mod) => { - _Haptics = mod.Haptics; - _ImpactStyle = mod.ImpactStyle; - _NotificationStyle = mod.NotificationStyle; -}).catch(() => { - // Not in Capacitor or haptics not available — fall back to navigator.vibrate -}); +const _ready = import('@capacitor/haptics') + .then((mod) => { + _Haptics = mod.Haptics; + _ImpactStyle = mod.ImpactStyle; + _NotificationStyle = mod.NotificationStyle; + }) + .catch(() => { + // Not in Capacitor or haptics not available — fall back to navigator.vibrate + }); function vibrateFallback(ms) { if (navigator.vibrate) navigator.vibrate(ms); @@ -22,7 +24,10 @@ function vibrateFallback(ms) { export async function hapticLight() { await _ready; try { - if (_Haptics) { await _Haptics.impact({ style: _ImpactStyle.Light }); return; } + if (_Haptics) { + await _Haptics.impact({ style: _ImpactStyle.Light }); + return; + } } catch {} vibrateFallback(30); } @@ -31,7 +36,10 @@ export async function hapticLight() { export async function hapticMedium() { await _ready; try { - if (_Haptics) { await _Haptics.impact({ style: _ImpactStyle.Medium }); return; } + if (_Haptics) { + await _Haptics.impact({ style: _ImpactStyle.Medium }); + return; + } } catch {} vibrateFallback(50); } @@ -40,7 +48,10 @@ export async function hapticMedium() { export async function hapticSuccess() { await _ready; try { - if (_Haptics) { await _Haptics.notification({ type: _NotificationStyle.Success }); return; } + if (_Haptics) { + await _Haptics.notification({ type: _NotificationStyle.Success }); + return; + } } catch {} vibrateFallback(40); } @@ -49,7 +60,10 @@ export async function hapticSuccess() { export async function hapticLongPress() { await _ready; try { - if (_Haptics) { await _Haptics.impact({ style: _ImpactStyle.Medium }); return; } + if (_Haptics) { + await _Haptics.impact({ style: _ImpactStyle.Medium }); + return; + } } catch {} vibrateFallback(50); } diff --git a/public/manifest.json b/public/manifest.json index 6e1c895..7a5b790 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,76 +1,71 @@ { - "name": "Monochrome Music", - "short_name": "Monochrome", - "description": "A minimalist music streaming application", - "start_url": "./", - "display": "standalone", - "display_override": [ - "window-controls-overlay" - ], - "background_color": "#000000", - "theme_color": "#000000", - "orientation": "portrait-primary", - "icons": [ - { - "src": "assets/icons/icon-48.webp", - "type": "image/png", - "sizes": "48x48", - "purpose": "any maskable" - }, - { - "src": "assets/icons/icon-72.webp", - "type": "image/png", - "sizes": "72x72", - "purpose": "any maskable" - }, - { - "src": "assets/icons/icon-96.webp", - "type": "image/png", - "sizes": "96x96", - "purpose": "any maskable" - }, - { - "src": "assets/icons/icon-128.webp", - "type": "image/png", - "sizes": "128x128", - "purpose": "any maskable" - }, - { - "src": "assets/icons/icon-192.webp", - "type": "image/png", - "sizes": "192x192", - "purpose": "any maskable" - }, - { - "src": "assets/icons/icon-256.webp", - "type": "image/png", - "sizes": "256x256", - "purpose": "any maskable" - }, - { - "src": "assets/icons/icon-512.webp", - "type": "image/png", - "sizes": "512x512", - "purpose": "any maskable" - } - ], - "categories": [ - "music", - "entertainment" - ], - "shortcuts": [ - { - "name": "Search", - "short_name": "Search", - "description": "Search for music", - "url": "./#search", - "icons": [ + "name": "Monochrome Music", + "short_name": "Monochrome", + "description": "A minimalist music streaming application", + "start_url": "./", + "display": "standalone", + "display_override": ["window-controls-overlay"], + "background_color": "#000000", + "theme_color": "#000000", + "orientation": "portrait-primary", + "icons": [ { - "src": "assets/96.png", - "sizes": "96x96", - "type": "image/png" + "src": "assets/icons/icon-48.webp", + "type": "image/png", + "sizes": "48x48", + "purpose": "any maskable" + }, + { + "src": "assets/icons/icon-72.webp", + "type": "image/png", + "sizes": "72x72", + "purpose": "any maskable" + }, + { + "src": "assets/icons/icon-96.webp", + "type": "image/png", + "sizes": "96x96", + "purpose": "any maskable" + }, + { + "src": "assets/icons/icon-128.webp", + "type": "image/png", + "sizes": "128x128", + "purpose": "any maskable" + }, + { + "src": "assets/icons/icon-192.webp", + "type": "image/png", + "sizes": "192x192", + "purpose": "any maskable" + }, + { + "src": "assets/icons/icon-256.webp", + "type": "image/png", + "sizes": "256x256", + "purpose": "any maskable" + }, + { + "src": "assets/icons/icon-512.webp", + "type": "image/png", + "sizes": "512x512", + "purpose": "any maskable" } - ] - } - ] + ], + "categories": ["music", "entertainment"], + "shortcuts": [ + { + "name": "Search", + "short_name": "Search", + "description": "Search for music", + "url": "./#search", + "icons": [ + { + "src": "assets/96.png", + "sizes": "96x96", + "type": "image/png" + } + ] + } + ] }