Bouncy Switch

Size
2,830 Kb
Views
28,336

How do I make an bouncy switch?

What is a bouncy switch? How do you make a bouncy switch? This script and codes were developed by Simeon Simeonoff on 17 September 2022, Saturday.

Bouncy Switch Previews

Bouncy Switch - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Bouncy Switch</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container">	<div class="switch">	<input id="switch" class="switch__ctrl" type="checkbox" />	<label class="switch__lbl" for="switch"></label>	</div>
</div>
</body>
</html>

Bouncy Switch - Script Codes CSS Codes

html,
body { height: 100%; box-sizing: border-box; background: #fff;
}
.container { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; height: 100%;
}
.switch__ctrl { position: absolute; opacity: 0; margin: 0; z-index: -1; width: 0; height: 0; left: 0; overflow: hidden; pointer-events: none;
}
.switch__ctrl:checked ~ .switch__lbl { background: limegreen;
}
.switch__ctrl:checked ~ .switch__lbl:before { -webkit-transform: translate3d(19.27273px, 0, 0); transform: translate3d(19.27273px, 0, 0); -webkit-animation: switch-on .35s ease-out; animation: switch-on .35s ease-out;
}
.switch__lbl { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; position: relative; width: 40px; height: 22.72727px; background: black; opacity: 0.8; border-radius: 11.36364px; cursor: pointer; -webkit-tap-highlight-color: transparent; -webkit-transition: background .45s ease-in-out; transition: background .45s ease-in-out;
}
.switch__lbl:before { position: absolute; content: ' '; width: 18.72727px; height: 18.72727px; background: #fff; border-radius: 50%; -webkit-transform: translate3d(2px, 0, 0); transform: translate3d(2px, 0, 0); -webkit-animation: switch-off .35s ease-out; animation: switch-off .35s ease-out; box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.6), 0px 2px 2px 0px rgba(0, 0, 0, 0.3), 0px 3px 1px -2px rgba(0, 0, 0, 0.3);
}
@-webkit-keyframes switch-off { 0% { -webkit-transform: translate3d(19.27273px, 0, 0); transform: translate3d(19.27273px, 0, 0); } 50% { -webkit-transform: translate3d(2px, 0, 0); transform: translate3d(2px, 0, 0); }
}
@keyframes switch-off { 0% { -webkit-transform: translate3d(19.27273px, 0, 0); transform: translate3d(19.27273px, 0, 0); } 50% { -webkit-transform: translate3d(2px, 0, 0); transform: translate3d(2px, 0, 0); }
}
@-webkit-keyframes switch-on { 0% { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } 50% { -webkit-transform: translate3d(19.27273px, 0, 0); transform: translate3d(19.27273px, 0, 0); }
}
@keyframes switch-on { 0% { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } 50% { -webkit-transform: translate3d(19.27273px, 0, 0); transform: translate3d(19.27273px, 0, 0); }
}
Bouncy Switch - Script Codes
Bouncy Switch - Script Codes
Home Page Home
Developer Simeon Simeonoff
Username simeonoff
Uploaded September 17, 2022
Rating 3
Size 2,830 Kb
Views 28,336
Do you need developer help for Bouncy Switch?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Simeon Simeonoff (simeonoff) Script Codes
Create amazing captions with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!