js实现一个简单的围棋效果代码

代码语言:html

所属分类:游戏

代码描述:js实现一个简单的围棋效果代码

代码标签: 简单 围棋 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
  
  
<style>
/* RESET */
* {
    margin: 0px;
    padding: 0px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    font-family: Calibri;
    user-select: none;
    /* border: 1px dotted yellow; */
}
body{
    height: 100%;
    background: rgb(20,20,20);
    background-size: cover;
    background-attachment: fixed;
    background-position: top left;
    background-repeat: no-repeat;
}
#container{
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0px;
    left: 0px;
    padding: 10px;
}
.pawn{
    width: 58px;
    height: 58px;
    position: absolute;
    display: block;
    border-radius: 50%;
    font-size: 30px;
    line-height: 58px;
    text-align: center;
    margin: 1px;
    z-index: 10;
    filter: drop-shadow(-2px -1px 1px rgba(0,0,0,0.5));
}
.black{
    color: transparent;
    background: black;
    background-size: cover;
    box-shadow: 0px 0px 13px gray inset;
}
.white{
    color: transparent;
    background: white;
    background-size: cover;
    box-shadow: 0px 0px 13px gray inset;
}
.current{
    /* box-shadow: 0px 0px 25px gold inset; */
    border: 1px solid gold;
}
/* 13x13 */
.board{
    width: 840px;
    height: 840px;
    display: block;
    position: absolute;
    top: 30px;
    left: 330px;
    background: rgb(216, 159, 67);
    background-size: cover;
    border:1px solid rgba(0,0,0,0.7);
    box-shadow: 0px 0px 10px rgba(0,0,0,0.7),
                0px 0px 3px rgba(255,255,255,0.6) inset,
                100px 100px 100px rgba(255,255,255,0.2) inset;
}
.board:after{
    content: '';
    width: 720px;
    height: 720px;
    display: block;
    position: absolute;
    margin: 60px;
    background:
        repeating-linear-gradient(to left,
            rgba(0,0,0,0.7) 0px,
            transparent 1px,
            transparent 59px,
            rgba(0,0,0,0.7) 60px),
        repeating-linear-gradient(to bottom,
            rgba(0,0,0,0.7) 0px,
            transparent 1px,
            transparent 59px,
            rgba(0,0,0,0.7) 60px);
    outline: 1px solid rgba(0,0,0,0.7);
}
.board:before{
    content: '';
    width: 790px;
    height: 790px;
    display: block;
    position: absolute;
    margin: 25px;
}
.jar{
    width: 300px;
    height: 300px;
    position: absolute;
    border-radius: 50px;
    background: brown;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.7),
                0px 0px 7px rgba(255,255,255,0.3) inset;
}
.jar:after{
    content: '';
    width: 260px;
    height: 260px;
    position: relative;
    float: right;
    margin:20px;
    border-radius: 30px;
    background: rgba(0,0,0,0.3);
    box-shadow: 0px 0px 6px rgba(0,0,0,0.8) inset,
                0px 0px 7px rgba(255,255,255,0..........完整代码请登录后点击上方下载按钮下载查看

网友评论0