gsap实现一个卡通扭蛋机抽奖效果代码

代码语言:html

所属分类:其他

代码描述:gsap实现一个卡通扭蛋机抽奖效果代码,可以拆看看看自己中了什么奖品。

代码标签: gsap 卡通 扭蛋机 抽奖

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">





    <style>
        @import url("https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c&display=swap");
        #app.gotcha .container .ui-layer .title-container .title h2, #app.gotcha .container .game-layer .machine-container .title {
          text-shadow: 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white), 0px 0px 2px var(--stroke-color, white);
          filter: drop-shadow(0px 2px 0px rgba(0, 0, 0, 0.2));
        }
        
        *, *::before, *::after {
          box-sizing: border-box;
          font-family: inherit;
          padding: 0;
          margin: 0;
        }
        
        html {
          font-size: 62.5%;
          height: 100%;
          color: white;
          font-family: "M PLUS Rounded 1c", "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
        }
        html body {
          font-size: 1.6rem;
          overflow: hidden;
          height: 100%;
          position: relative;
          user-select: none;
        }
        
        .dim {
          transition: 0.5s linear;
        }
        .dim[data-animate] {
          filter: brightness(0.6) saturate(0.8);
        }
        
        .confetti {
          position: absolute;
          top: 0;
          left: 0;
          overflow: hidden;
          width: 100%;
          height: 100%;
          z-index: 10;
          pointer-events: none;
          perspective: 100vmin;
        }
        .confetti span {
          --size: 5;
          display: block;
          position: absolute;
          width: calc(var(--size) * 1px);
          height: calc(var(--size) * 1px);
          background-color: blue;
          animation: rotate linear calc(var(--rs) * 1s) infinite both;
        }
        
        #app.gotcha {
          width: 100%;
          height: 100%;
          position: relative;
          background-color: #666;
        }
        #app.gotcha .container {
          width: 100%;
          height: 100%;
          overflow: hidden;
          position: relative;
        }
        #app.gotcha .container .game-layer {
          width: 100%;
          height: 100%;
          overflow: hidden;
          display: flex;
          align-items: center;
          justify-content: center;
          position: relative;
          background: url(//repo.bfw.wiki/bfwrepo/images/niudaoji/bg.jpg) center/auto 100% no-repeat;
        }
        #app.gotcha .container .game-layer .machine-container {
          position: relative;
          white-space: nowrap;
        }
        #app.gotcha .container .game-layer .machine-container .machine {
          .........完整代码请登录后点击上方下载按钮下载查看

网友评论0