The blink tag of Web 2.0 has arrived.
It's already here: Material Design "ripple" effect.
Show HN: Wiv.js – A library for a more wiggly div
21–30 of 58 posts
Re: Show HN: Wiv.js – A library for a more wiggly div
#22This would have been absolutely huge on MySpace.
I sense a second coming soon
Re: Show HN: Wiv.js – A library for a more wiggly div
#23This is rad and obnoxious at the same time
Re: Show HN: Wiv.js – A library for a more wiggly div
#24This is rad and obnoxious at the same time
The quintessential eighties.
Re: Show HN: Wiv.js – A library for a more wiggly div
#25Very cool - hopefully ads won't usurp this...
Re: Show HN: Wiv.js – A library for a more wiggly div
#26This should come built in in all modern browsers.
Browsers are getting too feature laden. Soon nobody will be able to write a browser from scratch. Instead, let users implement the features they need, or let them use libraries if necessary.
Re: Show HN: Wiv.js – A library for a more wiggly div
#27Wiggle wiggle click me stanger
Wiggle wiggle buy me flowers
Re: Show HN: Wiv.js – A library for a more wiggly div
#28Upvoting because it's wednesday.
Re: Show HN: Wiv.js – A library for a more wiggly div
#29I opened this on my Notebook, and it's Fan spun out of control!
it might be my ancient hardware, but this is rather CPU intensive it seems.
But the effect is fun, and cool non the less!
(on Linux, Xorg + Frirefox)
Re: Show HN: Wiv.js – A library for a more wiggly div
#30move these things into initWiv() and cache them:
var speed = parseFloat(wivCurve.parentNode.dataset.wivSpeed)
var height = parseFloat(wivCurve.parentNode.dataset.wivHeight)
var tightness = parseFloat(wivCurve.parentNode.dataset.wivTightness)
var thickness = parseFloat(wivCurve.parentNode.dataset.wivThickness)
var ctx = wivCurve.getContext("2d");
do this once on init, the canvas context remembers it anyway: ctx.strokeStyle = wivCurve.parentNode.dataset.wivColor != undefined ? wivCurve.parentNode.dataset.wivColor : "#FF0000"
don't convert numbers and strings all the time, use numbers and init them to 0 //current frame is tracked on per wiv basis. This is to help with speed calculations
if (parseFloat(wivCurve.dataset.count) > 100000) {
wivCurve.dataset.count = "0";
}
wivCurve.dataset.count = (wivCurve.dataset.count ? parseFloat(wivCurve.dataset.count) : 0) + speed;
parseFloat(wivCurve.dataset.count) also is used a lot in that loop.And don't set unneccessary canvas state, this should happen only once per draw loop iteration: [edit, actually, as I said above, the canvas contexts remember it individually, so do this once in initWiv(), and not in the draw loop at all, yay!]
ctx.lineWidth = thickness;
That's all just at first glance, but I bet you, this would help with slow laptops and whatnot :) Such "small" things really add up when you do them 60 times per second * number of borders. I don't know if setting the canvas width or height to the value it has anyway to clear it (instead of clearing/drawing a rectangle explicitly) is still a useful thing to do, but you might try that as well.