snow
✨ SASITHORN SRIJUN
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Christmas Tree 🎄</title> <style> * { margin: 0; box-sizing: border-box; } body { padding: 0; /* background-color:#ad242c; */ background:#333; } .tree { position: absolute; top: calc(40% - 150px); left: calc(60% - 100px - var(--j) * 50px); transform: perspective(1000px); width: 100px * var(--j); height: 100px; transform-style: preserve-3d; transform: translateY(calc(100px * var(--j))); /* background: black; */ /*กำหนดตำแหน่งต้นไม้*/ } .tree div { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform-style: preserve-3d; animation: animate 5s linear infinite; } .tree:hover{ top: calc(40% - 150px); animation: animate .2s linear infinite; } .tree div span { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; background: linear-gradient(to left, hsl(171, 100%, 21%), hsl(86, 100%, 81%), hsl(171, 100%, 21%)); /* background: #cbaf71; */ /* สีใบไม้ */ border-top-left-radius: 25px; border-top-right-radius: 25px; } .tree div span:nth-child(1){ transform: rotateY(0deg); } .tree div span:nth-child(2){ transform: rotateY(45deg); } .tree div span:nth-child(3){ transform: rotateY(90deg); } .tree div span:nth-child(4){ transform: rotateY(135deg); } @keyframes animate { 0% { transform: perspective(1000px) rotateY(0deg); } 100% { transform: perspective(1000px) rotateY(359deg); } } .snow1{ position:absolute; bottom:0; width:100%; } .snow2{ position:absolute; bottom:0; width:100%; opacity: .7; } </style> </head> <body> <div class=tree style="--j:1;width:100px;"> <div> <span style="--i:0;"> </span> <span style="--i:1;"> </span> <span style="--i:2;"> </span> <span style="--i:3;"> </span> </div> </div> <div class=tree style="--j:2;width:200px;"> <div> <span style="--i:0;"> </span> <span style="--i:1;"> </span> <span style="--i:2;"> </span> <span style="--i:3;"> </span> </div> </div> <div class=tree style="--j:3;width:300px;"> <div> <span style="--i:0;"> </span> <span style="--i:1;"> </span> <span style="--i:2;"> </span> <span style="--i:3;"> </span> </div> </div> <div class=tree style="--j:4;width:400px;"> <div> <span style="--i:0;"> </span> <span style="--i:1;"> </span> <span style="--i:2;"> </span> <span style="--i:3;"> </span> </div> </div> <div class=tree style="--j:5;width:500px;"> <div> <span style="--i:0;"> </span> <span style="--i:1;"> </span> <span style="--i:2;"> </span> <span style="--i:3;"> </span> </div> </div> <svg class="snow1" width=100% viewBox="0 0 1918 254" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M803.176 172C597.548 47.2 181.38 14.6667 -1 14V255H1918V0C1827.48 50 1605.25 140.2 1440.5 101C1234.58 52 1060.21 328 803.176 172Z" fill="white"/> </svg> <svg class="snow2" width=100% viewBox="0 0 1920 376" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M748.33 182.409C597.539 76.1784 185.947 16.5403 -1 0V376H1964V102.736C1836.12 68.4907 1537.72 27.6758 1367.21 138.379C1154.07 276.758 936.818 315.197 748.33 182.409Z" fill="#EEEEEE"/> </svg> </body> </html> <!-- rest area here!!! -->