Back

Checkbox

1 
2<label class="container">
3 <input type="checkbox" checked="checked">
4 <svg class="bell-regular" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512">
5 <path d="M224 0c-17.7 0-32 14.3-32 32V49.9C119.5 61.4 64 124.2 64 200v33.4c0 45.4-15.5 89.5-43.8 124.9L5.3 377c-5.8 7.2-6.9 17.1-2.9 25.4S14.8 416 24 416H424c9.2 0 17.6-5.3 21.6-13.6s2.9-18.2-2.9-25.4l-14.9-18.6C399.5 322.9 384 278.8 384 233.4V200c0-75.8-55.5-138.6-128-150.1V32c0-17.7-14.3-32-32-32zm0 96h8c57.4 0 104 46.6 104 104v33.4c0 47.9 13.9 94.6 39.7 134.6H72.3C98.1 328 112 281.3 112 233.4V200c0-57.4 46.6-104 104-104h8zm64 352H224 160c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7s18.7-28.3 18.7-45.3z"></path>
6 </svg>
7 <svg class="bell-solid" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512">
8 <path d="M224 0c-17.7 0-32 14.3-32 32V51.2C119 66 64 130.6 64 208v18.8c0 47-17.3 92.4-48.5 127.6l-7.4 8.3c-8.4 9.4-10.4 22.9-5.3 34.4S19.4 416 32 416H416c12.6 0 24-7.4 29.2-18.9s3.1-25-5.3-34.4l-7.4-8.3C401.3 319.2 384 273.9 384 226.8V208c0-77.4-55-142-128-156.8V32c0-17.7-14.3-32-32-32zm45.3 493.3c12-12 18.7-28.3 18.7-45.3H224 160c0 17 6.7 33.3 18.7 45.3s28.3 18.7 45.3 18.7s33.3-6.7 45.3-18.7z"></path>
9 </svg>
10</label>
1 
2/*------ Settings ------*/
3.container {
4 --color: #a5a5b0;
5 --size: 30px;
6 display: flex;
7 justify-content: center;
8 align-items: center;
9 position: relative;
10 cursor: pointer;
11 font-size: var(--size);
12 user-select: none;
13 fill: var(--color);
14}
15 
16.container .bell-regular {
17 position: absolute;
18 animation: keyframes-fill .5s;
19}
20 
21.container .bell-solid {
22 position: absolute;
23 display: none;
24 animation: keyframes-fill .5s;
25}
26 
27/* ------ On check event ------ */
28.container input:checked ~ .bell-regular {
29 display: none;
30}
31 
32.container input:checked ~ .bell-solid {
33 display: block;
34}
35 
36/* ------ Hide the default checkbox ------ */
37.container input {
38 position: absolute;
39 opacity: 0;
40 cursor: pointer;
41 height: 0;
42 width: 0;
43}
44 
45/* ------ Animation ------ */
46@keyframes keyframes-fill {
47 0% {
48 opacity: 0;
49 }
50 
51 25% {
52 transform: rotate(25deg);
53 }
54 
55 50% {
56 transform: rotate(-20deg) scale(1.2);
57 }
58 
59 75% {
60 transform: rotate(15deg);
61 }
62}

MIT License

Copyright © 2026 catraco (Catraco)


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.