From c918f67dbf940fa63aea161c898110b5d803862c Mon Sep 17 00:00:00 2001 From: Oj18 Date: Tue, 14 Sep 2021 22:22:02 +0100 Subject: [PATCH] [ProfileStore] Fix scrolling and improve highlight --- CHANGELOG.md | 1 + src/css/store/profileStore.css | 11 +++++++++++ src/gmProfileStore.js | 8 ++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1dd121f..2180fd1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - **Ludicrous speed.** The Store should now be quite faster, especially on low-end hardware. - **Carousel controls in banner images.** Also made modal opening more obvious via cursor. - **Search text hints.** Now shows no results text for no results, and hints to go to an other category if there are results in that and not the current category. + - **Improved profile store.** Better and more reliable scrolling down to card and now highlight clears after a short time. - ### Tweaks Settings - **Added tweaks setting section.** Includes new minor changes you can now toggle on or off. New settings (and more will likely be added in future updates): diff --git a/src/css/store/profileStore.css b/src/css/store/profileStore.css index 8fb55ee3..ae18fb00 100644 --- a/src/css/store/profileStore.css +++ b/src/css/store/profileStore.css @@ -2,6 +2,8 @@ .gm-store-card-mini { width: 100%; height: 74px; + + cursor: pointer; } .gm-store-card-mini > :nth-child(1) { @@ -31,4 +33,13 @@ grid-template-columns: none; flex-flow: row wrap; justify-content: center; +} + +/* Hide controls */ +.gm-store-card-mini .pagination-20ouY7 { + display: none; +} + +.gm-store-card-mini .smallCarouselImage-2Qvg9S { + cursor: unset; } \ No newline at end of file diff --git a/src/gmProfileStore.js b/src/gmProfileStore.js index a0e7cf75..74f5d6d0 100644 --- a/src/gmProfileStore.js +++ b/src/gmProfileStore.js @@ -38,19 +38,23 @@ export default () => { const RoutingUtils = goosemod.webpackModules.findByProps('transitionTo'); - RoutingUtils.transitionTo('/channels/@me'); // Go to home + RoutingUtils.transitionTo('/store'); // Go to home await sleep(200); document.getElementById('gm-home-' + (module.tags.includes('theme') ? 'themes' : 'plugins')).click(); // Go to GM Store themes / plugins page - await sleep(200); + await sleep(2000); // Wait for cards to lazy load const cardEl = [...document.querySelectorAll(`.title-31JmR4 + .colorStandard-2KCXvj`)].filter((x) => x.textContent === module.subtext).pop().parentElement; document.querySelector('#gm-settings-inject').scrollTo({ top: cardEl.offsetTop - 12, behavior: 'smooth' }); // Scroll to card smoothly cardEl.style.boxShadow = '0 0 12px 6px rgb(88 101 242 / 30%)'; // Highlight with message highlight color (improve in future likely) + + setTimeout(() => { + cardEl.style.boxShadow = ''; + }, 15000); } });