zoukankan      html  css  js  c++  java
  • css 实现3d转盘效果

    <template>
    <div class="wrapper">
      <div class="demo1">
        <span class="item" v-for="i in 6" @click="testClick(this)">测试{{i}}</span>
      </div>
    
      <div class="demo2">
        <span class="item" v-for="i in 3" @click="testClick(this)">测试{{i}}</span>
      </div>
    </div>
    </template>
    
    <script>
    export default {
      name: "TestTwo",
      methods: {
        testClick(obj){
          console.log("点击的控件:", obj);
          //alert('点击了:' + obj);
        }
      },
      created() {

    } } </script> <style scoped> @keyframes play { from{ transform: rotateX(-12deg) rotateY(0deg); } to{ transform: rotateX(-12deg) rotateY(360deg); } } div.demo1 { top: 120px; left: 120px; position: relative; width: 200px; height: 200px; transform-style: preserve-3d; transform: rotateX(0deg) rotateY(0deg); margin-right: -100px; animation: play 10s linear 0s infinite normal; } /*animation: play 10s linear 0s infinite normal*/ /*animation 参数*/ /*animation-name 规定需要绑定到选择器的 keyframe 名称。。*/ /*animation-duration 规定完成动画所花费的时间,以秒或毫秒计。*/ /*animation-timing-function 规定动画的速度曲线。*/ /*animation-delay 规定在动画开始之前的延迟。*/ /*animation-iteration-count 规定动画应该播放的次数。*/ /*animation-direction 规定是否应该轮流反向播放动画。*/ span.item { display: inline-block; width: 200px; height: 200px; background-color: #efefef; position: absolute; top: 0; left: 0; border: 2px solid #13ce66; text-align: center; line-height: 200px; font-size: 60px } div.demo1:hover { animation-play-state: paused; } span.item:hover { background-color: #5daf34; } span.item:nth-child(1) { transform: rotateY(60deg) translateZ(200px); } span.item:nth-child(2) { transform: rotateY(120deg) translateZ(200px); } span.item:nth-child(3) { transform: rotateY(180deg) translateZ(200px); } span.item:nth-child(4) { transform: rotateY(240deg) translateZ(200px); } span.item:nth-child(5) { transform: rotateY(300deg) translateZ(200px); } span.item:nth-child(6) { transform: rotateY(360deg) translateZ(200px); } div.demo2 { top: 120px; left: 120px; position: relative; width: 200px; height: 200px; transform-style: preserve-3d; transform: rotateX(0deg) rotateY(0deg); margin-right: -100px; margin-top: 50px; animation: play 10s linear 0s infinite normal; } div.demo2:hover { animation-play-state: paused; } div.demo2 span.item:hover { background-color: #5daf34; margin-top: -50px; margin-left: -50px; width: 300px; height: 300px; } div.demo2 span.item:nth-child(1) { transform: rotateY(120deg) translateZ(200px); } div.demo2 span.item:nth-child(2) { transform: rotateY(240deg) translateZ(200px); } div.demo2 span.item:nth-child(3) { transform: rotateY(360deg) translateZ(200px); } </style>
  • 相关阅读:
    Instant Python 中文缩减版
    《Java疯狂讲义》(第3版)学习笔记 2
    《Java疯狂讲义》(第3版)学习笔记 1
    NXP Mifare S50标准IC卡- 访问位(Access Bits) 分析
    Python中获取异常(Exception)信息
    支持向量机(SVM)入门
    棋类游戏中人机博弈的设计
    (翻译)如何对python dict 类型按键(keys)或值(values)排序
    Python实现打印二叉树某一层的所有节点
    FIFA halts 2026 bids amid scandal 国际足联在丑闻期间停止2026年足球世界杯申请
  • 原文地址:https://www.cnblogs.com/rchao/p/15232275.html
Copyright © 2011-2022 走看看