HTMLify
Linkedin Loader
Views: 284 | Author: djdj
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Puzzle Animation</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { background-color: #f0f0f0; display: flex; justify-content: center; align-items: center; height: 100vh; overflow: hidden; } .puzzle-container { position: relative; width: 300px; height: 200px; } .puzzle-piece { position: absolute; width: 50px; height: 50px; background-color: #000; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); border-radius: 8px; animation: float 4s ease-in-out infinite; } .purple { background-color: purple; left: 20%; top: 10%; } .yellow { background-color: yellow; left: 50%; top: 30%; } .teal { background-color: teal; left: 75%; top: 20%; } .red { background-color: red; left: 30%; top: 60%; } @keyframes float { 0% { transform: translateY(0) rotate(0deg); } 25% { transform: translateY(-50px) rotate(15deg); } 50% { transform: translateY(0) rotate(0deg); } 75% { transform: translateY(50px) rotate(-15deg); } 100% { transform: translateY(0) rotate(0deg); } } </style> </head> <body> <div class="puzzle-container"> <div class="puzzle-piece purple"></div> <div class="puzzle-piece yellow"></div> <div class="puzzle-piece teal"></div> <div class="puzzle-piece red"></div> </div> <script src="script.js"></script> </body> </html> |