首页前端开发HTML旋转的辐射Logo

旋转的辐射Logo

时间2024-01-25 13:52:27发布访客分类HTML浏览722
导读:收集整理的这篇文章主要介绍了html5教程-旋转的辐射Logo,觉得挺不错的,现在分享给大家,也给大家做个参考。小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。 VAR canvas = docum...
收集整理的这篇文章主要介绍了html5教程-旋转的辐射Logo,觉得挺不错的,现在分享给大家,也给大家做个参考。小宝典致力于为广大程序猿(媛)提供高品质的代码服务,请大家多多光顾小站,小宝典在此谢过。

VAR canvas = document.getElementById("myCanvas");  
var context = canvas.getContext("2d");  
var startP = [0 , 0.67 , 1.34 ];  
var endP = [0.3 , 0.97 , 1.64];  
var n = 0.01;  
var aniMATE;  
window.onload = inITPage;  
 
function initPage() {  
    var sPEed = document.getelementsbytagname("select")[0].value;  
    window.clearInterval(animate);  
    animate = setInterval("show()",speed);  
}  
 
function show() {  
    context.clearRect(0,0,500,500);  
    for(var i = 0 ; i3 ; i++) {  
    startP[i] += n;  
    endP[i] += n;  
    if(startP[i] == 2) {  
        startP[i] = 0;  
    }  
    if(endP[i] == 2) {  
        endP[i] = 0;  
    }  
    }  
    context.beginPath();  
    context.rect(0,0,500,500);  
    context.lineWidth = 1;  
    context.fillStyle = "#f2CA07";  
    context.fill();  
    context.stroke();  
 
    context.beginPath();  
    context.arc(250, 250, 10, 0, 2 * Math.PI, false);  
    context.lineWidth = 1;  
    context.fillStyle = "#333";  
    context.fill();  
    context.stroke();  
 
    context.beginPath();  
    context.arc(250, 250, 100, startP[0] * Math.PI, endP[0] * Math.PI, false);  
    context.lineWidth = 160;  
    context.strokeStyle = "#333";  
    context.stroke();  
 
    context.beginPath();  
    context.arc(250, 250, 100, startP[1] * Math.PI, endP[1] * Math.PI, false);  
    context.lineWidth = 160;  
    context.strokeStyle = "#333";  
    context.stroke();  
 
    context.beginPath();  
    context.arc(250, 250, 100, startP[2] * Math.PI, endP[2] * Math.PI, false);  
    context.lineWidth = 160;  
    context.strokeStyle = "#333";  
    context.stroke();  
}  


Demo


摘自 简生的代码备忘录

var canvas = document.getElementById("myCanvas");  
var context = canvas.getContext("2d");  
var startP = [0 , 0.67 , 1.34 ];  
var endP = [0.3 , 0.97 , 1.64];  
var n = 0.01;  
var animate;  
window.onload = initPage;  
 
function initPage() {  
    var speed = document.getElementsByTagName("select")[0].value;  
    window.clearInterval(animate);  
    animate = setInterval("show()",speed);  
}  
 
function show() {  
    context.clearRect(0,0,500,500);  
    for(var i = 0 ; i3 ; i++) {  
    startP[i] += n;  
    endP[i] += n;  
    if(startP[i] == 2) {  
        startP[i] = 0;  
    }  
    if(endP[i] == 2) {  
        endP[i] = 0;  
    }  
    }  
    context.beginPath();  
    context.rect(0,0,500,500);  
    context.lineWidth = 1;  
    context.fillStyle = "#F2CA07";  
    context.fill();  
    context.stroke();  
 
    context.beginPath();  
    context.arc(250, 250, 10, 0, 2 * Math.PI, false);  
    context.lineWidth = 1;  
    context.fillStyle = "#333";  
    context.fill();  
    context.stroke();  
 
    context.beginPath();  
    context.arc(250, 250, 100, startP[0] * Math.PI, endP[0] * Math.PI, false);  
    context.lineWidth = 160;  
    context.strokeStyle = "#333";  
    context.stroke();  
 
    context.beginPath();  
    context.arc(250, 250, 100, startP[1] * Math.PI, endP[1] * Math.PI, false);  
    context.lineWidth = 160;  
    context.strokeStyle = "#333";  
    context.stroke();  
 
    context.beginPath();  
    context.arc(250, 250, 100, startP[2] * Math.PI, endP[2] * Math.PI, false);  
    context.lineWidth = 160;  
    context.strokeStyle = "#333";  
    context.stroke();  
}  


Demo


摘自 简生的代码备忘录

觉得可用,就经常来吧! 欢迎评论哦! html5教程,巧夺天工,精雕玉琢。小宝典献丑了!

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!

divpost-format-gallery

若转载请注明出处: 旋转的辐射Logo
本文地址: https://pptw.com/jishu/586598.html
easy Html5-Jquery Mobile之ToolBars(Header and Footer) HTML5打造简易播放器:Chrome运行.mp3

游客 回复需填写必要信息