Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 4aficiona2/d5082ee45b855178ea87 to your computer and use it in GitHub Desktop.
Save 4aficiona2/d5082ee45b855178ea87 to your computer and use it in GitHub Desktop.
Checkboxes select showcase for INFRAS
<div id="phone">
<div id="screen">
<div id="header">
<div class="pullmenu-icon"></div>
</div>
<div class="pages">
<div class="page back2" id="about">
<div>
<span>former Pullmenu</span><br/>Menu interaction concept<br/>by @_fbrz but now used as demo boilerplate for checkbox example
</div>
</div>
<form class="page" id="options">
<div class="box small back11">
<label for="PulpFiction">
Pulp Fiction
<input type="checkbox" name="film" value="PulpFiction" id="PulpFiction">
</label>
</div>
<div class="box small back2">
<label for="CitizenKane">
Citizen Kane
<input type="checkbox" name="film" value="CitizenKane" id="CitizenKane">
</label>
</div>
<div class="box small back9">
<label for="TheGodfather">
The Godfather
<input type="checkbox" name="film" value="TheGodfather" id="TheGodfather">
</label>
</div>
<div class="box small back6">
<label for="ModernTimes">
Modern Times
<input type="checkbox" name="film" value="ModernTimes" id="ModernTimes">
</label>
</div>
<div class="box small back10">
<label for="KingKong">
King Kong
<input type="checkbox" name="film" value="KingKong" id="KingKong">
</label>
</div>
<div class="box small back12 button">
<label for="selectAll">
Select All
<input type="checkbox" name="film" value="All" id="selectAll">
</label>
</div>
</form>
</div>
</div>
<div id="home"></div>
<div id="speaker"></div>
</div>
$(document).ready(function(){
$('#selectAll').click( function () {
$('input[type="checkbox"]').prop('checked', this.checked)
})
/* Select / disselect all options */
$('.SelectAllYearRefs').click( function () {
$('.YearRef input[type="checkbox"]').prop('checked', this.checked)
})
/*ie9 & above*/
/* // Selects all YearRefs checkboxes
$('.SelectAllYearRefs').click(function (){
$('.YearRef input[type=checkbox]:not(:checked):not(.SelectAllYearRefs)')
.click();
});*/
});
@import url(http://fonts.googleapis.com/css?family=Lato);
body {
font-family: Lato;
-webkit-font-smoothing: antialiased;
margin: 0;
background: #f5f5f5;
}
/* phone */
#phone {
width: 310px;
height: 640px;
border: 2px solid #ccc;
border-radius: 30px;
position: absolute;
left: 50%;
top: 50px;
margin: 0 -285px;
background: #fff;
}
#screen {
width: 290px;
height: 520px;
border: 1px solid #ccc;
position: absolute;
left: 50%;
top: 50%;
margin: -260px -145px;
box-sizing: border-box;
overflow: hidden;
}
#home {
width: 36px;
height: 36px;
border: 1px solid #ccc;
position: absolute;
bottom: 10px;
left: 50%;
margin: 0 -18px;
border-radius: 50%;
}
#speaker {
width: 50px;
height: 6px;
border: 1px solid #ccc;
border-radius: 6px;
position: absolute;
left: 50%;
top: 25px;
margin: 0 -25px;
}
#header {
height: 46px;
background: #353541;
position: relative;
z-index: 30;
cursor: grab;
&:active {
cursor: grabbing;
}
}
.pullmenu-icon {
width: 16px;
height: 2px;
background: #FFF;
position: absolute;
right: 20px;
bottom: 27px;
transition: opacity .2s ease-in-out;
&:after {
content: '';
width: 8px;
height: 2px;
background: #FFF;
position: absolute;
top: 10px;
left: 4px;
}
&:before {
content: '';
width: 16px;
height: 2px;
background: #FFF;
position: absolute;
top: 5px;
left: 0;
}
}
#title {
height: 46px;
}
#menu {
list-style: none;
margin: 0;
padding: 0;
width: 3000px;
position: absolute;
top: 50%;
margin: -15px 0px;
transition: transform .2s ease-out;
}
.pages {
transform: translate3d(0,0,0);
transition: opacity .2s linear;
z-index: 29;
position: absolute;
width: 318px;
height: 100%;
}
.page {
overflow-y: auto;
overflow-x: hidden;
height: 472px;
display: none;
padding-right: 15px;
position: relative;
}
#options {
display: block;
}
.back1 { background: -webkit-linear-gradient(-50deg, rgb(174, 147, 187), rgb(166, 61, 113)); }
.back2 { background: -webkit-linear-gradient(-50deg, rgb(151, 199, 148), rgb(18, 101, 108)); }
.back3 { background: -webkit-linear-gradient(-50deg, rgb(128, 143, 182), rgb(55, 63, 82)); }
.back4 { background: -webkit-linear-gradient(-50deg, rgb(202, 162, 133), rgb(192, 191, 60)); }
.back5 { background: -webkit-linear-gradient(-50deg, rgb(147, 176, 187), rgb(61, 122, 166)); }
.back6 { background: -webkit-linear-gradient(-50deg, rgb(187, 167, 147), rgb(166, 93, 61)); }
.back7 { background: -webkit-linear-gradient(-50deg, rgb(157, 147, 187), rgb(102, 89, 161)); }
.back8 { background: -webkit-linear-gradient(-50deg, rgb(175, 171, 178), rgb(105, 95, 100)); }
.back9 { background: -webkit-linear-gradient(-50deg, rgb(165, 137, 176), rgb(211, 92, 92)); }
.back10 { background: -webkit-linear-gradient(-50deg, rgb(147, 187, 149), rgb(90, 119, 78)); }
.back11 { background: -webkit-linear-gradient(-50deg, rgb(189, 229, 208), rgb(18, 60, 108)); }
.back12 { background: -webkit-linear-gradient(-50deg, rgb(11, 11, 11), rgb(0, 0, 0)); }
.box {
height: 116px;
position: relative;
width: 50%;
float: left;
&.small {
width: 100%;
height: 70px;
}
button,
label,
span {
position: absolute;
color: #fff;
font-size: 15px;
bottom: 0;
left: 0;
text-transform: uppercase;
padding: 25px 25px;
font-weight: 600;
}
}
.button {
position: absolute;
bottom: 0;
cursor: pointer;
}
#pullmenu-icon {
width: 40px;
height: 5px;
background: #353541;
margin-top: 69px;
position: relative;
margin-bottom: 40px;
left: 6px;
&:before {
width: 40px;
height: 5px;
background: #353541;
content: '';
position: absolute;
top: 10px;
}
&:after {
width: 22px;
height: 5px;
background: #353541;
content: '';
position: absolute;
top: 20px;
left: 9px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment