Simple toggle

Developer
Size
2,684 Kb
Views
8,096

How do I make an simple toggle?

What is a simple toggle? How do you make a simple toggle? This script and codes were developed by on 12 January 2023, Thursday.

Simple toggle Previews

Simple toggle - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple toggle</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container"> <input id="opu-switch" type="checkbox" hidden="hidden"/> <label class="opu-switch" for="opu-switch"></label>
</div>
</body>
</html>

Simple toggle - Script Codes CSS Codes

body { background: #222;
}
.container { position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
}
.opu-switch { display: inline-block; width: 40px; height: 20px; padding: 4px; border-radius: 20px; background: #dea28e; vertical-align: middle; position: relative; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-transition: background 350ms ease; transition: background 350ms ease;
}
.opu-switch:before, .opu-switch:after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; position: absolute; top: 50%; -webkit-transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease; transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease;
}
.opu-switch:before { background: rgba(224, 86, 58, 0.075); -webkit-transform: translate3d(0, -50%, 0) scale(0); transform: translate3d(0, -50%, 0) scale(0);
}
.opu-switch:after { background: #E0563A; -webkit-transform: translate3d(0, -50%, 0); transform: translate3d(0, -50%, 0);
}
.opu-switch:active:before { -webkit-transform: translate3d(0, -50%, 0) scale(3); transform: translate3d(0, -50%, 0) scale(3);
}
input:checked + .opu-switch { background: #C2EBAE;
}
input:checked + .opu-switch:before { background: rgba(111, 181, 76, 0.075); -webkit-transform: translate3d(100%, -50%, 0) scale(1); transform: translate3d(100%, -50%, 0) scale(1);
}
input:checked + .opu-switch:after { background: #6FB54C; -webkit-transform: translate3d(100%, -50%, 0); transform: translate3d(100%, -50%, 0);
}
input:checked + .opu-switch:active:before { background: rgba(111, 181, 76, 0.075); -webkit-transform: translate3d(100%, -50%, 0) scale(3); transform: translate3d(100%, -50%, 0) scale(3);
}
Simple toggle - Script Codes
Simple toggle - Script Codes
Home Page Home
Developer
Username oneplusuniverse
Uploaded January 12, 2023
Rating 4.5
Size 2,684 Kb
Views 8,096
Do you need developer help for Simple toggle?

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!

(oneplusuniverse) Script Codes
Create amazing blog posts 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!