萌娘百科,萬物皆可萌的百科全書!轉載請標註來源頁面的網頁連結,並聲明引自萌娘百科。內容不可商用。
跳至導覽
跳至搜尋
這個用戶太懶了,文本歪了也不扶正
個人信息
用戶框
|
該用戶已有了4年零6個月零20日的萌百用戶史。 |
借鑑 |
這個用戶喜歡借鑑其他條目,並加以改善。 借明於鑒以照之,則寸分可得而察也 |
大陆简体 |
此用户使用中国大陆规定的简体中文来进行萌娘百科的维护工作。 |
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)
學習列表
自用鏈