萌娘百科,万物皆可萌的百科全书!转载请标注来源页面的网页链接,并声明引自萌娘百科。内容不可商用。
跳转到导航
跳转到搜索
这个用户太懒了,文本歪了也不扶正
个人信息
用户框
|
该用户已有了4年零10个月零28日的萌百用户史。 |
借鉴 |
这个用户喜欢借鉴其他条目,并加以改善。 借明於鉴以照之,则寸分可得而察也 |
大陆简体 |
此用户使用中国大陆规定的简体中文来进行萌娘百科的维护工作。 |
css画画
Destr0yer:
正弦余弦函数:太占空间了,自己拿Python生成吧
源码:(拿Python写的)
import math
size = 5
jqd = 300
bgc = "#222222"
def divBox(xpos, ypos, col):
return " <div style=\"width:1%; height:1%; position: absolute;left:" + str(xpos) + "%;top:" + str(ypos) + "%;background-color:" + col + ";\"></div>\n"
def mathPos2divPos(xpos, ypos):
return ((xpos / size / 2 + 0.5) * 100, (ypos / size / 2 + 0.5) * 100)
with open("output.html","w") as html:
text = "<div style=\"width:500px;height:500px;position:relative;background-color:" + bgc + ";\">\n"
for a in range(jqd):
text = text + divBox(mathPos2divPos((a -(jqd / 2)) /(jqd / 2) * size, 0)[0], mathPos2divPos(0, math.sin((a -(jqd / 2)) /(jqd / 2) * size))[1], "#dd4444")
text = text + divBox(mathPos2divPos((a -(jqd / 2)) /(jqd / 2) * size, 0)[0], mathPos2divPos(0, math.cos((a -(jqd / 2)) /(jqd / 2) * size))[1], "#4444dd")
text += "</div>"
html.write(text)
学习列表
自用链