js+css实现带底色花纹的时钟效果代码

代码语言:html

所属分类:布局界面

代码描述:js+css实现带底色花纹的时钟效果代码

代码标签: 底色 花纹 时钟 效果

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">




    <style>
        html {
          background: #FFEBDB;
          text-align: center;
          font-size: 10px;
        }
        
        body {
          margin: 0;
          font-size: 2rem;
          display: flex;
          flex: 1;
          min-height: 100vh;
          align-items: center;
        }
        
        .clock {
          width: 30rem;
          height: 30rem;
          border: 7px solid #FFEBDB;
          box-shadow: -4px -4px 10px rgba(67,67,67,0.1),
                        inset 4px 4px 10px rgba(168, 145, 128,0.6),
                        inset -4px -4px 10px rgba(201, 175, 155,0.2),
                        4px 4px 10px rgba(168, 145, 128,0.5);
          border-radius: 50%;
          margin: 50px auto;
          position: relative;
          padding: 2rem;
          background-image: url('//repo.bfw.wiki/bfwrepo/image/5e51bd8762808.png');
          background-size: 111%;
        }
        
        .outer-clock-face {
          position: relative;
          width: 100%;
          height: 99%;
          border-radius: 100%;
          overflow: hidden;  
        
        }
        
        .outer-clock-face::after {
          -webkit-transform: rotate(90deg);
          -moz-transform: rotate(90deg);
          transform: rotate(90deg)
        }
        
        .outer-clock-face::before,
        .outer-clock-face::after,
        .outer-clock-face .marking{
          content: '';
          position: absolute;
          width: 10px;
          height: 100%;
          background: #596235;
          z-index: 0;
          left: 49%;
          border-radius: 8px;
        }
        
        .outer-clock-face .marking {
          background: #596235;
          width: 3px;
        }
        
        .outer-clock-face .marking.marking-one {
          -webkit-transform: rotate(30deg);
          -moz-transform: rotate(30deg);
          transform: rotate(30deg)
        }
        
        .outer-clock-face .marking.marking-two {
          -webkit-transform: rotate(60deg);
          -moz-transform: rotate(60deg);
          transform: rotate(60deg)
        }
        
        .outer-clock-face .marking.marking-three {
          -webkit-transform: rotate(120deg);
          -moz-transform: rotate(120deg);
          transform: rotate(120deg)
        }
        
        .outer-clock-face .marking.marking-four {
          -webkit-transform: rotate(150deg);
          -moz-transform: rotate(150deg);
          transform: rotate(150deg)
        }
        
        .inner-clock-face {
          position: absolute;
          top: 10%;
          left: 11%;
          width: 80%;
          height: 80%;
          background: #FFEBDB;
          -webkit-border-radius: 100%;
          -moz-border-radius: 100%;
          border-radius: 100%;
          z-index: 1;
          background-image: url('//repo.bfw.wiki/bfwrepo/image/5e51bd8762808.p.........完整代码请登录后点击上方下载按钮下载查看

网友评论0