
Frontend Forever App
We have a mobile app for you to download and use. And you can unlock many features in the app.
Get it nowIntall Later
We have a mobile app for you to download and use. And you can unlock many features in the app.
Get it now
These are the output images of the code. You can click on the image to enlarge it. also you can click the try it button to see the output.
This is the source code of the code. You can copy and paste the code to your editor.
xxxxxxxxxx
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<main class="card">
<h3>You can toggle us <i data-feather="smile"></i></h3>
<div class="input-row">
<div class="toggle">
<input type="checkbox">
<span class="slider"></span>
<span class="label">Off</span>
</div>
<div class="checkbox">
<input type="checkbox"">
<span class="check"><i class="checked-icon" data-feather="check"></i></span>
<span class="label">Off</span>
</div>
<div class="radio">
<input type="radio">
<span class="rad"><div class="rad-icon"></div></span>
<span class="label">Off</span>
</div>
</div>
<div class="input-row">
<div class="toggle focus">
<input type="checkbox">
<span class="slider focus"></span>
<span class="label">Off</span>
</div>
<div class="checkbox focus">
<input type="checkbox">
<span class="check"><i class="checked-icon" data-feather="check"></i></span>
<span class="label">Off</span>
</div>
<div class="radio focus">
<input type="radio">
<span class="rad"><div class="rad-icon"></div></span>
xxxxxxxxxx
@keyframes eh {
0% {transform: scale(0%)};
100% {transform: scale(100%)};
}
.feather-check { color: white; width: 30px; height: 30px; }
.checked-icon { display: block; opacity: 0;}
.rad-icon { opacity: 0; background-color: transparent; border: 2px solid white; height: 20px; width: 20px; border-radius: 50%; margin: 5px auto; display: block; }
* {
box-sizing: border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
-o-box-sizing:border-box;
word-wrap: break-word;
}
body {
height: 100vh;
margin: 0;
padding: 0;
background-image: linear-gradient(200deg, #ffd75e 0% 51.9%, #4287f5 52% 54.9%, white 55%);
display: flex;
justify-content: center;
align-items: center;
font-family: 'Poppins', sans-serif;
font-size: 18px;
}
.card {
background-color: white;
width: 60vw;
height: 70vh;
border-radius: 10px;
box-shadow: 0px 0px 20px 10px rgba(0, 0, 0, 0.2);
display: flex;
flex-flow: column;
justify-content: space-evenly;
align-items: center;
padding: 2% 4%;
}
h3 .feather { vertical-align: middle; margin-left: 10px;}
xxxxxxxxxx
feather.replace();
$(document).ready(function(){
$('.toggle input[type="checkbox"]').click(function(){
$(this).parent().toggleClass('on');
if ($(this).parent().hasClass('on')) {
$(this).parent().children('.label').text('On')
} else {
$(this).parent().children('.label').text('Off')
}
});
$('.checkbox input[type="checkbox"]').click(function(){
$(this).parent().toggleClass('on');
if ($(this).parent().hasClass('on')) {
$(this).parent().children('.label').text('On')
} else {
$(this).parent().children('.label').text('Off')
}
});
$('.radio input[type="radio"]').click(function(){
$(this).parent().addClass('on');
if ($(this).parent().hasClass('on')) {
$(this).parent().children('.label').text('On')
}
});
$('input').focusin (function() {
$(this).parent().addClass('focus');
});
$('input').focusout (function() {
$(this).parent().removeClass('focus');
});
});
And also you can click the try it button to see the output of the code in our web Code Playground.
You can also download the code to the zip format by clicking the download button. The download process is little bit complex, you need ti await for 10 seconds. after that you can download the code by clicking the generated download link.
Leave a Comment
You need to login first to comment.