js实现canvas皇家斯图尔特格子背景效果代码
代码语言:html
所属分类:背景
代码描述:js实现canvas皇家斯图尔特格子背景效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
margin:0;
background:#034710;
}
#cvs {
border:solid black 4px;
border-radius:12px;
position:absolute;
left:50%;
top:50%;
transform:translate(-50%,-50%);
}
</style>
</head>
<body >
<canvas id="cvs" width="599" height="599"></canvas>
<script >
let ctx
const SQUARE_SIZE = 599
const MAIN_COLOR = '#AB0303'
const RED_WEAVE_COLOR = '#810303'
const BLUE_WEAVE_COLOR = '#2C215E'
const BLACK_WEAVE_COLOR = '#150B0B'
const YELLOW_WEAVE_COLOR = '#AB8D03'
const WHITE_WEAVE_COLOR = '#B9B9B9'
const GREEN_WEAVE_COLOR = '#094710'
const BLUE_BK_COLOR = '#25256D'
const BLACK_BK_COLOR = '#0C0C0C'
const GREEN_BK_COLOR = '#035613'
const YELLOW_BK_COLOR = '#C3A103'
const YELLOW_BK_WEAVE_COLOR = '#987E03'
const WHITE_BK_COLOR = '#D4D4D4'
const WHITE_BK_WEAVE_COLOR = '#A1A1A1'
function drawTartan() {
const cvsNd = document.getElementById("cvs")
ctx = cvsNd.getContext('2d')
solidWeave({x:0,y:0,w:S.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0