fengchuanyu 3 月之前
父节点
当前提交
b5722cbe86
共有 4 个文件被更改,包括 93 次插入0 次删除
  1. 50 0
      8_CSS3/7_CSS3动画.html
  2. 二进制
      8_CSS3/img/image.png
  3. 二进制
      8_CSS3/img/image1.png
  4. 43 0
      8_CSS3/练习题2_照片墙.html

+ 50 - 0
8_CSS3/7_CSS3动画.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <style>
+        .box{
+            width: 200px;
+            height: 50px;
+            background-color: red;
+            /* animation: foo 1s linear 2 forwards; */
+            animation-name: foo;
+            animation-duration: 1s;
+            animation-timing-function: linear;
+            animation-iteration-count: infinite;
+            animation-fill-mode: forwards;
+            animation-delay: 1s;
+        }
+        .box:hover{
+            animation-play-state: paused;
+        }
+        @keyframes foo {
+            0%{
+                width: 200px;
+                height: 50px;
+            }
+            50%{
+                width: 400px;
+                height: 50px;
+            }
+            100%{
+                width: 400px;
+                height: 400px;
+            }
+        }
+        /* @keyframes foo {
+            from{
+                width: 200px;
+            }
+            to{
+                width: 400px;
+            }
+        } */
+    </style>
+</head>
+<body>
+    <div class="box"></div>
+</body>
+</html>

二进制
8_CSS3/img/image.png


二进制
8_CSS3/img/image1.png


+ 43 - 0
8_CSS3/练习题2_照片墙.html

@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+    <style>
+        body{
+            perspective: 1000px;
+        }
+        .box{
+            width: 400px;
+            height: 400px;
+            border:1px dashed black;
+            margin:100px auto;
+            transform-style: preserve-3d;
+        }
+        .box img{
+            width: 300px;
+            transition: all 1s linear;
+            
+        }
+        .box img:nth-child(1){
+            transform: rotate(45deg);
+        }
+        .box img:nth-child(2){
+            transform: rotate(-45deg);
+        }
+        .box img:nth-child(1):hover{
+            transform:rotate(180deg) scale(2) translateZ(2px);
+        }
+        .box img:nth-child(2):hover{
+            transform: translateZ(500px);
+        }
+    </style>
+</head>
+<body>
+    <div class="box">
+        <img src="./img/image1.png" alt="">
+        <img src="./img/image.png" alt="">
+    </div>
+</body>
+</html>