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.

Wub - Cool Javascript effect

55 pointsby nickbover 16 years ago

9 comments

old-greggover 16 years ago
This is so awesome that we get to reimplement the same graphics effects we did on first PCs from the mid 80s, but this time - fully loading CPUs on machines that would have been cosidered supercomputers back then!<p>It's called progress. And because of it, we programmers will never be out of work.
评论 #405188 未加载
评论 #405458 未加载
axodover 16 years ago
This bit is quite funny: Function to work out approximate width of a word based on Arial font letter widths.<p>Probably possible to do by putting the word in an offscreen div with style set so it's only as wide as content, then checking the size of the div...<p><pre><code> function fontWidth(word){ // arial font var S = "a68b68c68d68e68f31g68h68i31j31k68l31m108\ n68o68p68q68r39s68t39u68v50w90x68y68z68A\ 90B90C90D90E90F78G98H90I28J59K90L68M108N\ 90O98P90Q98R90S90T68U90V90W130X68Y90Z68'\ 30.42!29?68-41/41=72"; var l = word.length; var s = 0; var x = 0; var c = 0; for(i=0;i&#60;l;i++){ c = word.charAt(i); x = S.indexOf(c); if(c&#62;="0" &#38;&#38; c&#60;="9")s+=69; else if(x&#62;=0)s+=parseInt(S.substring(x+1,x+4)); else s+=68; } return s/10; }</code></pre>
评论 #405607 未加载
btw0over 16 years ago
Have you guys checked out <a href="http://monstropolis.org" rel="nofollow">http://monstropolis.org</a>, I think it's from the same guy.<p>EDIT: I found more: <a href="http://monstropolis.org/intro" rel="nofollow">http://monstropolis.org/intro</a>[1-11].html, replace [1-11] with any number between 1 and 11.
zzzmarcusover 16 years ago
It's funny, now that Javascript interpreters are getting fast and decent effects can be written in Javascript you start seeing lots pages like this.<p>I say it's funny because it reminds me of the explosion of similar animations that were created in Flash a few years around the time that Flash 5 and 6 came out. Animations that were mostly cool and revolutionary-seeming because of the technology rather than the actual content.<p>I'm not knocking this type of creation--I was really fun time to be working in Flash with so many 'breakthroughs.' Now it's cool to see a similar surge in creativity happening in a language that is even more ubiquitous than ActionScript.
评论 #406354 未加载
MoeDrippinsover 16 years ago
it. made. my. machine. very. slow.<p>Interesting, I guess. What purpose though other than "neat"? I'm trying to come up with a UI need it would fulfill, but can't.<p>Mind you, I love neat for the sake of it, and if that's the intent, well and good. But wondered if there was something else I was overlooking.
评论 #404958 未加载
评论 #404904 未加载
评论 #405624 未加载
评论 #404905 未加载
评论 #404903 未加载
评论 #405148 未加载
tlrobinsonover 16 years ago
It makes it kind of hard to click the green links.
axodover 16 years ago
This leaves blue "snow" artifacts on Safari 3.2.1. Seems like there's a bug in Safari's rendering.<p>Cool effect though.
评论 #404902 未加载
ideamonkover 16 years ago
Wow!! this is amazing... waiting for Doom II clone in Javascript :)
reviconover 16 years ago
Neat!