js+div+css实现多个网格内卡片翻转动画效果代码

代码语言:html

所属分类:动画

代码描述:js+div+css实现多个网格内卡片翻转动画效果代码

代码标签: js div css 多个 网格 卡片 翻转 动画

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

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

<head>
  <meta charset="UTF-8">
  
  
  
  
<style>
body{
        background-color: black;
        overflow: hidden;
    }
    .container{
        position: fixed;
        width: 75%;
        height: 75%;
        margin: auto;
        padding: 0;
    }
    .container{
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    .container{
        display: grid;
        grid-template-columns: auto auto auto auto auto;
        grid-template-rows: auto auto auto auto auto;
        gap: 2px;
    }
    .items{
        position: relative;
        width: 100%;
        height: 100%;
        margin: auto;
        padding: 0;
        overflow: hidden;
        background-color: rgb(60, 60, 60);
    }
    .slides{
        width: 0%;
        height: 100%;
        margin: auto;
        padding: 0;
        position: relative;
        background-color: rgb(30, 30, 30);
    }
    @keyframes value1 {
        from, to{width: 0%; transform: translateX(0%);}
        50%{width: 100%; transform: translateX(100%);}
    }
    @keyframes value2 {
        from, to{width: 0%; transform: translateX(0%);}
        50%{width: 100%; transform: translateX(-100%);}
    }
    #toRight{
        animation: value1 10s ease-in-out infinite;
    }
    #toLeft{
        animation: value2 10s ease-in-out infinite;
    }
</style>

  
</head>

<body translate="no">
  <div class="container">
        <div class="items">
            <div class="slides"></div>
        </div>
        <div class="items">
            <div class="slides"></div>
        </div>
        <div class="items">
            <div class="slides"></div>
        </div>
        <div class="items">
            <div class="slides"></div>
        </div>
        <div class="items">
            <div class="slides"></div>
        </div>
        <div class="items">
            <div class="slides"></div>
        </div>
        <div class="items">
            <div class="slides"></div>
        </div>
        <div class="items">
            <div class="slides"></div>
        </div>
        <div class="items">
            <div class.........完整代码请登录后点击上方下载按钮下载查看

网友评论0