很炫酷的html代码:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>star</title>
<script type="text/javascript">
window.onload = function () {
C = Math.cos; // cache Math objects
S = Math.sin;
U = 0;
w = window;
j = document;
d = j.getElementById("c");
c = d.getContext("2d");
W = d.width = w.innerWidth;
H = d.height = w.innerHeight;
c.fillRect(0, 0, W, H); // resize <canvas> and draw black rect (default)
c.globalCompositeOperation = "lighter"; // switch to additive color application
c.lineWidth = 0.2;
c.lineCap = "round";
var bool = 0,
t = 0; // theta
d.onmousemove = function (e) {
if(window.T) {
if(D==9) {
D=Math.random()*15; f(1); }
clearTimeout(T);
}
X = e.pageX; // grab mouse pixel coords
Y = e.pageY;
a=0; // previous coord.x
b=0; // previous coord.y
A = X, // original coord.x
B = Y; // original coord.y
R=(e.pageX/W * 999>>0)/999;
r=(e.pageY/H * 999>>0)/999;
U=e.pageX/H * 360 >>0;
D=9;
g = 360 * Math.PI / 180;
T = setInterval(f = function (e) {
// start looping spectrum
c.save();
c.globalCompositeOperation = "source-over"; // switch to additive color application
if(e!=1) {
c.fillStyle = "rgba(0,0,0,0.02)";
c.fillRect(0, 0, W, H); // resize <canvas> and draw black rect (default)
}
c.restore();
i = 25; while(i --) {
c.beginPath();
if(D > 450 || bool) {
// decrease diameter
if(!bool) {
// has hit maximum
bool = 1;
}
if(D < 0.1) {
// has hit minimum
bool = 0;
}
t -= g; // decrease theta
D -= 0.1; // decrease size
}
if(!bool) {
t += g; // increase theta
D += 0.1; // increase size
}
q = (R / r - 1) * t; // create hypotrochoid from current mouse position, and setup variables (see: http://en.wikipedia.org/wiki/Hypotrochoid)
x = (R - r) * C(t) + D * C(q) + (A + (X - A) * (i / 25)) + (r - R); // center on xy coords
y = (R - r) * S(t) - D * S(q) + (B + (Y - B) * (i / 25));
if (a) {
// draw once two points are set
c.moveTo(a, b);
c.lineTo(x, y)
}
c.strokeStyle = "hsla(" + (U % 360) + ",100%,50%,0.75)"; // draw rainbow hypotrochoid
c.stroke();
a = x; // set previous coord.x
b = y; // set previous coord.y
}
U -= 0.5; // increment hue
A = X; // set original coord.x
B = Y; // set original coord.y
}, 16);
}
j.onkeydown = function(e) {
a=b=0; R += 0.05 }
d.onmousemove({
pageX:300, pageY:290})
}
</script>
</head>
<body style="margin:0px;padding:0px;width:100%;height:100%;overflow:hidden;">
<canvas id="c"></canvas>
</body>
</html>
文章浏览阅读283次。scala函数式编程 意见 (Opinion)If you haven’t used Scala yet, you’re not the only one: Not even four percent of all programmers were using the language as of last year, according to 如果您还没有使用Scala,那么您不是唯一的一个...
文章浏览阅读3.9k次。最近修改项目遇到查看物流这个需求,经过一个下午的时间的终于搞定,趁着这个时间点,赶快把这个功能抽取出来,方便大家以后开发的需要,帮助到更多的人 先看效果图,如下 看完之后,分析可知道,主要是两部分,一个头部和一个body. 那我们最主要的工作就是body内容的实现,头部的实现简单,这里就不再详细的说明 这里我给大家提供一个github上的开源项目,不过这个实现起来,绘制的效果比较慢,不过_android 类似快递时间轴控件
文章浏览阅读143次。物联网
文章浏览阅读3.3k次,点赞8次,收藏24次。效果想要达到的效果如下图,顶部横幅有6张图片可以自动切换:实现步骤先去element-ui官网学习这个跑马灯的模板代码:<template> <el-carousel :interval="4000" type="card" height="200px"> <el-carousel-item v-for="item in 6" :key="item"> <h3 class="medium">{{ item }}</h3_elementui走马灯图片
文章浏览阅读139次。对于很多没有学历优势的人来说,面试大厂是非常困难的,这对我而言,也是一样,出身于二本,原本以为就三点一线的生活度过一生,直到生活上的变故,才让我有了新的想法和目标,因此我这个二本渣渣也奋斗了起来,竟拿下了阿里P6岗。今天分享这波面经,主要是希望能够激励到同样被学历所困扰的技术人,能够对职业生涯和技术规划有一个参考价值,感谢!一、面试阿里P7难在哪?(面试难点)(1)难在“心态”首先需要克服的第一关,实际上就是自己的心态。因为我是二本出身,base比较低,所以面试阿里本就是一件没太大底气的事情,更_阿里里面双非多吗
文章浏览阅读4.4k次。钕铁硼NdFeB材料各类牌号磁特性大全钕铁硼NdFeB材料各类牌号磁特性大全NdFeB材料磁特性一览表 Q/HC30502C-2015 材料 牌号 剩磁(最小值) 矫顽力(最小值) 矫顽力(最小值) 最...
文章浏览阅读285次。物联网
文章浏览阅读490次。UI自动化_JS处理1)下拉滚动条from selenium import webdriverimport time driver = webdriver.Chrome()driver.maximize_window()driver.get('https://www.baidu.com/')driver.find_element_by_id('kw').send_keys('自动化测试')driver.find_element_by_id('su').click()time.sleep_ui自动化如何向只读属性输入数据
文章浏览阅读189次。为什么80%的码农都做不了架构师?>>> ..._bochs rootimage-0.11
文章浏览阅读1.2k次。在buu里挑了一道heap的题,是一道off by null 的题,比较容易,经典一些例行检查:_x_nuca_2018_offbyone2
文章浏览阅读2.2w次,点赞52次,收藏333次。1、掌握8255A的工作方式使用以及编程。2、利用8255A完成将数码开关的输入送给发光二极管并显示_8255并行接口实验
文章浏览阅读261次。1.API概述和使用步骤应用程序编程接口。Java的API是一本程序员的字典,学会查询2.Scanner 概述及其API文档键盘输入类都是大写的Scanner,关键字是小写的public3.Scanner的使用步骤import java.util.Scanner; //导包定义一个sc的成员对象Scanner sc=new Scanner(System.in)..._string和scanner为什么大写