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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: Spritz clone in 33 lines of TypeScript. Long words are displayed longer

4 点作者 raymond_goo大约 6 年前
<a href="https:&#x2F;&#x2F;typescript-spritz.stackblitz.io" rel="nofollow">https:&#x2F;&#x2F;typescript-spritz.stackblitz.io</a><p>License is Public Domain&#x2F;CC0 and the code is here: <a href="https:&#x2F;&#x2F;stackblitz.com&#x2F;edit&#x2F;typescript-spritz" rel="nofollow">https:&#x2F;&#x2F;stackblitz.com&#x2F;edit&#x2F;typescript-spritz</a><p>PS: This is a really quick hack because my Spritzlet license ran out and I hated that Spritz doesn&#x27;t show long words longer than short words for a long time.<p>Spritz Homepage for reference: <a href="https:&#x2F;&#x2F;www.spritz.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.spritz.com&#x2F;</a>

2 条评论

rahimnathwani大约 6 年前
This is awesome.<p>I know it&#x27;s just a quick hack, but I&#x27;m curious about this in the code:<p><pre><code> 200 +(30*word.length - 7) </code></pre> I&#x27;ve never used TypeScript, but I&#x27;m assuming this is the same as:<p><pre><code> (200 - 7) +(30*word.length) </code></pre> But I guess you meant:<p><pre><code> 200 +(30*(word.length - 7))</code></pre>
评论 #19715488 未加载
mahesh_rm大约 6 年前
Error in &#x2F;~&#x2F;index.ts (19:21) Cannot read property &#x27;replace&#x27; of undefined
评论 #19715495 未加载