Glow Button Effect

Home / Web Code Snippet / Glow Button Effect

Glow Button Effect


https://youtube.com/shorts/0Xji7-U1K9I?si=I91jAwmmB0N0BXuN

HTML CODE:-

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
    <ul>
    <li>
      <input type="checkbox">
      <div><i class="fa-solid fa-house"></i></div>
    </li>
    <li>
      <input type="checkbox">
      <div><i class="fa-solid fa-user"></i></div>
    </li>
    <li>
      <input type="checkbox">
      <div><i class="fa-brands fa-facebook"></i></div>
    </li>
    <li>
      <input type="checkbox">
      <div><i class="fa-solid fa-heart"></i></div>
    </li>
    <li>
      <input type="checkbox">
      <div><i class="fa-brands fa-github"></i></div>
    </li>
  </ul>
</body>
</html>

CSS CODE:-

    body{
    padding: 0px;
    margin: 0px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: black;
}
ul{
    position: relative;
    display: flex;
}
li{
    list-style: none;
}
input[type="checkbox"]{
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 70px;
    width: 70px;
    z-index: 100;
}
div{
    position: relative;
    height: 70px;
    width: 70px;
    background-color: #18191f;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    cursor: pointer;
    margin: 0 6px;
    border-radius: 20px;
    box-shadow: -1px -1px 4px rgba(255, 255, 255, 0.05),
    4px 4px 6px rgba(0, 0, 0, 0.2),inset -1px -1px 4px rgba(255, 255, 255, 0.05),
    inset 1px 1px 1px rgba(0, 0, 0, 0.1);
}
input[type="checkbox"]:checked ~ div{
    box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.05),
    inset 4px 4px 6px rgba(0, 0, 0, 0.2);
    color: yellow;
    text-shadow: 0 0 15px yellow,0 0 25px yellow;
    animation: animate 1s linear infinite;
}
@keyframes animate{
    0%{
        filter: hue-rotate(0deg);
    }
    100%{
        filter: hue-rotate(360deg);
    }
}