4 ms·
Any idea how to do it?
by octref 10y ago
Any idea how to do it?
- nitwit005 10y agoRemove all the whitespace, and then add spaces and newlines in legal positions to make the wave pattern. Edit: It also seems to add escapes to the text to make it a bit neater than what I suggested.
- deleted 10y ago[deleted]
- asadlionpk 10y agoI want to know this too. Must be some grunt/gulp script.
- j4_james 10y agoAuthor here. It was done with a Python script that parses the CSS into a stream of characters annotated with metadata saying whether the character is allowed to be escaped and whether whitespace can be inserted before or after it. It's then just a matter of breaking up the stream where whitespace is permitted and using the escaping to pad segments to the exact size required. Definitely not recommended in production. Other than the obvious inefficiency, it was only supported in Chrome fairly recently (even though the CSS escaping rules have remained largely unchanged for 20 years or so). In this case, though, the game itself depended on recent bug fixes in Chrome, so there wasn't much point in worrying about compatibility with older versions.