Checkbox With glowing animation free html and css code
Preview:-
Don't forget to give credit:- Mo Waseem
join my telegram channel for updates:- https://t.me/SawggerUi
sometimes link dosent work so copy the link and paste into saved message in telegram and the click on the link.
index.html
1
<div class="container"> <div class="spinner"> <div class="col-md-6 reject-checkbox"> <div class="mb-2 text-center"> <div class="checkbox-wrapper"> <input name="ehs_approval" class="form-check-label custom-radio-label" id="Rejected" type="checkbox" /> <label for="Rejected"> <div class="tick_mark"> <div class="cross"></div> </div> </label> </div> </div> </div> </div> </div>
styles.css
1
.container { display: flex; justify-content: center; align-items: center; height: 100vh; } .spinner { margin: auto; } .reject-checkbox .checkbox-wrapper * { -webkit-tap-highlight-color: transparent; outline: none; } .reject-checkbox .checkbox-wrapper input[type="checkbox"] { display: none; } .reject-checkbox .checkbox-wrapper label { --size: 50px; --shadow: calc(var(--size) * 0.07) calc(var(--size) * 0.1); position: relative; display: block; width: var(--size); height: var(--size); margin: 0 auto; background-color: #a7ff83; background-image: linear-gradient(45deg, #a7ff83 0%, #81c784 50%, #66bb6a 100%); border-radius: 50%; box-shadow: 0 var(--shadow) #7cb342; cursor: pointer; transition: 0.2s ease transform, 0.2s ease background-color, 0.2s ease box-shadow; overflow: hidden; z-index: 1; } .reject-checkbox .checkbox-wrapper label:before { content: ""; position: absolute; top: 50%; right: 0; left: 0; width: calc(var(--size) * 0.7); height: calc(var(--size) * 0.7); margin: 0 auto; background-color: #fff; transform: translateY(-50%); border-radius: 50%; box-shadow: inset 0 var(--shadow) #7cb342; transition: 0.2s ease width, 0.2s ease height; } .reject-checkbox .checkbox-wrapper label:hover:before { width: calc(var(--size) * 0.55); height: calc(var(--size) * 0.55); box-shadow: inset 0 var(--shadow) #689f38; } .reject-checkbox .checkbox-wrapper label:active { transform: scale(0.9); } .reject-checkbox .checkbox-wrapper .tick_mark { position: absolute; top: 9px; left: 2px; right: 0; width: calc(var(--size) * 0.6); height: calc(var(--size) * 0.6); margin: 0 auto; margin-left: calc(var(--size) * 0.14); transform: rotateZ(-92deg); } .reject-checkbox .checkbox-wrapper .tick_mark:before, .reject-checkbox .checkbox-wrapper .tick_mark:after { content: ""; position: absolute; background-color: #fff; border-radius: 2px; opacity: 0; transition: 0.2s ease transform, 0.2s ease opacity; } .reject-checkbox .checkbox-wrapper .tick_mark:before { left: 0; bottom: 0; width: calc(var(--size) * 0.1); height: calc(var(--size) * 0.3); box-shadow: -2px 0 5px rgba(0, 0, 0, 0.23); transform: translateY(calc(var(--size) * -0.68)); } .reject-checkbox .checkbox-wrapper .tick_mark:after { left: 0; bottom: 0; width: 100%; height: calc(var(--size) * 0.1); box-shadow: 0 3px 5px rgba(0, 0, 0, 0.23); transform: translateX(calc(var(--size) * 0.78)); } .reject-checkbox .checkbox-wrapper input[type="checkbox"]:checked + label { background-color: #a7ff83; background-image: linear-gradient(45deg, #ffb74d 0%, #ff9800 50%, #f57c00 100%); box-shadow: rgba(0, 0, 0, 0.3) 0px 19px 38px, rgba(0, 0, 0, 0.22) 0px 15px 12px; } .reject-checkbox .checkbox-wrapper input[type="checkbox"]:checked + label:before { width: 0; height: 0; } .reject-checkbox .checkbox-wrapper input[type="checkbox"]:checked + label .tick_mark:before, .reject-checkbox .checkbox-wrapper input[type="checkbox"]:checked + label .tick_mark:after { background-color: #fff; width: calc(var(--size) * 0.4); height: calc(var(--size) * 0.1); left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: 1; } .reject-checkbox .checkbox-wrapper input[type="checkbox"]:checked + label .tick_mark:before { transform: translate(-50%, -50%) rotate(45deg); } .reject-checkbox .checkbox-wrapper input[type="checkbox"]:checked + label .tick_mark:after { transform: translate(-50%, -50%) rotate(-45deg); } @keyframes glow { 0% { box-shadow: 0 0 10px #a7ff83, 0 0 20px #a7ff83, 0 0 30px #a7ff83, 0 0 40px #a7ff83, 0 0 50px #a7ff83, 0 0 60px #a7ff83, 0 0 70px #a7ff83; } 100% { box-shadow: 0 0 20px #a7ff83, 0 0 30px #a7ff83, 0 0 40px #a7ff83, 0 0 50px #a7ff83, 0 0 60px #a7ff83, 0 0 70px #a7ff83, 0 0 80px #a7ff83; } } .checkbox-wrapper label:hover { animation: glow 1s ease-in-out infinite