js+css实现万圣节释放小鬼确认按钮动画效果代码

代码语言:html

所属分类:动画

代码描述:js+css实现万圣节释放小鬼确认按钮动画效果代码,点击确认或取消可以看到小鬼的不同表情

代码标签: 万圣节 小鬼 按钮

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">




    <style>
        @font-face {
          font-family: "Stranger";
          src: url("//repo.bfw.wiki/bfwrepo/font/Molot.woff") format("woff");
        }
        body,
        html {
          height: 100%;
          display: grid;
          font-size: 24px;
          --x: 0;
          --y: 0;
          --total: 0;
        }
        
        body {
          background: url(https://assets.codepen.io/t-1/shapelined-Z1xxfm52Htc-unsplash.jpg) no-repeat center center fixed;
          height: 100vh;
          overflow: hidden;
        }
        body:after {
          content: "";
          position: absolute;
          width: 100%;
          height: 100%;
          left: 0;
          top: 0;
          background: inherit;
          z-index: 3;
          filter: saturate(0);
          mix-blend-mode: darken;
        }
        body:before {
          content: "";
          position: absolute;
          width: 100%;
          height: 100%;
          left: 0;
          top: 0;
          pointer-events: none;
          filter: contrast(270%) brightness(2000%) saturate(0);
          z-index: 2;
          background-image: radial-gradient(circle at calc(50% - (var(--x) * -25px)) calc(50% - (var(--y) * -25px)), transparent calc(50px - (var(--total) * -50px)), #000 700px), url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='4.24' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
          background-size: 100% 100%, 200px;
        }
        body.loaded #container:before {
          opacity: 0;
          pointer-events: none;
        }
        
        #container {
          margin: auto;
          font-family: "Stranger";
          display: flex;
          justify-content: center;
          flex-wrap: wrap;
          width: 500px;
          position: relative;
          z-index: 4;
        }
        #container:before {
          content: "";
          position: absolute;
          width: 200vw;
          height: 200vh;
          top: 50%;
          left: 50%;
          transform: t.........完整代码请登录后点击上方下载按钮下载查看

网友评论0