纯CSS简单案例合集(折扇效果,资料卡,定格轮播,菜单三角形)

目录

①折扇效果(2d动画)

 ②资料卡

 ③定格轮播(鼠标移上去会暂停)


度数,速度,颜色之类的可以自己再调整

效果图如下

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    *{margin: 0;padding: 0;}
    ul{list-style-type:none;}
    ul{
        margin: 10px auto;
         width: 600px;
         height: 400px;
         border: 4px solid gray;
         position: relative;    
    }
    li{
        width: 50px;
        height: 200px;
        position: absolute;
        left: 50%;
        margin-left: -30px;
        bottom: 30px;
        text-align: center;
        transform-origin: bottom center;
        transition: all 3s linear;
        border-radius: 5px;
        box-shadow: 2px 2px 2px black;
    }   
    ul li:nth-child(1),ul li:nth-child(13){ 
        background-color: purple;
    }
    ul li:nth-child(2),ul li:nth-child(12){ 
        background-color:blueviolet;
    }
    ul li:nth-child(3),ul li:nth-child(11){ 
        background-color:rgb(226, 43, 226);
    }
    ul li:nth-child(4),ul li:nth-child(10){ 
        background-color:pink;
    }
    ul li:nth-child(5),ul li:nth-child(9){ 
        background-color:rgb(233, 108, 129);
    }
    ul li:nth-child(6),ul li:nth-child(8){ 
        background-color:rgb(228, 66, 93);
    }
    ul li:nth-child(7){ 
        background-color:rgb(167, 49, 69);
    }
    ul:hover li:nth-child(13){
    transform: rotate(-85deg);
    }
    ul:hover li:nth-child(12){
    transform: rotate(-75deg);
    }
    ul:hover li:nth-child(11){
    transform: rotate(-60deg);
    }
    ul:hover li:nth-child(10){
    transform: rotate(-45deg);
    }
    ul:hover li:nth-child(9){
    transform: rotate(-30deg);
    }
    ul:hover li:nth-child(8){
    transform: rotate(-15deg);
    }
    ul:hover li:nth-child(6){
    transform: rotate(15deg);
    }
    ul:hover li:nth-child(5){
    transform: rotate(30deg);
    }
    ul:hover li:nth-child(4){
    transform: rotate(45deg);
    }
    ul:hover li:nth-child(3){
    transform: rotate(60deg);
    }
    ul:hover li:nth-child(2){
    transform: rotate(75deg);
    }
    ul:hover li:nth-child(1){
    transform: rotate(85deg);
    }
    </style>
</head>
<body>
      <ul>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
          <li></li>
      </ul>
</body>
</html>

 ②资料卡

  

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        img{
            display: block;
        }
        .box{
            width: 350px;
            overflow: hidden;
            margin: 0 auto;
            position: relative;
        }
        .box img{
            width: 100%;
            transition: all 1s
        }
        .box:hover img{
            transform: translateX(50px);
            opacity: 0.5;            
        }
        .box h2{
            position:absolute;
            left: 50px;
            top: 10px;
            color: wheat;
            transition: all 1s 0.3s;
        }
        .box:hover h2{
            transform: translateX(100px);
        }
        .box p{
            position: absolute;
            left:50px;
            width: 100px;
            color: white;
            background: rgb(108, 108, 190);
        }
        .box .p1{
            top: 60px;
            transform: translateY(300px);
            transition: all 1s;
        }
        .box:hover .p1{
            transform: translateY(0px);            
        }
        .box .p2{
            top: 110px;
            transform: translateY(400px);
            transition: all 1s;
        }
        .box:hover .p2{
            transform: translateY(0px);
            
        }
        .box .p3{
            top:160px;
            transform: translateY(400px);
            transition: all 1s;
        }
        .box:hover .p3{
            transform: translateY(0px);         
        }
    </style>
</head>
<body>
    <div class="box">
        <img src="../tu/7.jpg" alt="">
        <h2>aespa</h2>
        <p class="p1">black manba</p>
        <p class="p2">savage</p>
        <p class="p3">forever</p>
    </div>
