css3扑克牌展开折叠动画特效

2025-10-28 23:40:07

1、新建html文档。

css3扑克牌展开折叠动画特效

2、书写hmtl代码。

<div class="perspective">

  <div class='card-container'>

    <div class="message">点击 左侧 卡牌</div>

    <div class='card card-card1'>

      <div class='card__face card__face--top'>

        <span class='card__value'>

          A

        </span>

        <span class='card__suit'>

          <svg width="21px" height="16px" viewBox="0 0 21 16" version="1.1" >

              <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">

                  <path d="M1.6440972,15.2434886 L19.7934028,15.2434886 L10.71875,1.39282802 L1.6440972,15.2434886 Z" id="Path-2" stroke="#635F5C"></path>

              </g>

          </svg>

        </span>

      </div>

      <div class='card__face card__face--btm'>

        <span class='card__value'>

          A

        </span>

        <span class='card__suit'>

          <svg width="21px" height="16px" viewBox="0 0 21 16" version="1.1" >

              <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">

                  <path d="M1.6440972,15.2434886 L19.7934028,15.2434886 L10.71875,1.39282802 L1.6440972,15.2434886 Z" id="Path-2" stroke="#635F5C"></path>

              </g>

          </svg>

        </span>

      </div>

    </div>

css3扑克牌展开折叠动画特效

3、书写css代码。

body {

  background: #e7e7e7;

  font-family: 'Source Sans Pro', sans-serif;

  font-weight: 200;

  font-size: 1.4rem;

  height: 100vh;

  overflow: hidden;

  width: 100vw;

}

.inspired {

  border: 1px solid rgba(0, 0, 0, 0.1);

  border-radius: 4px;

  font-weight: 400;

  position: absolute;

  bottom: 6px;

  right: 6px;

  z-index: 10;

}

.inspired a {

  color: rgba(0, 0, 0, 0.4);

  display: inline-block;

  font-size: 16px;

  padding: 0 24px 10px;

  text-decoration: none;

}

.message {

  color: #eeeae7;

  text-shadow: 0 0 5px #b4b4b4;

  font-size: 32px;

  font-weight: 200;

  letter-spacing: -0.01em;

  line-height: 40px;

  position: absolute;

  transform: rotate(-31deg) translate3d(80%, 130%, 0);

  width: 3em;

}

css3扑克牌展开折叠动画特效

4、书写并添加js代码。

<script src='js/jquery.min.js'></script>

<script src="js/index.js"></script>

css3扑克牌展开折叠动画特效

5、代码整体结构。

css3扑克牌展开折叠动画特效

6、查看效果。

css3扑克牌展开折叠动画特效

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