Another element of my "why browsers must die" linked list is how some parts of it assume everything is a flexible rectangular viewport with fixed dimensions, and other parts assume it's an infinite plane with no fixed dimensions.

For example, scroll into view:
If a browser is an infinite plane that you view through a viewport (like a video game), then there *must* be a way to cause interactions when some element of the infinite plane comes into view. Yet, finding an event for this very necessary thing is impossible.
Here's a hilarious stackoverflow:

stackoverflow.com/questions/4870…

It was asked *11 years ago*, but was active *11 days ago*. It's been viewed 727k times, and has as many possible answers as there are people posting over various years.
The way to explain this failing is, imagine you're using a game engine, and you build this massive 2D world, like a side-scroller Mario style, but for some weird reason the devs on the engine decided to *not* let you know when one of your characters is visible in the viewport.
When you ask for this feature, they whine back at you, "BUT, this game is all about the viewport. You should be able to work just within that." When you point out that you've built this whole huge side scrolling world like they said you should, they go, "But...uhh PHONES!"
Alright, so if it's all about the viewport, and that's the only thing you're allowed to actually interact with, then why can't we decide that a viewed webpage *only* fits the viewport? If I can't get events when the viewport is moved, then I need to remove infinite scroll.
When you demand that, they go, "OHhh nooooo, you see we're a *document* view system, not a *screen* system." That means, you *have* to accept an infinite scrolled and sized document and can't declare "this document exactly fits the screen".

Ok then...infinite field...
Well then if it's an infinite field that I display to the user with a viewport...then why can't I get an event when an element of the *document* is in view?

Honestly, I'd love these browser companies to stop hiring HTML/CSS gurus and start hiring game engine developers.
So, there is a proposed solution to this called the "intersection observer":

developer.mozilla.org/en-US/docs/Web…

And, it's the typical "we tried to copy Java and failed" code style withAllYourCamelCaseBelongToMe big wording and complex APIs. Crafting objects that call callbacks that call..
Code like this just really irritates me to no end. IntersectionObserver? I have to build my own threshold ratios? Look, all I want is this:

<div onVisible="doThatThing()">

And you figure this junk out. Computer do math for me. Not the other way around.
So once you do all of that, how do you find out if something is visible in the viewport?

"It's easy! You just have to create an observer and then monitor ratios across a 5th dimensional hyper plane using abstract cartesian coordinates mapped to a Hilbert space monad."

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Zed A. Shaw, Writer

Zed A. Shaw, Writer Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @lzsthw

22 Dec
Played a little more Subsistence this morning and I'm convinced it's actually a sci-fi game. You wake up in an enclosed part of Alaska, fenced off, and build a base with an electronic unit attached to a wall that generates power and fabricates items from loot you get in bags.
I could see a back story to the game that's similar to The Prisoner, where you have no idea why you're stuck here, but it's some kind of punishment/experiment, and the bags of loot are dropped to see what you'd do. This would also explain to impossible things:
1. That shooting an animal from about 1 mile away lets the animal instantly know where you are and run that 1 mile in 2 seconds to kill you. They *have* to be genetically engineered super wolves and bears, so sci-fi.
Read 8 tweets
20 Dec
I'm on a killing spree of BS technology giant companies force on us. For weeks I've been "cleaning up CSS" by simply using flexbox and CSS grids for layout. Today, I want to rant about DMARC, DKIM, and BIMI as my next BS standards topic:
I recently had Sendgrid shutdown my email for a week without telling me because one single "malicious email" apparently went through their servers, even though they couldn't prove it or provide any logs. I then tried SocketLabs, and they went down for a whole day for no reason.
That means I'm going to now try to do my own email hosting and comply with all the following standards as best I can:

1. SPF
2. DMARC
3. DKIM
4. BIMI .... whatever that is.

I'm using the tool mxtoolbox.com to help me diagnose the configuration.
Read 25 tweets
20 Dec
All day yesterday I played Subsistence:

store.steampowered.com/app/418030/Sub…

And "all day" means "12 hours non-stop". I'm just going to say all these OpenWorld Crafting Survival games are research. Uhhhh yeah, research 'cause I have no idea how they are so addicting. Some ideas:
So far I've played hundreds of hours in:

Subnautica (both versions)
The Forest
Windbound
Breathedge
No Man's Sky
Subsistence
Stranded Deep
Grounded

They all have particular elements that make them nearly impossible to stop playing which are very similar to gambling.
I'd say the three elements that make the games appealing--not necessarily addicting--are:

1. Open World allows for adventure and exploration plus an amount of fear.
2. Survival adds a game mechanic that doesn't require complex or many enemies.
3. Crafting gives leveling up.
Read 19 tweets
18 Dec
Today I discovered VisBug:

github.com/GoogleChromeLa…

It's *almost* the CSS debugging tool I want, except for one glaringly obvious flaw.
First, here's a demo of me using it to analyze and mess with my Twitter page:
Now, I'm going to try to adjust the padding on some elements. Notice how it seems like I'm having trouble getting anything to move, and then the page reloads and goes somewhere weird? That's because it uses the keyboard for adjustment.
Read 6 tweets
5 Dec
I started playing Stranded Deep a few days ago and it's a really nice survival simulation, but suffers from the same clunky joystick controls that Subnautica, Windbound, and Astroneer all have. I think I've pinned down what's going on with these games and mouse vs. joystick.
When they develop the controls for the mouse they treat the "scene" as simply a flat projection, so whatever you can see can be picked up. I've picked up things an estimated 4m away with my hand using the mouse, and I can grab things when the mouse is nowhere near the object.
Meanwhile, with a joystick, I have to be within a realistic 1m range of the item, and put the tiny little dot exactly on it or nothing. This means it's entirely the programmers penalizing the joystick with "realism" and nothing to do with the joystick's motion abilities.
Read 13 tweets
5 Dec
Continuing my self-eduction on using just flexbox/grid to do layouts, I did a quick replica of Google's main page. It's the simplest one. Here's the outcome, the tags, and the CSS. But wait, there's more!
You think, "So what, you replicated the simplest page possible." Yes, but, that single .svelte file's layout adapts so that it works as either a full page, or *a panel component* without modification. Flexbox allows you to make adaptable components much more easily.
All I did to make that work is this code. Import the Google.svelte, put the <Google/> tag, and done. That entire page flexes right into the space I gave it in the grid layout without modification.

Not sure how useful that is for a whole page, but great for other things.
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!