|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 6 | + <link rel="icon" href="/assets/icon.png" /> |
| 7 | + <title>Day 93/100</title> |
| 8 | + </head> |
| 9 | + <body> |
| 10 | + <main> |
| 11 | + <div class="toggle" id="toggle"> |
| 12 | + <div class="square square-1"></div> |
| 13 | + <div class="square square-2"></div> |
| 14 | + <div class="square square-3"></div> |
| 15 | + <div class="square square-4"></div> |
| 16 | + |
| 17 | + <div class="square-center"></div> |
| 18 | + </div> |
| 19 | + </main> |
| 20 | + |
| 21 | + <style> |
| 22 | + body { |
| 23 | + margin: 0; |
| 24 | + overflow: hidden; |
| 25 | + display: flex; |
| 26 | + justify-content: center; |
| 27 | + align-items: center; |
| 28 | + min-height: 100vh; |
| 29 | + background-color: #000; |
| 30 | + } |
| 31 | + |
| 32 | + .toggle { |
| 33 | + position: relative; |
| 34 | + cursor: pointer; |
| 35 | + width: 90px; |
| 36 | + aspect-ratio: 1/1; |
| 37 | + |
| 38 | + transition: all 0.3s ease-in-out; |
| 39 | + } |
| 40 | + |
| 41 | + .square { |
| 42 | + position: absolute; |
| 43 | + background-color: #fff; |
| 44 | + width: 30px; |
| 45 | + height: 30px; |
| 46 | + transition: all 0.3s 0.3s ease-in-out; |
| 47 | + } |
| 48 | + |
| 49 | + .square-1 { |
| 50 | + top: 0px; |
| 51 | + left: 0px; |
| 52 | + } |
| 53 | + .square-2 { |
| 54 | + top: 0px; |
| 55 | + right: 0px; |
| 56 | + } |
| 57 | + .square-3 { |
| 58 | + bottom: 0px; |
| 59 | + left: 0px; |
| 60 | + } |
| 61 | + .square-4 { |
| 62 | + bottom: 0px; |
| 63 | + right: 0px; |
| 64 | + } |
| 65 | + |
| 66 | + .square-center { |
| 67 | + position: absolute; |
| 68 | + background-color: #000; |
| 69 | + left: 50%; |
| 70 | + top: 50%; |
| 71 | + transform: translate(-50%, -50%); |
| 72 | + outline: 10px solid #000; |
| 73 | + outline-offset: -10px; |
| 74 | + width: 30px; |
| 75 | + aspect-ratio: 1/1; |
| 76 | + transition: all 0.3s ease-in-out; |
| 77 | + } |
| 78 | + |
| 79 | + .toggle-on { |
| 80 | + background-color: #fff; |
| 81 | + |
| 82 | + transition: all 0.3s 0.3s ease-in-out; |
| 83 | + } |
| 84 | + |
| 85 | + .toggle-on .square-center { |
| 86 | + width: 60px; |
| 87 | + background-color: #fff; |
| 88 | + |
| 89 | + transition: all 0.3s 0.3s ease-in-out; |
| 90 | + } |
| 91 | + |
| 92 | + .toggle-on .square-1 { |
| 93 | + width: 90px; |
| 94 | + transition: all 0.3s ease-in-out; |
| 95 | + } |
| 96 | + .toggle-on .square-2 { |
| 97 | + height: 90px; |
| 98 | + transition: all 0.3s ease-in-out; |
| 99 | + } |
| 100 | + .toggle-on .square-3 { |
| 101 | + height: 90px; |
| 102 | + transition: all 0.3s ease-in-out; |
| 103 | + } |
| 104 | + .toggle-on .square-4 { |
| 105 | + width: 90px; |
| 106 | + transition: all 0.3s ease-in-out; |
| 107 | + } |
| 108 | + </style> |
| 109 | + |
| 110 | + <script> |
| 111 | + let toggle = document.getElementById("toggle"); |
| 112 | + |
| 113 | + toggle.onclick = () => { |
| 114 | + toggle.classList.toggle("toggle-on"); |
| 115 | + }; |
| 116 | + </script> |
| 117 | + </body> |
| 118 | +</html> |
0 commit comments