Comment by adolph
6 hours ago
It is interesting to think about the socio-technical reasons to make a serverside roundtrip for each keypress. Another approach might be to load up the dictionary client-side and use javascript to swap letterforms in various pre-determined locations. Presumably using browser-text with a transparent background wouldn't sufficiently simulate what the real product looked like.
It helps that it's not very big. In the working demo, the image is 132x26, and the actual JPEG file size is about 2-4 kB (depending on the text).
So even on a 56k modem, it might take less than 1 second to load each image.
You could also optimize it so it skips intermediate images if the user types fast. Suppose the user mashes "12345" in a fraction of a second. You start loading "1.jpg" on the first keypress. When you've finished loading "1.jpg", the field contains "12345", so skip straight to loading "12345.jpg".
The demo page's JS doesn't seem to include any optimization code like that. It just updates the img src whenever the text changes. Yet my browser seems to do it automatically! If I mash several keys, the console network log shows only some intermediate images get loaded.
I guess the browser is smart enough to know that, by the time it would have started the download, the resource no longer exists in the page. I'm not sure if browsers ~20 years ago did this, but it would have been worthwhile given how slow networks were.
Yes, this is pretty much how we did such things already in the 1990s. The problem with this is that this only supports a predefined, rather limitted character set. But you could have expanded on this and may have loaded custom characters on demand (which would have been a rather small payload for a single character.) But there's yet another problem, namely color management, which isn't supported by GIF (which we need for the transparent background), and they probably really wanted to go with JPEG for this. (At that time, CRTs were still much around and those tended to show greys with a reddish tint when managed badly. Something Apple would have certainly wanted to avoid.)
BTW, here's a PoC (a website from 1998 written in about two hours [so not much of hassle even then] demoing pure JS rendering from a data file, all just classic table layout rendered in the browser, all styled text and the ticker are rendered from single-character images): https://www.masswerk.at/demospace/relayWeb_en/welcome.htm
Basically, it was easier. Or even... barely even possible to do what you describe. Maybe you could, but it would have been nightmarish whack-a-mole, and a good chance that the next update to any given browser would break it completely.
In ‘05, you had IE6, plenty of folks still on IE5, IE5 for Mac was still in use (don’t be fooled by the name - it did not behave like IE5 on windows), safari was 2.0, respectable but still a minority browser, and Firefox was on 1.0. Plenty of folks were still on Netscape navigator, which by that point was actively decomposing.
IE6 was what you built for, as it was the majority browser by a country mile. Transparency was hit and miss. Alpha PNGs just weren’t supported, you had to hack them in via JS.
Most websites were laid out using <table>. Using a <div> was new and exotic.
Oh, and you could only do custom fonts using… flash. sIFR, if you want to delve into the hell that was web dev back then. Most folks would just end up with TNR. Transparency on sIFR you could only achieve by replicating your background into the SWF, and good luck getting it to line up.
So. Support an absolute soup of edge cases across a bunch of different browser engines, and deal with “IT LOOKS NOTHING LIKE IT DID ON THE WEBPAGE” from customers, or just do it server side.
Also, it was perfectly acceptable to wait for a website to load - 50% of the U.S. was still on dialup, and “broadband” was commonly 512k.
I remember transparency was handled with gifs back then, which had their own problems and limitations.
Alignment was either done via position: absolute or by using a table. The animated background here would be a bit more complicated with a table.
Risk of it breaking with some upgrade, or looking different for some people? As you said, very likely.
So server-side image generation was indeed the best option. And it was a popular and widely solved problem, even in the 90s: visit counters that showed the visits in the shape of an image were super popular.
Yes, you could have done similar with GIFs already with Netscape 3 and IE 3 (I think, IE 3.1, or was this just the Mac version?). "Dynamic HTML" with z-layering became a thing with Netscape 4.0 and Internet Explorer 4.0, which became available in Summer/Fall 1997. With this, relative positioning and proportional text (at variable character width) wouldn't have been a problem.
(With the NS/IE 3 generation, you would have been limited to lines of prepositioned fixed-width characters in a table. So, not really applicable for this.)
I think, the decisive factor may have been badly managed CRTs tending to display greys with a somewhat reddish hue (esp. on Windows, not so much on Macs with a screen gamma of 1.8) and JPEGs generally enjoying better color support. (JPEG was displayed at sRGB or at any embedded IEC profile, which wasn't available for GIF, where the effective color was pretty much hit and miss. So, if you had HTML text with a defined hex-color, a GIF of the same color wouldn't match, while a sRGB JPEG would. Matching JPEG and GIF colors would have posed a similar problem. A reddish hue on grey looked kind of cheap and brownish text was probably the last thing Apple would have wanted.)
Yeah, transparency on gifs is binary, so you always had a crunchy edge. Plenty of use cases, but nice looking text wasn't one of them.
And position: absolute did not behave the same way across IE, NN, FF, or safari.
For some reason I feel the sudden urge to have a drink.
Just don't tell the kids about how eCommerce used to work. Credit card number in an email, courtesy of Mal's eCommerce? Pretty much industry standard. shudders, swigs
Lots of things were different on the front end back then:
- IE was an albatross around every web developers neck - Even better browsers like Firefox and Safari had tons of inconsistencies - jQuery and Prototype weren't around yet - CSS is not remotely close to what it is today
Honestly, placing text over an image was a lofty task back then. We used to use lots of images with text as part of the image. Text images and table layouts were two of the main ways to get around all those cross-browser issues.
Oh yeah, I forgot what the table layout stuff used to be like. Since the back has a shine gradient across the back, each position would need all the possible characters. iirc, in that period an article on A List Apart [0] proposed something like that. I think they were doing curved box corners and sending all corners in the same file and using background positioning to only show the portion of the image depicting that corner. As I scan the article it is heavy on CSS positioning, which is used in the demo but I recall IE5 had quirks.
How true to period is the demo? I see in the source "I've tried to preserve the core of this code as it was when I wrote it in June 2005." but most of the page is a static image in the background.
0. https://alistapart.com/article/sprites/
The demo is taken from the archive of my work back then, so it’s all true to that period.
On my site it shows a static background image just to give the demo something contextual to play against. On the actual site the page was obviously all live HTML.