... the <div id="comic"> is relatively positioned (or more importantly, non-statically positioned) and each image is absolutely positioned within it, as well as re-sized. As you move the mouse, some intense number crunching is done to recalculate new values for the top and left CSS properties of each image.
发布评论
评论(3)
每个图像都分为多个图层 - 每个图层都是其自己的 PNG 文件,并且包含大量透明度。
所有这些图像都嵌套在
内:
...
是相对定位的(或更重要的是,非静态定位),并且每个图像都在其中绝对定位,并重新调整大小。当您移动鼠标时,系统会进行一些密集的数字运算,以重新计算每个图像的
top
和left
CSS 属性的新值。我在我的网站上写了更多相关内容,并解释了如何从头开始构建您自己的简化版本:http://richard.jp.leguen.ca/not-blog/how-is-xkcd-in-3d
然而,将每个图像分割成层,是自动化的,并呼吁志愿者(愚人节玩笑?)来让它变得更好。
Each image is split into layers - each layer is its own PNG file and includes a lot of transparency.
All these images are nested inside a
<div>
:... the
<div id="comic">
is relatively positioned (or more importantly, non-statically positioned) and each image is absolutely positioned within it, as well as re-sized. As you move the mouse, some intense number crunching is done to recalculate new values for thetop
andleft
CSS properties of each image.I wrote some more about it on my web site, and explain how to build your own simplified version from the ground up: http://richard.jp.leguen.ca/not-blog/how-is-xkcd-in-3d
The splitting of each image into layers, however, is automated, with a (April fools joke?) call for volunteers to make it better.
这是(半)手动的,Randall 正在尝试众包转换,请参阅此处
It's (semi) manual, and Randall is trying to crowdsource the conversion, see here
是的,它使用脚本 xk3d.js 与 自动系统将漫画分层。
这对某些人来说看起来不错,例如第一个。但其他的,比如 483,由于有斑点的 3D 文本,确实会让你头疼。
因此,他们正在寻找志愿者手动将它们分成更好的层。
Yeah, it's using a script, xk3d.js, combined with an automatic system to split the comics into layers.
This looks good on some, like the first. But others, like 483, really could give you a headache, due to the blotchy 3D text.
As a consequence, they're seeking volunteers to manually split them into better layers.