JavaScript/canvas/彩色线条:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
无编辑摘要
Kangkk​(留言 | 贡献)
 
(未显示同一用户的5个中间版本)
第2行: 第2行:
== eq 1 ==
== eq 1 ==
{{codepen
{{codepen
|tabs=<tabs>
|id=uuid
<tab name="css"><syntaxhighlight lang="css">
|height=400
html,
|html=<canvas></canvas>
|style=html,
body {
body {
width: 100%;
width: 100%;
第25行: 第26行:
cursor: pointer;
cursor: pointer;
}
}
</syntaxhighlight></tab>
|script=// Imagination by @neave
<tab name="js"><syntaxhighlight lang="javascript">
// Imagination by @neave


window.requestAnimationFrame =
window.requestAnimationFrame =
window.requestAnimationFrame ||
window.requestAnimationFrame <nowiki>||</nowiki>
window.webkitRequestAnimationFrame ||
window.webkitRequestAnimationFrame <nowiki>||</nowiki>
window.mozRequestAnimationFrame ||
window.mozRequestAnimationFrame <nowiki>||</nowiki>
window.msRequestAnimationFrame ||
window.msRequestAnimationFrame <nowiki>||</nowiki>
function(callback) {
function(callback) {
setTimeout(callback, 1000 / 60);
setTimeout(callback, 1000 / 60);
第205行: 第204行:
}
}


console.log('canvas',canvas);
on('DOMContentLoaded', init);
on('DOMContentLoaded', init);
</syntaxhighlight></tab>
<tab name="html"><syntaxhighlight lang="html">
<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>CodePen - Imagination</title>
  <link rel="stylesheet" href="./style.css">
</head>
<body>
<!-- partial:index.partial.html -->
<canvas></canvas>
<!-- partial -->
  <script  src="./script.js"></script>
</body>
</html>
</syntaxhighlight></tab>
</tabs>
|iframe=<html><iframe src="https://kangkk.com/iframe/imaginationcolor/dist/index.html" name="kangkk.com"></iframe></html>
}}
}}