TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: I made a bookmarklet to make HN headlines easier to scan

2 点作者 notmysql_大约 1 年前
Last night I hacked together a little JS snippet that changes the font size of headlines to their associated score on a log scale. You can see an example screenshot here =&gt; <a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;Cr0weKW.png" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;Cr0weKW.png</a><p><pre><code> const SCALE = 2; const bl_children = document.getElementsByTagName(&quot;tbody&quot;)[2].children; for(let i = 1; i &lt; bl_children.length-1; i += 3){ const title = bl_children[i-1].children[2].children[0].children[0]; const score_body = bl_children[i]; const score = parseInt(score_body.children[1].children[0].children[0].innerText.split(&quot; &quot;)[0],10); const size = Math.log2(score+13.33&#x2F;SCALE) * SCALE; title.style.fontSize = size + &quot;px&quot;; }</code></pre>

暂无评论

暂无评论