TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Pagemap: A mini map for your website

264 pointsby owenshen24over 5 years ago

16 comments

emmanueloga_over 5 years ago
Pretty clever. I was trying to figure out if there was some DOM API to paint HTML to canvas that I did not know about.... I had to stare at it a few times to realize what was going on :-)<p>The code runs a DOM query to find the elements configured through the keys of the `styles` object on the parameters&#x2F;configuration, then for each of those selectors, calculates a rect relative to the size of the canvas, and paints a colored rectangle for each of those elems (using the color coming form the values on styles). [1]<p>1: <a href="https:&#x2F;&#x2F;github.com&#x2F;lrsjng&#x2F;pagemap&#x2F;blob&#x2F;master&#x2F;src&#x2F;pagemap.js#L93-L100" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lrsjng&#x2F;pagemap&#x2F;blob&#x2F;master&#x2F;src&#x2F;pagemap.js...</a>
_Chiefover 5 years ago
This is really nice work. Tried it out on a blog[1], works really well with content-heavy technical docs. Had to add some custom stylings for new blocks, but that was also pretty easy to do.<p>1: <a href="https:&#x2F;&#x2F;peteretelej.github.io&#x2F;setup-ubuntu-vps" rel="nofollow">https:&#x2F;&#x2F;peteretelej.github.io&#x2F;setup-ubuntu-vps</a>
评论 #20745856 未加载
hs86over 5 years ago
I am currently trying out this Chrome extension [0] which brings a mini map to each website and my first impression is rather positive. The performance impact might be a little too much on my older laptop but on the desktop it seems fine (for now). I don&#x27;t know if this is any useful but it just looks nice. :)<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;chintown&#x2F;monocle" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;chintown&#x2F;monocle</a>
hyperpalliumover 5 years ago
Funny, the demo on that page doesn&#x27;t work for me (mobile, FF), but the other two examples do (at least, I assume they&#x27;re working correctly - a minimap with a grey band for the viewer):<p><a href="https:&#x2F;&#x2F;larsjung.de&#x2F;pagemap&#x2F;latest&#x2F;demo&#x2F;boxes.html" rel="nofollow">https:&#x2F;&#x2F;larsjung.de&#x2F;pagemap&#x2F;latest&#x2F;demo&#x2F;boxes.html</a><p><a href="https:&#x2F;&#x2F;larsjung.de&#x2F;pagemap&#x2F;latest&#x2F;demo&#x2F;text.html" rel="nofollow">https:&#x2F;&#x2F;larsjung.de&#x2F;pagemap&#x2F;latest&#x2F;demo&#x2F;text.html</a>
TekMolover 5 years ago
That reminds me that I sometimes like to switch to a &quot;Show me only function names&quot; view in VIM.<p>This kinda solves it:<p><pre><code> :%g&#x2F;^{&#x2F;normal! zf% </code></pre> To make the info lines dimmer, this works:<p><pre><code> :hi Folded ctermfg=239 :hi Folded ctermbg=233 </code></pre> Only problem is that comments outside of functions are still displayed.
评论 #20744525 未加载
fredleyover 5 years ago
This is great. Minimaps are so useful when editing code I&#x27;m amazed nobody&#x27;s thought to do them for web. For viewing documentation in particular this would be amazing.
vorticoover 5 years ago
This is really cool and looks&#x2F;feels a lot like the Sublime Text minimap, which I use a lot. I have a feeling it might be abused a lot though, like scroll wheel hijacking.
Mr_Moduloover 5 years ago
Hey it&#x27;s like Sublime Text!<p>I don&#x27;t see how this is useful. It reminds me of the redundant scroll indicators on the top of some websites.
评论 #20747444 未加载
makachover 5 years ago
Nice achievement! But is it just an approximation of the content? It does not appear to be a scaled-down version of the web page - so I wonder how useful it really is. I wish there was a more substantial demo page with more graphical artefacts.
评论 #20747474 未加载
strider12over 5 years ago
the only thing this needs is a way to display text on the mini-map.. this is so we can manually add titles so we know what we might be scrolling towards. small tiny text. this functionality seems to be missing from most mini-maps.
gitgudover 5 years ago
Great little library, can the title be renamed to include &quot;Show HN: &quot;?<p>Not sure if you have to be the author of the <i>thing</i>, to use the &quot;Show HN: &quot; title tag... but it would be helpful to people browsing...
评论 #20744777 未加载
nfozover 5 years ago
If this is useful, then it&#x27;s something the browser could render, instead of the page itself. We could add it to desktop UI toolkits like Gtk&#x2F;Qt.
zapzupnzover 5 years ago
I&#x27;d love to see this done with the page map features from Xcode, with clickable section headings that show up on mouseover and so on.
als0over 5 years ago
It feels really nice and minimal. I just wish it only appeared while scrolling, as it distracts me while I read the page content.
评论 #20750641 未加载
pseingatlover 5 years ago
Couldn&#x27;t get it to work.
评论 #20744028 未加载
评论 #20745044 未加载
thomasfromcdnjsover 5 years ago
Amazing work