|
@@ -0,0 +1,73 @@
|
|
|
|
|
+<!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 {
|
|
|
|
|
+ background: #ccc;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ img {
|
|
|
|
|
+ width: 120px;
|
|
|
|
|
+ height: 120px;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: -120px;
|
|
|
|
|
+ left: -120px;
|
|
|
|
|
+ transition: all 2s ease-out;
|
|
|
|
|
+ }
|
|
|
|
|
+ </style>
|
|
|
|
|
+</head>
|
|
|
|
|
+
|
|
|
|
|
+<body>
|
|
|
|
|
+ <img src="./images/1.jpg" alt="">
|
|
|
|
|
+ <img src="./images/2.jpg" alt="">
|
|
|
|
|
+ <img src="./images/3.jpg" alt="">
|
|
|
|
|
+ <img src="./images/4.jpg" alt="">
|
|
|
|
|
+ <img src="./images/5.jpg" alt="">
|
|
|
|
|
+ <img src="./images/6.jpg" alt="">
|
|
|
|
|
+ <img src="./images/7.jpg" alt="">
|
|
|
|
|
+ <img src="./images/8.jpg" alt="">
|
|
|
|
|
+ <img src="./images/9.jpg" alt="">
|
|
|
|
|
+ <img src="./images/10.jpg" alt="">
|
|
|
|
|
+ <img src="./images/11.jpg" alt="">
|
|
|
|
|
+ <img src="./images/12.jpg" alt="">
|
|
|
|
|
+ <img src="./images/13.jpg" alt="">
|
|
|
|
|
+ <img src="./images/14.jpg" alt="">
|
|
|
|
|
+ <img src="./images/15.jpg" alt="">
|
|
|
|
|
+ <img src="./images/16.jpg" alt="">
|
|
|
|
|
+ <img src="./images/17.jpg" alt="">
|
|
|
|
|
+ <img src="./images/18.jpg" alt="">
|
|
|
|
|
+ <img src="./images/19.jpg" alt="">
|
|
|
|
|
+ <img src="./images/20.jpg" alt="">
|
|
|
|
|
+ <img src="./images/21.jpg" alt="">
|
|
|
|
|
+ <img src="./images/22.jpg" alt="">
|
|
|
|
|
+ <img src="./images/23.jpg" alt="">
|
|
|
|
|
+ <img src="./images/24.jpg" alt="">
|
|
|
|
|
+ <script>
|
|
|
|
|
+ const imgList = document.querySelectorAll("img");
|
|
|
|
|
+ const screenWidth = document.documentElement.clientWidth || document.body.clientWidth;
|
|
|
|
|
+ const screenHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 0 1 2 3 4 5
|
|
|
|
|
+ * 6 7 8 9 10 11
|
|
|
|
|
+ * 12 13 14 15 16 17
|
|
|
|
|
+ * 18 19 20 21 22 23
|
|
|
|
|
+ */
|
|
|
|
|
+ const x = (screenWidth - 120 * 6) / 7;
|
|
|
|
|
+ const y = (screenHeight - 120 * 4) / 5;
|
|
|
|
|
+
|
|
|
|
|
+ for (let i = 0; i < imgList.length; i++) {
|
|
|
|
|
+ const row = Math.floor(i / 6) + 1;
|
|
|
|
|
+ const col = i % 6 + 1;
|
|
|
|
|
+ imgList[i].style.top = row * y + (row - 1) * 120 + 'px';
|
|
|
|
|
+ imgList[i].style.left = col * x + (col - 1) * 120 + 'px';
|
|
|
|
|
+ imgList[i].style.transitionDelay = (23 - i) * 100 + 'ms';
|
|
|
|
|
+ imgList[i].style.transform = 'rotate(' + Math.random() * 180 + 'deg)'
|
|
|
|
|
+ }
|
|
|
|
|
+ </script>
|
|
|
|
|
+</body>
|
|
|
|
|
+
|
|
|
|
|
+</html>
|