Live data from Hacker News

Don't animate height

granola.ai

91–100 of 276 posts

Re: Don't animate height

#91
I'm not sure how it's implemented on the JS side, but I can imagine the CSS getting a lot of updates per second as the voice level changes, constantly interrupting the current animation.

Might be worth it to buffer the input until animationEnd() event fires. That might reduce the amount of calculations and redrawing that needs to be done.

Or the CSS engine is robust enough to handle continual updates and this won't solve a thing. I'd have to test it.

Re: Don't animate height

#92
Why do browsers even allow this shit. I was trying out a scheduling app the other day, and it was using 3% of CPU just sitting there doing nothing. That’s a Pentium 1 level of computing power to do jack shit.

Re: Don't animate height

#93
post #33

Is it possible to restrict this as a user? Like to force webpages to use under a certain amount of render/paint time/resources or else just break so that one dumb tab doesn't use up all my battery? Then I can opt-in to greater resources usage if it's a webpage I actually care about. I've seen the "This webpage is using alot of resources" popup before but I don't think it would happen in this case. Because honestly I…

They should put in something that allows users to electroshock web designers for wasting their battery.

Re: Don't animate height

#94
post #78

Earlier quoted context omitted.

Just because it isn't useful to the user doesn't mean some dev hasn't spent the cycles doing it. I know I've personally had to write code that was an absolute waste, but some PM wanted and it was coded. Usually so it can be a bullet point in a demo that impresses low skilled PMs or sales drone, but techy user types just roll their eyes when it's pointed out to them.

I think a mic visualizer is very useful to the user. You can tell if you're quiet, clipping, or your mic straight up isn't working at all.

You've moved the goal posts. Nobody said an input levels indicator isn't useful. We're talking about this specific graphic not being a useful graphic for visualizing live data. You've wandered away from the pack here

Re: Don't animate height

#95
post #58

Earlier quoted context omitted.

This contempt is misplaced. It is obviously better in one sense to generate an animation on the fly using a short program instead of encoded its literal pixels in a much larger amount of data even after compression. The ecosystem has largely moved towards that abstraction because it scales better for virtually every purpose, particularly for rendering in different formats. Now web developers are brought up inside the…

The problem is that everyone (browsers + developers) need to agree on a replacement, which is notoriously hard to do. Chrome got laughed out of the room with Dart/Flutter.

Well they don't really. What ought to happen is someone just makes a new browser (or adds support in an existing browser) unilaterally on an experimental basis. If it's good enough I imagine it would catch on. The limiting factor is presumably that that's a lot of investment for an experiment, but getting anyone else on board without a successful experiment is going to be impossible. (well, also, you have to have a good enough plan to be worth switching. I don't think dart/flutter was that.)

A nice starting place would be if one of the major browsers added an easy to use extension point for swapping out languages. (at least I'm not aware of this existing, nor that I've looked)

Re: Don't animate height

#96
post #58

Earlier quoted context omitted.

This contempt is misplaced. It is obviously better in one sense to generate an animation on the fly using a short program instead of encoded its literal pixels in a much larger amount of data even after compression. The ecosystem has largely moved towards that abstraction because it scales better for virtually every purpose, particularly for rendering in different formats. Now web developers are brought up inside the…

The problem is that everyone (browsers + developers) need to agree on a replacement, which is notoriously hard to do. Chrome got laughed out of the room with Dart/Flutter.

Dart/Flutter was never a technical issue, but a political/monopolistic issue. The underlying monopoly has not changed, so I don't really see a path forward unless the chromium team magically changes leadership.

Re: Don't animate height

#97
post #75
post #69

ironic that the benefit of using web tech (platform abstractions) can be totally negated by such a small footgun, which then requires insane knowledge of the browser rendering pipeline to solve

One problem is that this is supposedly considered insane esoteric knowledge, when the concept of reflows, and why and when they're triggered, ought to be fairly basic knowledge to every reasonably experienced frontend coder. Up there with "O(n^2) may bite you in the ass". But we've decided that optimizing SEO or conversion rates or whatever is much more important than optimizing rendering.

I think there's a bit of an "everybody knows that" [1] phenomenon when it comes to knowledge like this. Devs come from different backgrounds and work on different types of projects. There are 10000 things you expected to know to be an expert, and all of us are continually learning.

[1] https://xkcd.com/1053/

Re: Don't animate height

#98
post #87

I read this article because just last week I set up CSS height transitions to show/hide divs in a form which displays conditional content (based on radio button selection). "Why shouldn't I do this?", I thought. It looks like the point of this article is that you should avoid continuous animation for CPU performance reasons. These performance reasons are probably inconsequential for occasional transitions. For many o…

I created a little CSS-pulsing 'live' button and give it a fixed number of cycles of pulsing to cap worst-case resource consumption. But it took me a while to work out that that was the right thing to do!

Re: Don't animate height

#99
post #93
post #33

Is it possible to restrict this as a user? Like to force webpages to use under a certain amount of render/paint time/resources or else just break so that one dumb tab doesn't use up all my battery? Then I can opt-in to greater resources usage if it's a webpage I actually care about. I've seen the "This webpage is using alot of resources" popup before but I don't think it would happen in this case. Because honestly I…

They should put in something that allows users to electroshock web designers for wasting their battery.

I don't think combined energy output of every power station on Earth would be enough after we have Electron apps for so long. (edit: typo)

Re: Don't animate height

#100

> Instead, we can create the illusion of a changing height by using two rectangles, applying translate to each. Its a very clever solution and props to the engineer, but this being the fix makes me truly despair at where we are as an industry around web UI. That html and css won despite these sorts of counter-intuitive horrors. UI layers that make me feel good reflect intent. I can take an image and write some code t…

I had a similar problem trying to animate a book flipping pages. At the half way point I had to update the text to show the backside and update the back pages.

However no matter what I did, I could not get the update to sync correctly with the page being exactly half way. There's probably a solution but I just gave up

Post reply on HN