Warning: 我警告过了,浏览器弱爆了的就不要点开了= =。内存太小了就慎重打开= =
眼残,竟然看到这种奇葩的演示
看了看CSS源码,想起来可以用Python Image Library做一个generator。
结果就真得做了一个……
#! /bin/env python
# -*- coding: utf-8 -*-
"""
Script to turn image into css
"""
import Image
import sys
__author__ = "Reverland (lhtlyy@gmail.com)"
def getcss(im):
"""docstring for get"""
css = """position: absolute;
top: 30px;
left: 30px;
width: 0;
height: 0;
box-shadow:
"""
string = '%dpx %dpx 0px 1px rgb%s,\n'
for y in range(0, im.size[1], 1):
for x in range(0, im.size[0], 1):
if im.size[1] - y <= 1 and im.size[0] - x <= 1:
string = '%dpx %dpx 0px 1px rgb%s;\n'
color = im.getpixel((x, y))
css += string % (x, y, color)
return css
def gethtml(css):
"""docstring for gethtml"""
html = """
%s">
意义在于可能你会死机= =
尝试复制看看?