style: auto-fix linting issues
This commit is contained in:
parent
8cc1c0dfe5
commit
6ed58333e7
8 changed files with 172 additions and 161 deletions
|
|
@ -1,15 +1,15 @@
|
||||||
import type { CapacitorConfig } from '@capacitor/cli';
|
import type { CapacitorConfig } from '@capacitor/cli';
|
||||||
|
|
||||||
const config: CapacitorConfig = {
|
const config: CapacitorConfig = {
|
||||||
appId: 'tf.monochrome.music',
|
appId: 'tf.monochrome.music',
|
||||||
appName: 'monochrome',
|
appName: 'monochrome',
|
||||||
webDir: 'dist',
|
webDir: 'dist',
|
||||||
assets: {
|
assets: {
|
||||||
iconBackgroundColor: '#000000',
|
iconBackgroundColor: '#000000',
|
||||||
iconBackgroundColorDark: '#000000',
|
iconBackgroundColorDark: '#000000',
|
||||||
splashBackgroundColor: '#000000',
|
splashBackgroundColor: '#000000',
|
||||||
splashBackgroundColorDark: '#000000',
|
splashBackgroundColorDark: '#000000',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
{
|
{
|
||||||
"images": [
|
"images": [
|
||||||
{
|
{
|
||||||
"idiom": "universal",
|
"idiom": "universal",
|
||||||
"size": "1024x1024",
|
"size": "1024x1024",
|
||||||
"filename": "AppIcon-512@2x.png",
|
"filename": "AppIcon-512@2x.png",
|
||||||
"platform": "ios"
|
"platform": "ios"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info": {
|
||||||
|
"author": "xcode",
|
||||||
|
"version": 1
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
"info": {
|
|
||||||
"author": "xcode",
|
|
||||||
"version": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"info" : {
|
"info": {
|
||||||
"version" : 1,
|
"version": 1,
|
||||||
"author" : "xcode"
|
"author": "xcode"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,56 +1,56 @@
|
||||||
{
|
{
|
||||||
"images": [
|
"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": [
|
|
||||||
{
|
{
|
||||||
"appearance": "luminosity",
|
"idiom": "universal",
|
||||||
"value": "dark"
|
"filename": "Default@1x~universal~anyany.png",
|
||||||
}
|
"scale": "1x"
|
||||||
],
|
},
|
||||||
"idiom": "universal",
|
|
||||||
"scale": "1x",
|
|
||||||
"filename": "Default@1x~universal~anyany-dark.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"appearances": [
|
|
||||||
{
|
{
|
||||||
"appearance": "luminosity",
|
"idiom": "universal",
|
||||||
"value": "dark"
|
"filename": "Default@2x~universal~anyany.png",
|
||||||
}
|
"scale": "2x"
|
||||||
],
|
},
|
||||||
"idiom": "universal",
|
|
||||||
"scale": "2x",
|
|
||||||
"filename": "Default@2x~universal~anyany-dark.png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"appearances": [
|
|
||||||
{
|
{
|
||||||
"appearance": "luminosity",
|
"idiom": "universal",
|
||||||
"value": "dark"
|
"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",
|
"info": {
|
||||||
"scale": "3x",
|
"version": 1,
|
||||||
"filename": "Default@3x~universal~anyany-dark.png"
|
"author": "xcode"
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
"info": {
|
|
||||||
"version": 1,
|
|
||||||
"author": "xcode"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -2913,7 +2913,6 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
headerAccountIcon.style.display = 'block';
|
headerAccountIcon.style.display = 'block';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function showUpdateNotification(updateCallback) {
|
function showUpdateNotification(updateCallback) {
|
||||||
|
|
|
||||||
|
|
@ -553,7 +553,10 @@ export function initializePlayerEvents(player, audioPlayer, scrobbler, ui) {
|
||||||
setupMediaListeners(player.video);
|
setupMediaListeners(player.video);
|
||||||
}
|
}
|
||||||
|
|
||||||
playPauseBtn.addEventListener('click', () => { hapticMedium(); player.handlePlayPause(); });
|
playPauseBtn.addEventListener('click', () => {
|
||||||
|
hapticMedium();
|
||||||
|
player.handlePlayPause();
|
||||||
|
});
|
||||||
nextBtn.addEventListener('click', () => {
|
nextBtn.addEventListener('click', () => {
|
||||||
hapticMedium();
|
hapticMedium();
|
||||||
trackSkipTrack(player.currentTrack, 'next');
|
trackSkipTrack(player.currentTrack, 'next');
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,15 @@ let _ImpactStyle = null;
|
||||||
let _NotificationStyle = null;
|
let _NotificationStyle = null;
|
||||||
|
|
||||||
// Single stored promise — subsequent calls reuse the same one
|
// Single stored promise — subsequent calls reuse the same one
|
||||||
const _ready = import('@capacitor/haptics').then((mod) => {
|
const _ready = import('@capacitor/haptics')
|
||||||
_Haptics = mod.Haptics;
|
.then((mod) => {
|
||||||
_ImpactStyle = mod.ImpactStyle;
|
_Haptics = mod.Haptics;
|
||||||
_NotificationStyle = mod.NotificationStyle;
|
_ImpactStyle = mod.ImpactStyle;
|
||||||
}).catch(() => {
|
_NotificationStyle = mod.NotificationStyle;
|
||||||
// Not in Capacitor or haptics not available — fall back to navigator.vibrate
|
})
|
||||||
});
|
.catch(() => {
|
||||||
|
// Not in Capacitor or haptics not available — fall back to navigator.vibrate
|
||||||
|
});
|
||||||
|
|
||||||
function vibrateFallback(ms) {
|
function vibrateFallback(ms) {
|
||||||
if (navigator.vibrate) navigator.vibrate(ms);
|
if (navigator.vibrate) navigator.vibrate(ms);
|
||||||
|
|
@ -22,7 +24,10 @@ function vibrateFallback(ms) {
|
||||||
export async function hapticLight() {
|
export async function hapticLight() {
|
||||||
await _ready;
|
await _ready;
|
||||||
try {
|
try {
|
||||||
if (_Haptics) { await _Haptics.impact({ style: _ImpactStyle.Light }); return; }
|
if (_Haptics) {
|
||||||
|
await _Haptics.impact({ style: _ImpactStyle.Light });
|
||||||
|
return;
|
||||||
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
vibrateFallback(30);
|
vibrateFallback(30);
|
||||||
}
|
}
|
||||||
|
|
@ -31,7 +36,10 @@ export async function hapticLight() {
|
||||||
export async function hapticMedium() {
|
export async function hapticMedium() {
|
||||||
await _ready;
|
await _ready;
|
||||||
try {
|
try {
|
||||||
if (_Haptics) { await _Haptics.impact({ style: _ImpactStyle.Medium }); return; }
|
if (_Haptics) {
|
||||||
|
await _Haptics.impact({ style: _ImpactStyle.Medium });
|
||||||
|
return;
|
||||||
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
vibrateFallback(50);
|
vibrateFallback(50);
|
||||||
}
|
}
|
||||||
|
|
@ -40,7 +48,10 @@ export async function hapticMedium() {
|
||||||
export async function hapticSuccess() {
|
export async function hapticSuccess() {
|
||||||
await _ready;
|
await _ready;
|
||||||
try {
|
try {
|
||||||
if (_Haptics) { await _Haptics.notification({ type: _NotificationStyle.Success }); return; }
|
if (_Haptics) {
|
||||||
|
await _Haptics.notification({ type: _NotificationStyle.Success });
|
||||||
|
return;
|
||||||
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
vibrateFallback(40);
|
vibrateFallback(40);
|
||||||
}
|
}
|
||||||
|
|
@ -49,7 +60,10 @@ export async function hapticSuccess() {
|
||||||
export async function hapticLongPress() {
|
export async function hapticLongPress() {
|
||||||
await _ready;
|
await _ready;
|
||||||
try {
|
try {
|
||||||
if (_Haptics) { await _Haptics.impact({ style: _ImpactStyle.Medium }); return; }
|
if (_Haptics) {
|
||||||
|
await _Haptics.impact({ style: _ImpactStyle.Medium });
|
||||||
|
return;
|
||||||
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
vibrateFallback(50);
|
vibrateFallback(50);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,76 +1,71 @@
|
||||||
{
|
{
|
||||||
"name": "Monochrome Music",
|
"name": "Monochrome Music",
|
||||||
"short_name": "Monochrome",
|
"short_name": "Monochrome",
|
||||||
"description": "A minimalist music streaming application",
|
"description": "A minimalist music streaming application",
|
||||||
"start_url": "./",
|
"start_url": "./",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"display_override": [
|
"display_override": ["window-controls-overlay"],
|
||||||
"window-controls-overlay"
|
"background_color": "#000000",
|
||||||
],
|
"theme_color": "#000000",
|
||||||
"background_color": "#000000",
|
"orientation": "portrait-primary",
|
||||||
"theme_color": "#000000",
|
"icons": [
|
||||||
"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": [
|
|
||||||
{
|
{
|
||||||
"src": "assets/96.png",
|
"src": "assets/icons/icon-48.webp",
|
||||||
"sizes": "96x96",
|
"type": "image/png",
|
||||||
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue