Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions omlette.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
body {
padding: 0;
margin: 0;
background-color: #f4b927;
}
.wrapper {
height: 350px;
width: 350px;
position: absolute;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
}
input[type="checkbox"] {
-webkit-appearance: none;
appearance: none;
height: 100px;
width: 180px;
background-color: #2a2a2a;
border-radius: 50px;
position: absolute;
margin: auto;
left: 0;
right: 0;
top: 0;
bottom: 0;
box-shadow: 0 0 22px rgba(145, 106, 8 . 0.8);
outline: none;
cursor: pointer;
}
label {
height: 80px;
width: 80px;
perspective: 250px;
-webkit-perspective: 250px;
position: absolute;
top: 135px;
left: 95px;
}
.omlette {
height: 100%;
width: 100%;
position: relative;
transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
transform-origin: right;
transition: 0.2s;
}
.front,
.back {
height: 100%;
width: 100%;
position: relative;
border-radius: 50%;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
.front {
background-color: #e8e0dc;
}
.front:before,
.front:after,
.back:after {
content: "";
position: absolute;
margin: auto;
left: 0;
right: 0;
top: 0;
bottom: 0;
}

.front:after {
height: 25px;
width: 27px;
border-top: 4px solid #ffffff;
border-radius: 50%;
transform: rotate(-35deg);
}

.front:before {
height: 40px;
width: 40px;
background-image: linear-gradient(135deg, #f6b02f, #ea6f0c);
border-radius: 50%;
}

.back {
background-color: #cabfa9;
transform: rotateY(-180deg);
bottom: 100%;
}

.back:after {
height: 40px;
width: 40px;
background-color: #d8b886;
border-radius: 50%;
}

input:checked + label > .omlette {
transform: rotateY(180deg);
}
17 changes: 17 additions & 0 deletions omlette.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<head>
<title>Omlette Switch</title>
<link rel="stylesheet" href="omlette.css">
</head>
<body>
<div class="wrapper">
<input type="checkbox" id="toggle">
<label for="toggle">
<div class="omlette">
<div class="front"></div>
<div class="back"></div>
</div>
</label>
</div>
</body>
</html>