<div class="wrapper">
<div class="box">
<div class="container"><input type="checkbox" /></div>
<a href="https://youtu.be/xRRwuRASNyw" target="_blank">Watch Me Code <i class="fab fa-youtube"></i></a>
</div>
</div>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
box-sizing: border-box;
tap-highlight-color: transparent;
}
body {
background-color: #221e27;
}
.wrapper {
height: 50vh;
background: linear-gradient(315deg, #8175fe, #89befe);
background: linear-gradient(135deg, #8175fe, #89befe);
}
.box {
width: 20em;
position: absolute;
transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
}
.container {
width: 100%;
height: 20em;
background-color: #2d2936;
box-shadow: 0 2.5em 4.6em rgba(0, 0, 0, 0.3);
box-shadow: 0 2.5em 4.6em rgba(0, 0, 0, 0.3);
border-radius: 0.3em;
position: relative;
}
a {
display: block;
background: linear-gradient(315deg, #8175fe, #89befe);
background: linear-gradient(135deg, #8175fe, #89befe);
color: #221e27;
text-align: center;
font-family: "Poppins", sans-serif;
font-size: 1.2em;
padding: 1em 0;
margin-top: 1em;
text-decoration: none;
border-radius: 0.3em;
}
input[type="checkbox"] {
appearance: none;
appearance: none;
appearance: none;
position: absolute;
margin: auto;
left: 0;
right: 0;
top: 0;
bottom: 0;
cursor: pointer;
outline: none;
height: 5.6em;
width: 12.5em;
background-color: #000000;
transform: skewX(-7deg);
transform: skewX(-7deg);
transform: skewX(-7deg);
transition: 0.3s;
transition: 0.3s;
transition: 0.3s;
}
input[type="checkbox"]:before {
font-size: 1.5em;
content: "OFF";
position: absolute;
width: 3.75em;
height: 2.9em;
background-color: #2d2936;
color: #a0a0a0;
top: 0.42em;
left: 0.42em;
transition: 0.3s;
transition: 0.3s;
transition: 0.3s;
display: box;
display: flexbox;
display: flex;
box-align: center;
flex-align: center;
align-items: center;
box-pack: center;
flex-pack: center;
justify-content: center;
font-family: "Poppins", sans-serif;
font-weight: 600;
letter-spacing: 1px;
}
input[type="checkbox"]:checked {
background: linear-gradient(315deg, #8175fe, #89befe);
background: linear-gradient(135deg, #8175fe, #89befe);
}
input[type="checkbox"]:checked:before {
content: "ON";
left: 4.1em;
color: #89befe;
}
This Pen doesn't use any external JavaScript resources.