css+div布局游戏机效果代码

代码语言:html

所属分类:布局界面

代码描述:css+div布局游戏机效果代码

代码标签: css div 布局 游戏机

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">




    <style>
        body {
          min-height: 300px;
          height: 100vh;
          position: relative;
          background-color: #1e90ff;
        }
        div {
          position: absolute;
          left: 50%;
          top: 50%;
        }
        div::before,
        div::after {
          display: block;
          content: '';
          position: absolute;
        }
        @media (max-width: 400px) {
          div:not(.no-scale) {
            transform: scale(0.8);
          }
        }
        #game {
          width: 160px;
          height: 110px;
          margin-left: -90px;
          margin-top: -100px;
          background: linear-gradient(#eee, #eee) 36.3% 38.5%/0.45em 0.1em, linear-gradient(#eee, #eee) 35.65% 39.5%/0.55em 0.1em, linear-gradient(#eee, #eee) 36% 52%/0.5em 1.6em, linear-gradient(#eee, #eee) 33.1% 43%/0.2em 0.5em, linear-gradient(#eee, #eee) 44.3% 38.5%/0.45em 0.1em, linear-gradient(#eee, #eee) 43.7% 39.5%/0.55em 0.1em, linear-gradient(#eee, #eee) 44% 52%/0.5em 1.6em, linear-gradient(#eee, #eee) 41% 43%/0.2em 0.5em, linear-gradient(#eee, #eee) 50% 44%/0.4em 0.4em, linear-gradient(#eee, #eee) 50% 56%/0.4em 0.4em, linear-gradient(#eee, #eee) 57.5% 38.5%/0.45em 0.1em, linear-gradient(#eee, #eee) 57.1% 39.5%/0.55em 0.1em, linear-gradient(#eee, #eee) 57.3% 52%/0.5em 1.6em, linear-gradient(#eee, #eee) 54.1% 43%/0.2em 0.5em, linear-gradient(#eee, #eee) 65.7% 38.5%/0.45em 0.1em, linear-gradient(#eee, #eee) 65.3% 39.5%/0.55em 0.1em, linear-gradient(#eee, #eee) 65.5% 52%/0.5em 1.6em, linear-gradient(#eee, #eee) 61.7% 43%/0.2em 0.5em;
          background-repeat: no-repeat;
          background-color: #666;
          border-radius: 10px;
          box-shadow: inset 0 0 0 7px #444, -2px -2px 0 2px #ffd700, 21px -2px 0 2px #ffd700, -2px 80px 0 2px #ffd700, 21px 80px 0 2px #ffd700, -2px 90px 0 2px #ffa500, 21px 90px 0 2px #ffa500;
        }
        #game::before {
          width: 211px;
          height: 200px;
          top: -2px;
          left: -2px;
          background: radial-gradient(#444 20%, rgba(0,0,0,0) 21%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.4) 51%, rgba(0,0,0,0.4) 63%, rgba(0,0,0,0) 64%) right 1.75em top 0/1.2em 1.2em, radial-gradient(rgba(255,215,0,0) 50%, #ffd700 50.5%, #ffd700 79%, rgba(255,215,0,0) 79.5%) right 1.75em top 0/1.2em 1.2em, repeating-conic-gradient(from 0deg, #aaa 0deg 10deg, #ddd 10deg 60deg, #aaa 60deg 90deg) right 1.9em top 0.1em/0.9em 1em, radial-gradient(#444 20%, rgba(0,0,0,0) 21%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.4) 51%, rgba(0,0,0,0.4) 63%, rgba(0,0,0,0) 64%) left 0 bottom 0.5em/1.2em 1.2em, radial-gradient(rgba(255,215,0,0) 50%, #ffd700 50.5%, #ffd700 79%, rgba(255,215,0,0) 79.5%) left 0 bottom 0.5em/1.2em 1.2em, repeating-conic-gradient(from 0deg, #aaa 0deg 10deg, #ddd 10deg 60deg, #aaa 60deg 90deg) left 0.15em bottom 0.6em/0.9em 1em, radial-gradient(#444 20%, rgba(0,0,0,0) 21%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.4) 51%, rgba(0,0,0,0.4) 63%, rgba(0,0,0,0) 64%) right 1.75em bottom 0.5em/1.2em 1.2em, radial-gradient(rgba(255,215,0,0) 50%, #ffd700 50.5%, #ffd700 79%, rgba(255,215,0,0) 79.5%) right 1.75em bottom 0.5em/1.2em 1.2em, repeating-conic-gradient(from 0deg, #aaa 0deg 10deg, #ddd 10deg 60deg, #aaa 60deg 90deg) right 1.9em bottom 0.6em/0.9em 1em, radial-gradient(white 20%, #ffd700 21%, #ffd700 50%, #ffa500 51%, #ffa500 62%, rgba(255,165,0,0) 63%) right 1.75em top 1.3em/1.2em 1.2em, radial-gradient(#ffa500 62%, rgba(255,165,0,0) 63%) right 1.75em top 1.4em/1.2em 1.2em, radial-gradient(circle, rgba(0,0,0,0.6) 70%, rgba(0,0,0,0) 70.5%) right 2.31em top 3..........完整代码请登录后点击上方下载按钮下载查看

网友评论0