this barely ever worked anyways lets just remove smooth scrolling
This commit is contained in:
parent
df7ba22fa1
commit
3fc74738a5
5 changed files with 0 additions and 141 deletions
12
index.html
12
index.html
|
|
@ -3746,18 +3746,6 @@
|
|||
<span class="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<div class="info">
|
||||
<span class="label">Smooth Scrolling</span>
|
||||
<span class="description"
|
||||
>Provides a smoother scrolling experience with Lenis (Experimental)</span
|
||||
>
|
||||
</div>
|
||||
<label class="toggle-switch">
|
||||
<input type="checkbox" id="smooth-scrolling-toggle" />
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<div class="info">
|
||||
<span class="label">Album Cover Background</span>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import { showNotification } from './downloads.js';
|
|||
import { syncManager } from './accounts/pocketbase.js';
|
||||
import { authManager } from './accounts/auth.js';
|
||||
import { registerSW } from 'virtual:pwa-register';
|
||||
import './smooth-scrolling.js';
|
||||
import { openEditProfile } from './profile.js';
|
||||
import { ThemeStore } from './themeStore.js';
|
||||
import './commandPalette.js';
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import {
|
|||
cardSettings,
|
||||
waveformSettings,
|
||||
replayGainSettings,
|
||||
smoothScrollingSettings,
|
||||
downloadQualitySettings,
|
||||
losslessContainerSettings,
|
||||
coverArtSizeSettings,
|
||||
|
|
@ -2170,17 +2169,6 @@ export function initializeSettings(scrobbler, player, api, ui) {
|
|||
});
|
||||
}
|
||||
|
||||
// Smooth Scrolling Toggle
|
||||
const smoothScrollingToggle = document.getElementById('smooth-scrolling-toggle');
|
||||
if (smoothScrollingToggle) {
|
||||
smoothScrollingToggle.checked = smoothScrollingSettings.isEnabled();
|
||||
smoothScrollingToggle.addEventListener('change', (e) => {
|
||||
smoothScrollingSettings.setEnabled(e.target.checked);
|
||||
|
||||
window.dispatchEvent(new CustomEvent('smooth-scrolling-toggle', { detail: { enabled: e.target.checked } }));
|
||||
});
|
||||
}
|
||||
|
||||
// Visualizer Sensitivity
|
||||
const visualizerSensitivitySlider = document.getElementById('visualizer-sensitivity-slider');
|
||||
const visualizerSensitivityValue = document.getElementById('visualizer-sensitivity-value');
|
||||
|
|
|
|||
|
|
@ -1,100 +0,0 @@
|
|||
//js/smooth-scrolling.js
|
||||
import { smoothScrollingSettings } from './storage.js';
|
||||
|
||||
let lenis = null;
|
||||
let lenisLoaded = false;
|
||||
let lenisLoading = false;
|
||||
|
||||
async function loadLenisScript() {
|
||||
if (lenisLoaded) return true;
|
||||
if (lenisLoading) {
|
||||
return new Promise((resolve) => {
|
||||
const checkLoaded = setInterval(() => {
|
||||
if (!lenisLoading) {
|
||||
clearInterval(checkLoaded);
|
||||
resolve(lenisLoaded);
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
||||
lenisLoading = true;
|
||||
|
||||
try {
|
||||
await new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://unpkg.com/@studio-freight/lenis';
|
||||
script.onload = resolve;
|
||||
script.onerror = reject;
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
|
||||
lenisLoaded = true;
|
||||
lenisLoading = false;
|
||||
console.log('✓ Lenis loaded successfully');
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error('✗ Failed to load Lenis:', error);
|
||||
lenisLoaded = false;
|
||||
lenisLoading = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function initializeSmoothScrolling() {
|
||||
if (lenis) return; // Already initialized
|
||||
|
||||
const loaded = await loadLenisScript();
|
||||
if (!loaded) return;
|
||||
|
||||
lenis = new window.Lenis({
|
||||
wrapper: document.querySelector('.main-content'),
|
||||
content: document.querySelector('.main-content'),
|
||||
lerp: 0.1,
|
||||
smoothWheel: true,
|
||||
smoothTouch: false,
|
||||
normalizeWheel: true,
|
||||
wheelMultiplier: 0.8,
|
||||
});
|
||||
|
||||
function raf(time) {
|
||||
if (lenis) {
|
||||
lenis.raf(time);
|
||||
requestAnimationFrame(raf);
|
||||
}
|
||||
}
|
||||
|
||||
requestAnimationFrame(raf);
|
||||
}
|
||||
|
||||
function destroySmoothScrolling() {
|
||||
if (lenis) {
|
||||
lenis.destroy();
|
||||
lenis = null;
|
||||
}
|
||||
}
|
||||
|
||||
async function setupSmoothScrolling() {
|
||||
// Check if smooth scrolling is enabled
|
||||
const smoothScrollingEnabled = smoothScrollingSettings.isEnabled();
|
||||
|
||||
if (smoothScrollingEnabled) {
|
||||
await initializeSmoothScrolling();
|
||||
}
|
||||
|
||||
// Listen for toggle changes
|
||||
window.addEventListener('smooth-scrolling-toggle', async function (e) {
|
||||
if (e.detail.enabled) {
|
||||
await initializeSmoothScrolling();
|
||||
} else {
|
||||
destroySmoothScrolling();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize when DOM is ready
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', setupSmoothScrolling);
|
||||
} else {
|
||||
setupSmoothScrolling();
|
||||
}
|
||||
|
|
@ -599,22 +599,6 @@ export const waveformSettings = {
|
|||
},
|
||||
};
|
||||
|
||||
export const smoothScrollingSettings = {
|
||||
STORAGE_KEY: 'smooth-scrolling-enabled',
|
||||
|
||||
isEnabled() {
|
||||
try {
|
||||
return localStorage.getItem(this.STORAGE_KEY) === 'true';
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
setEnabled(enabled) {
|
||||
localStorage.setItem(this.STORAGE_KEY, enabled ? 'true' : 'false');
|
||||
},
|
||||
};
|
||||
|
||||
export const qualityBadgeSettings = {
|
||||
STORAGE_KEY: 'show-quality-badges',
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue