fengchuanyu 8 місяців тому
батько
коміт
32751f26e3

+ 64 - 0
6_css3/6_动画.html

@@ -0,0 +1,64 @@
+<!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: 100px;
+            height: 100px;
+            background-color: red;
+            animation-name: foo;
+            animation-duration: 1s;
+            animation-timing-function: linear;
+            /* animation-iteration-count: 2; */
+            animation-fill-mode: forwards;
+        }
+        @keyframes foo {
+            0%{
+                width: 100px;
+                height: 100px;
+            }
+            50%{
+                width: 300px;
+                
+            }
+            100%{
+                width: 300px;
+                height: 300px;
+            }
+        }
+        
+        /* .div1{
+            width: 0;
+            height: 0;
+            margin:100px auto;
+            border-top: 50px solid red;
+            border-left: 50px solid blue;
+            border-right: 50px solid yellow;
+            border-bottom: 50px solid green;
+            animation-name: foo;
+            animation-duration: 1s;
+            animation-timing-function: linear;
+            animation-iteration-count: infinite;
+            animation-delay: 2s;
+        } */
+        /* @keyframes foo {
+            from{
+                transform: rotate(0);
+            }
+            to{
+                transform: rotate(360deg);
+            }
+        } */
+        .div1:hover{
+            animation-play-state: paused;
+        }
+    </style>
+</head>
+<body>
+    <div class="box"></div>
+    <!-- <div class="div1"></div> -->
+</body>
+</html>

BIN
6_css3/img/image3.png


BIN
6_css3/img/image4.png


+ 50 - 0
6_css3/练习题2_简易照片墙.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>
+        body{
+            /* 观察者距离 */
+            perspective: 1000px;
+            /* 观察者视角位置 */
+            /* perspective-origin: right bottom; */
+            /* perspective-origin: 100px 10px; */
+        }
+        .box{
+            width: 400px;
+            height: 400px;
+            border:1px dashed black;
+            margin:100px auto;
+            transform-style: preserve-3d;
+        }
+        .box img{
+            width: 400px;
+            transition: all .5s linear;
+        }
+        .box img:nth-child(1){
+            transform: rotate(15deg);
+        }
+        .box img:nth-child(2){
+            transform: rotate(-15deg);
+        }
+        .box img:nth-child(1):hover{
+            /* transform: rotate(0) scale(2); */
+            /* transform: translateZ(500px) rotate(0); */
+            transform: translateZ(500px);
+            
+        }
+        .box img:nth-child(2):hover{
+            /* transform: rotate(0) scale(2); */
+            transform: translateZ(300px);
+        }
+    </style>
+</head>
+<body>
+    <div class="box">
+        <img src="./img/image3.png" alt="img">
+        <img src="./img/image4.png" alt="img">
+    </div>
+</body>
+</html>