<div class="container">
<div class="light">
<h3>Toggle Switches (Light)</h3>
<div class="switch">
<input id="toggle1" class="toggle" checked="true" type="checkbox">
<label for="toggle1"></label>
<span class="switch-label">checked</span>
</div>
<div class="switch">
<input id="toggle2" class="toggle" type="checkbox">
<label for="toggle2"></label>
<span class="switch-label">UnChecked Toggle</span>
</div>
<div class="switch">
<input id="toggle6" class="toggle" type="checkbox" disabled="disabled">
<label for="toggle6"></label>
<span class="switch-label">Disabled</span>
</div>
<br><br>
<br><br>
<ul>
<h3>Checkbox Examples</h3>
<li>
<input id="checkbox1" class="checkbox" type="checkbox">
<label for="checkbox1">Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh</label>
</li>
<li>
<input id="checkbox2" class="checkbox" type="checkbox" checked="true">
<label for="checkbox2">Label for 2</label>
</li>
<li>
<input id="checkbox3" class="checkbox" type="checkbox">
<label for="checkbox3">Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh</label>
</li>
<li>
<input id="checkbox4" class="checkbox" type="checkbox" disabled="true">
<label for="checkbox4">Label for 4 (disabled)</label>
</li>
</ul>
<ul>
<h3>Radio Buttons</h3>
<li>
<input id="radio1" class="radio" type="radio" name="radio">
<label for="radio1">Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh</label>
</li>
<li>
<input id="radio2" class="radio" type="radio" name="radio" checked="true">
<label for="radio2">Label for 2</label>
</li>
<li>
<input id="radio3" class="radio" type="radio" name="radio">
<label for="radio3">Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh</label>
</li>
<li>
<input id="radio4" class="radio" type="radio" name="radio" disabled="true">
<label for="radio4">Label for 4 (disabled)</label>
</li>
</ul>
</div>
<div class="dark">
<div class="switch">
<input id="toggle3" class="toggle" checked="checked" type="checkbox">
<label for="toggle3"></label>
</div>
<div class="switch">
<input id="toggle4" class="toggle" type="checkbox">
<label for="toggle4"></label>
<span class="switch-label">Label</span>
</div>
<div class="switch">
<input id="toggle5" class="toggle" type="checkbox" disabled="disabled">
<label for="toggle5"></label>
</div>
<ul>
<li>
<input id="checkboxa" class="checkbox" type="checkbox">
<label for="checkboxa">Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh</label>
</li>
<li>
<input id="checkboxb" class="checkbox" type="checkbox" checked="true">
<label for="checkboxb">Label for 2</label>
</li>
<li>
<input id="checkboxc" class="checkbox" type="checkbox" disabled="true">
<label for="checkboxc">Label for 4 (disabled)</label>
</li>
</ul>
<ul>
<li>
<input id="radioa" class="radio" type="radio" name="radio">
<label for="radioa">Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh Label for checkbox 1 here in the flesh</label>
</li>
<li>
<input id="radiob" class="radio" type="radio" name="radio" checked="true">
<label for="radiob">Label for 2</label>
</li>
<li>
<input id="radioc" class="radio" type="radio" name="radio" disabled="true">
<label for="radioc">Label for 4 (disabled)</label>
</li>
</ul>
</div>
</div>
.switch {
height: 4.4rem;
overflow: hidden;
width: 7rem;
position: relative;
display: inline-block;
margin: 0;
padding: 0;
}
.switch .switch-label {
width: 100%;
font-size: 0.5rem;
text-transform: uppercase;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #999;
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
input.toggle {
visibility: hidden;
}
input.toggle + label {
width: 4rem;
border-radius: 4rem;
visibility: visible;
}
input.toggle + label:hover {
cursor: pointer;
}
input.toggle:disabled + label:before {
background-color: rgba(0, 0, 0, 0.1);
}
input.toggle:disabled + label:before.dark, .dark input.toggle:disabled + label:before {
background-color: rgba(255, 255, 255, 0.075);
}
input.toggle:disabled + label:after {
background-color: #f5f5f5;
box-shadow: 0 0.1rem 0.1rem 0rem rgba(0, 0, 0, 0.2);
}
input.toggle:disabled + label:after.dark, .dark input.toggle:disabled + label:after {
background-color: #464646;
}
input.toggle + label:before, input.toggle + label:after {
display: block;
position: absolute;
top: 0;
left: 0;
bottom: 0;
content: "";
}
input.toggle + label:before {
right: 1rem;
left: 0.5rem;
top: 0.8rem;
bottom: 1.8rem;
border-radius: 5rem;
transition: background 0.3s;
background-color: rgba(0, 0, 0, 0.2);
}
input.toggle + label:before.dark, .dark input.toggle + label:before {
background-color: rgba(255, 255, 255, 0.2);
}
input.toggle + label:after {
width: 3rem;
height: 3rem;
top: 0.2rem;
left: 0.3rem;
background-color: #fff;
border-radius: 100%;
box-shadow: 0 0.1rem 0.25rem 0rem rgba(0, 0, 0, 0.3);
-webkit-transition: all 0.3s cubic-bezier(0.915, 0.01, 0.075, 0.995);
-moz-transition: all 0.3s cubic-bezier(0.915, 0.01, 0.075, 0.995);
-o-transition: all 0.3s cubic-bezier(0.915, 0.01, 0.075, 0.995);
transition: all 0.3s cubic-bezier(0.915, 0.01, 0.075, 0.995);
}
input.toggle + label:after.dark, .dark input.toggle + label:after {
background-color: rgba(180, 180, 180, 1);
}
input.toggle:checked + label:before {
background-color: rgba(74, 188, 144, 1);
opacity: 0.5;
}
input.toggle:checked + label:after {
background-color: rgba(74, 188, 144, 1);
margin-left: 3rem;
box-shadow: none;
}
input.checkbox, input.radio {
display: none;
}
input.checkbox + label, input.radio + label {
display: inline-block;
line-height: 1.7;
position: relative;
padding: calc(3.4rem - 3.4rem * 0.54) 0 0.5rem calc(3.4rem + 1rem);
min-height: 3.4rem;
}
input.checkbox + label:hover, input.radio + label:hover {
cursor: pointer;
}
input.checkbox + label:before, input.radio + label:before {
content: "";
height: 3.4rem;
width: 3.4rem;
position: absolute;
left: 0.2rem;
top: 0.7rem;
background-repeat: no-repeat;
}
input.radio[disabled] + label:before, input.checkbox[disabled] + label:before {
opacity: 0.5;
}
input.radio[disabled] + label, input.checkbox[disabled] + label {
color: rgba(0, 0, 0, 0.3);
}
input.checkbox:checked + label:before {
background: url(data:image/svg+xml;
base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bW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uNSwyMiwxMiwyMnoiLz4KPC9nPgo8Y2lyY2xlIGZpbGw9IiM0QUJCOEYiIGN4PSIxMiIgY3k9IjEyIiByPSI4Ii8+Cjwvc3ZnPg==);
}
input.radio + label:before {
background-image: url(data:image/svg+xml;
base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMjQgMjQiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGNpcmNsZSBvcGFjaXR5PSIwLjQ4IiBmaWxsPSIjQkJCREJGIiBjeD0iMTIiIGN5PSIxMiIgcj0iMTAiLz4KPC9zdmc+);
}
html {
font-size: 65.5%;
margin: 0;
padding: 0;
font-family: helvetica, arial;
color: #666;
}
html ul {
list-style: none;
padding: 0;
display: inline-block;
width: 30rem;
margin-right: 5rem;
}
html h3 {
text-transform: uppercase;
color: #888;
}
html p {
color: #666;
}
html .container {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
html .light, html .dark {
padding: 2rem;
overflow: hidden;
}
html .dark {
height: 10rem;
position: absolute;
bottom: 0;
width: 100%;
background-color: #282828;
}
html .light {
overflow-x: hidden;
overflow-y: auto;
position: absolute;
bottom: 14rem;
top: 0;
left: 0;
right: 0;
}
$(document).ready(function() {
if ($(window).width()< 600) {
console.log("hey, it worked on load")
$('.container').addClass('mobile');
}
else {$('.container').removeClass('mobile');}
});
$(window).resize(function() {
if ($(window).width() < 600) {
console.log("hey, it worked on resize")
$('.container').addClass('mobile');
}
else {$('.container').removeClass('mobile');}
});