Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions app/src/main/assets/genres/genres.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,6 @@
padding-bottom: calc(var(--nav-height, 76px) + var(--safe-bottom, 0px) + 48px);
}

/* ── Pull-to-refresh ─────────────────────────────────────────── */
.genres-pull-indicator {
display: flex; justify-content: center; align-items: center;
height: 0; overflow: hidden;
transition: height 0.22s cubic-bezier(0.4,0,0.2,1);
margin-bottom: 0;
}
.genres-pull-indicator.visible { height: 52px; margin-bottom: 4px; }
.genres-pull-spinner {
width: 36px; height: 36px; border-radius: 50%;
background: var(--md-surface-container-high);
display: flex; align-items: center; justify-content: center;
box-shadow: 0 2px 8px rgba(0,0,0,0.28);
transition: transform 0.18s ease;
}
.genres-pull-icon {
font-size: 18px; color: var(--md-primary);
font-variation-settings: 'FILL' 0,'wght' 400,'GRAD' 0,'opsz' 20;
transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.genres-pull-indicator.refreshing .genres-pull-icon {
animation: genrePullSpin 0.75s linear infinite;
}
@keyframes genrePullSpin { to { transform: rotate(360deg); } }

/* ── Header ──────────────────────────────────────────────────── */
.genres-header {
display: flex; align-items: flex-start;
Expand Down
7 changes: 0 additions & 7 deletions app/src/main/assets/genres/genres.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@

<div class="page-scroll genres-screen" id="genresPageRoot">

<!-- ── Pull-to-refresh indicator ──────────────────────────── -->
<div id="genresPullIndicator" class="genres-pull-indicator hidden">
<div class="genres-pull-spinner">
<span class="material-symbols-rounded genres-pull-icon">refresh</span>
</div>
</div>

<!-- ── Header ──────────────────────────────────────────────── -->
<div class="genres-header">
<div class="genres-header-text">
Expand Down
59 changes: 0 additions & 59 deletions app/src/main/assets/genres/genres.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
// ── Module state ──────────────────────────────────────────────
let _genresFilterOpen = false;
let _genresPeriod = 'overall';
let _genresPTRActive = false;
let _genresPTRStartY = 0;
let _genresPTRThreshold = 72;

// Genre detail state
let _gDetailName = '';
Expand Down Expand Up @@ -61,7 +58,6 @@ async function screen_genres() {
_genresShowError('Enter your username and API key in Settings first.', 'No credentials found');
return;
}
_initGenresPTR();
await _genresLoad();
}

Expand Down Expand Up @@ -123,61 +119,6 @@ function setGenrePeriod(period) {
_genresLoad();
}

// ── Pull-to-refresh ───────────────────────────────────────────
let _ptrWired = false;

function _initGenresPTR() {
if (_ptrWired) return;
_ptrWired = true;
const scroller = document.querySelector('[data-screen="genres"]');
if (!scroller) return;
let startY = 0, pulling = false;
scroller.addEventListener('touchstart', (e) => {
if (scroller.scrollTop > 4) return;
startY = e.touches[0].clientY;
pulling = true;
}, { passive: true });
scroller.addEventListener('touchmove', (e) => {
if (!pulling) return;
const dy = e.touches[0].clientY - startY;
if (dy <= 0) { pulling = false; return; }
const indicator = document.getElementById('genresPullIndicator');
if (!indicator) return;
const progress = Math.min(dy / _genresPTRThreshold, 1);
if (dy > 12) {
indicator.classList.remove('hidden');
indicator.classList.toggle('visible', dy > 32);
const icon = indicator.querySelector('.genres-pull-icon');
if (icon) icon.style.transform = `rotate(${progress * 180}deg)`;
}
}, { passive: true });
scroller.addEventListener('touchend', (e) => {
if (!pulling) return;
pulling = false;
const dy = (e.changedTouches[0]?.clientY || 0) - startY;
const indicator = document.getElementById('genresPullIndicator');
if (dy >= _genresPTRThreshold && !_genresPTRActive) {
_genresPTRActive = true;
indicator?.classList.add('refreshing');
const icon = indicator?.querySelector('.genres-pull-icon');
if (icon) icon.style.transform = '';
_genresLoad().finally(() => {
_genresPTRActive = false;
if (indicator) {
indicator.classList.remove('refreshing', 'visible');
setTimeout(() => indicator.classList.add('hidden'), 240);
}
});
} else {
if (indicator) {
indicator.classList.remove('visible');
setTimeout(() => indicator.classList.add('hidden'), 220);
const icon = indicator.querySelector('.genres-pull-icon');
if (icon) icon.style.transform = '';
}
}
}, { passive: true });
}

// ── Data fetch ────────────────────────────────────────────────
async function _genresFetch(period) {
Expand Down
Loading
Loading