Animating Layouts with the FLIP Technique for jank free layout transitions.

Animating Layouts with the FLIP Technique for jank free layout transitions.

FLIP is a mnemonic device and technique which stands for First, Last, Invert, Play.

First: before anything happens, record the current (i.e., first) position and dimensions of the element that will transition. You can use getBoundingClientRect() for this, as will be shown below.

Last: execute the code that causes the transition to instantaneously happen, and record the final (i.e., last) position and dimensions of the element.*

Invert: since the element is in the last position, we want to create the illusion that it’s in the first position, by using transform to modify its position and dimensions. This takes a little math, but it’s not too difficult.

Play: with the element inverted (and pretending to be in the first position), we can move it back to its last position by setting its transform to none.

Is this the real life, is this just fantasy

Is this the real life, is this just fantasy

From the article:

There’s rising worry that corporations are taking over America. But after reviewing a slew of the bids by cities and states wooing Amazon’s massive second headquarters, I don’t think “takeover” quite captures what’s going on.

More like “surrender.”

Chicago has offered to let Amazon pocket $1.32 billion in income taxes paid by its own workers. This is truly perverse. Called a personal income-tax diversion, the workers must still pay the full taxes, but instead of the state getting the money to use for schools, roads or whatever, Amazon would get to keep it all instead.

“The result is that workers are, in effect, paying taxes to their boss,” says a report on the practice from Good Jobs First, a think tank critical of many corporate subsidies. […]

The most far-reaching offer is from Fresno, California. That city of half a million isn’t offering any tax breaks. Instead it has a novel plan to give Amazon special authority over how the company’s taxes are spent.

Fresno promises to funnel 85 percent of all taxes and fees generated by Amazon into a special fund. That money would be overseen by a board, half made up of Amazon officers, half from the city. They’re supposed to spend the money on housing, roads and parks in and around Amazon. […]

Is it even legal to give a company direct sway over civic spending like that? When asked about it, Fresno’s economic-development director threw the public interest under the bus.

“Rather than the money disappearing into a civic black hole, Amazon would have a say on where it will go,” he told the Los Angeles Times. “Not for the fire department on the fringe of town, but to enhance their own investment in Fresno.”

You poor fools out on the fringe of town. All this time you’ve been paying your taxes, thinking it was for the broader public good. Suckers.

In which I disagree with the sage Carl Sagan.

In which I disagree with the sage Carl Sagan.

Anti-intellectualism is neither created nor destroyed.

Old Carl probably wasn’t feeling very optimistic in 1995—after all, he was dead a year later—but in my experience the process “dumbing down” has neither increased nor decreased. It was just as prevalent in the past just as it will be in the future.

Carl would probably hate the present era too even more than the 1990s and yet for all the dumbness, more people today have more access to information than at any point in history. Knowledge is no longer a scarce commodity locked away and no inquiring mind is prevented from learning whatever it is interested in. This is actually a great time for the autodidact and people are sharing skills and learning tools at an accelerating pace.

It’s easy to downplay the changes that have happened over the last thirty years but don’t judge them superficially. Certainly TV and cinema would be the last places to look for signs of this. The internet and supporting technologies have transformed the intellectual background of our global society and we are only just starting to see its implications.

Originally shared by ****

Carl Sagan in 1995

John Hardy Turnbull delenda est’s prediction about a bunch of “shitty” compilers targeting WebAssembly is already…

Originally shared by Ramin Honary

John Hardy Turnbull delenda est’s prediction about a bunch of “shitty” compilers targeting WebAssembly is already turning out to be correct. Here is a project (although I feel bad calling them “shitty,” they’re working hard on it) trying to port musl libc to WebAssembly, with the goal of then using Clang to compile LLVM bytecode to WebAssembly statically linking musl libc to power the Haskell Runtime System (RTS). Since GHC Haskell alreaedy targets LLVM, this would mean any Haskell program will run in the browser, complete with optimizations. Whether the WebAssembly+musl libc emitted by Clang will be well optimized to run on a browser is another question entirely, but almost certainly the answer is “no,” it won’t be well optimized, hence “shitty,” though not bad at all for an experimental project.