[ProfileStore] Fix scrolling and improve highlight

pull/55/head
Oj18 3 years ago
parent 7609b9561f
commit c918f67dbf

@ -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):

@ -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;
}

@ -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);
}
});

Loading…
Cancel
Save