
Show HN: Spritz clone in 33 lines of TypeScript. Long words are displayed longer - raymond_goo
<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>
======
rahimnathwani
This is awesome.

I know it's just a quick hack, but I'm curious about this in the code:

    
    
      200 +(30*word.length - 7)
    

I've never used TypeScript, but I'm assuming this is the same as:

    
    
      (200 - 7) +(30*word.length)
    

But I guess you meant:

    
    
      200 +(30*(word.length - 7))

~~~
raymond_goo
Thanks! I fixed it. (And added slider)

------
mahesh_rm
Error in /~/index.ts (19:21) Cannot read property 'replace' of undefined

~~~
raymond_goo
Can you please report the exact browser version and platform you are using ? I
will try to fix it.

