5 ms·
The game logic is held within the CSS, which has a rather beautiful obfuscation/formatting applied: http://kong.xn--8ws00zhy3a.com/kong.css http://kong.xn--8ws0
by paulirish 10y ago
The game logic is held within the CSS, which has a rather beautiful obfuscation/formatting applied: http://kong.xn--8ws00zhy3a.com/kong.css http://kong.xn--8ws00zhy3a.com/kong.css
- octref 10y agoAny 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.
- huphtur 10y agoCheck out what happens if you disable the CSS. In Firefox: Tools / Web Developer / Style Editor / Toggle style sheet visibility (the little eye icon).
- amelius 10y agoIt makes transferring the CSS less efficient, so probably not to be recommended.