Hey everyone,
I've been busy this morning making some small but important changes to market-viewr
. The first and most significant update is that the tool has been moved to its new, dedicated home at:
Other than the move, I've implemented a couple of quality-of-life improvements. The token icon images now load a temporary placeholder image first, which is then replaced by the actual icon as it lazy-loads into view. This should make the initial page load feel much faster.
I've also added a colorful progress bar to the top of the page that appears when you navigate between pages or when the site is fetching data. Since some of the initial queries can take a moment to load before they are cached, this provides some nice visual feedback that work is being done in the background.
Code Changes
For those interested in the technical details, here are some of the key changes I pushed:
- Developer Tooling: I added a
.pre-commit-config.yaml
to the project to automate code quality checks. It now usesruff-check
for linting ,ruff-format
for code formatting, anddjhtml
to keep the HTML, CSS, and JavaScript tidy. - Image Lazy-Loading: I implemented a custom lazy-loading solution for all token icons. Images now use a
data-src
attribute and a local SVG placeholder, and anIntersectionObserver
loads the real image only when it's close to the viewport. - Page Load Indicator: A new top page loading bar was added to give users feedback during navigation and data fetching. The JavaScript simulates a gradual progress and is managed through
startTopLoadBar
,finishTopLoadBar
, andresetTopLoadBar
functions. - Improved Image URL Validation: The old method for validating image URLs was too strict. I rewrote it to be more flexible, as many of the tokens use CDN paths or omit file extensions. The new version now focuses on blocking obvious script injection vectors like
javascript:
ordata:
URIs. - Resilient Richlist: Previously, if the richlist data failed to load for a token, the entire page would return a "503 - Service Unavailable" error. I've updated the code to be more resilient; now, if the richlist fails, the page will still render successfully, just without that specific section.
As always, Michael Garcia a.k.a. TheCrazyGM