kristopolous / BOOTSTRA.386

A vintage 1980s DOS inspired Twitter Bootstrap theme

Home Page:https://bootstra386.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a decent ansi-to-html converter

kristopolous opened this issue · comments

so this an another aside. There's a bunch of these actually but they always have a one-pass approach. I don't want to finger point, you can find them yourself but basically they make a <style> as essentially a lookup table and then do a preg-replace of escape codes with spans or even worse do just inline css. Essentially you turn complex ansi graphics into a giant honking file that brings every mobile phone under $400 to their knees weeping.

Instead I want to do a multi-pass approach essentially using the true color gif hack. Basically you'll have about 20 spans preformatted, absolutely positioned in a container.

You do a pass essentially for 'background colors' which isn't background colors, it's a full-block unicode character https://www.fileformat.info/info/unicode/char/2588/index.htm with the text color set as the background.

Then on top of this you do the character colors, this is ignoring the blink, which you can certainly add. So essentially you get a bunch of spans layered on top of each other filling in the gaps of the other ones and hopefully hopefully hopefully the browser will not want to huff blue smoke over that (although it might just as well)