logo

06 Jan 2022

HTML & CSS:

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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 <style> @import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap'); *{ margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; } body{ background: black; } .container{ width: 50px; height: 50px; position: fixed; top: 90%; left: 50%; transform: translate(-50%); border-radius: 10px; background: #252525; } .container::before{ content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 20px; height: 20px; background: white; border-radius: 50px; box-shadow: 0 0 0 5px rgb(94,94,94),0 0 0 10px rgb(59,59,59); } .container input{ -webkit-appearance: none; position: absolute; width: 100%; height: 100%; outline: none; cursor: pointer; } .menu{ width: 300px; height: 300px; background-color: #0093e9; background-image: linear-gradient(160deg,#0093e9 0%,#80d0c7 100%); position: absolute; top: -630%; left: -120px; display: none; flex-direction: column; justify-content: center; border-radius: 10px; } .menu div{ display: flex; align-items: center; margin: 10px 30px 0 35px; padding: 10px 0 10px 15px; color: white; background: rgba(255, 255, 255, 0.336); border-radius: 10px; cursor: pointer; transition: all .4s; } .menu div p{ margin-left: 10px; } .menu div:hover{ transform: translateX(12px); } input:checked ~ .menu{ display: flex; animation: anim 0.5s; } @keyframes anim{ 0%{ clip-path: circle(0% at 50% 50%); } 100%{ clip-path: circle(100% at 50% 50%); } } </style> <div class="container"> <input type="checkbox" name="" id=""> <div class="menu"> <div> <i class="fas fa-home fa-2x"></i> <p>Home</p> </div> <div> <i class="fas fa-cogs fa-2x"></i> <p>Services</p> </div> <div> <i class="fas fa-address-card fa-2x"></i> <p>About us</p> </div> <div> <i class="fas fa-envelope fa-2x"></i> <p>Contact us</p> </div> </div> </div>