</body>
</html>

 ③定格轮播(鼠标移上去会暂停)

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 原理    一个大容器里面一个很长的盒子,盒子里装了浮动的图片,不断改变长盒子的位置实现轮播,图片可以再根据需要增删-->
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .container {
            /* 固定高宽 */
            width: 640px;
            height: 300px;
            margin: 0 auto;
            overflow: hidden;
        }

        .swiper img {
            width: 640px;
            height: 300px;
        }

        .slider {
            float: left;
        }

        .swiper {
            width: 5000px;
            /* 只要大于图片加起来的宽度就行 */
            animation: swipers 8s linear infinite;
        }

        @keyframes swipers {

            /* 10,43,76实现图片定格*/
            0% {
                transform: translateX(0);
            }
            10% {
                transform: translateX(-640px);
            }
            33% {
                transform: translateX(-640px);
            }
            43% {
                transform: translateX(-1280px);
            }
            66% {
                transform: translateX(-1280px);
            }
            76% {
                transform: translateX(-1920px);
            }
            100% {
                transform: translateX(-1920px);
            }
        }
        .swiper:hover{
            animation-play-state: paused;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="swiper">
            <div class="slider">
                <img src="../tu/5.jpg" alt="">
            </div>
            <div class="slider">
                <img src="../tu/6.jpg" alt="">
            </div>
            <div class="slider">
                <img src="../tu/7.jpg" alt="">
            </div>
            <!-- 实现无缝轮播,第一张和最后一张图片一样 -->
            <div class="slider">
                <img src="../tu/5.jpg" alt="">
            </div>
        </div>
    </div>
</body>

</html>

④三角形菜单栏

实现原理:先定义一个盒子,设置宽高,将border设置成不同的宽度和颜色

​​​​​​​

 

会出现以上效果 ,可以想象,当每个色彩栏中间的宽度不断缩小,就变成了三角形,当div的高宽变成0时,就变成了如图所示,将其他颜色改变为背景色是不可取的,如果背景色改变一眼就能看出,将其他改为transparent即可

效果图

 

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 100px;
            height: 50px;
            line-height: 50px;
            text-align: center;
            background: lightblue;
            color: white;
        }
 
        span {
            width: 0;
            height: 0;
            display: inline-block;
            border: 5px solid transparent;  /*  变三角形 */
            border-top: 5px solid white;
            position: relative;   /*给三角形一个固定位置变化*/
            top: 2.5px;  
            transition: 0.3s; /* 0.3s变化*/
        }
 
        .box:hover span {
            border: 5px solid transparent;/*  变三角形 */
            border-bottom: 5px solid white;
            position: relative;/*给三角形一个固定位置变化*/
            top: -2px;
        }
    </style>
</head>
 
<body>
    <div class="box"> 导航
        <span></span>
    </div>
</body>
 
</html>

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: carsim是一种用于汽车动力学仿真的软件工具,可以用于模拟车辆行驶中的各种动态特性和行为。该软件具有较高的精度和可靠性,并广泛应用于汽车工程领域。 在carsim相关教程休资料18个合集.zip中,包含了一系列与carsim有关的教程和仿真案例文档资料。这些资料的目的是帮助用户更好地了解和使用carsim软件,使其能够进行更准确、全面的汽车动力学仿真。 这些教程包括了carsim的基本概念和操作步骤,以及各种常见的仿真案例。通过学习这些教程,用户可以学习如何创建车辆模型、设置仿真参数、进行仿真分析等操作。此外,案例文档资料也提供了一系列真实的汽车场景,如车辆稳定性、悬挂系统优化、车辆性能评估等,供用户练习和参考。 通过这些教程和案例,用户可以全面了解carsim的功能和使用方法,并能够独立进行汽车动力学仿真。同时,通过实际操作和实验,用户可以更好地理解车辆行驶原理和特性,并能够应用于实际工程项目中。 总之,carsim相关教程休资料18个合集.zip提供了丰富的教学资源和实例资料,可以帮助用户学习和掌握carsim软件的使用技巧和汽车动力学仿真的方法。无论是初学者还是专业人士,都可以从中受益,提升在汽车工程领域的技术水平。 ### 回答2: carsim相关教程和资料就是指carsim仿真案例文档资料18个合集.zip文件。这个压缩文件中包括了18个不同的carsim仿真案例的文档资料。 carsim是一款非常常用的汽车动力学仿真软件,用于模拟车辆的运动和驾驶行为。对于汽车工程师和研究人员来说,掌握carsim的使用方法和了解其应用案例非常重要。 这个压缩文件中的18个文档资料是为了帮助用户更好地了解和掌握carsim的使用而编写的。每个案例都包含了具体的仿真场景和参数设置,以及对仿真结果的分析和解释。通过阅读这些文档,用户可以学习到carsim的各种功能和应用技巧。 这些案例涵盖了各种不同类型的汽车动力学仿真问题,包括车辆悬挂系统仿真、车辆驾驶稳定性仿真、车辆碰撞仿真等等。每个案例都通过具体的实例和图表展示了仿真的结果和分析过程,便于用户理解和学习。 通过使用这18个合集文档资料,用户可以更加深入地了解和掌握carsim的各种功能和应用,提高自己在汽车动力学仿真领域的技能和水平。对于正在学习carsim或者进行相关研究工作的人员而言,这个合集文件将会是一个非常有用的参考资料。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值