<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="card card-container">
<div class="row">
<div class="col-xs-12 col-sm-12">
<form role="form">
<h2>Cadastro </h2>
<hr class="colorgraph">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<div class="form-group">
<input type="text" name="first_name" id="first_name" class="form-control input-lg" placeholder="nome completo" tabindex="1">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12">
<h4>Você é:</h4>
</div>
</div>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary active">
<input type="radio" name="options" id="estudante" autocomplete="off" checked> Estudante
</label>
<label class="btn btn-primary">
<input type="radio" name="options" id="professor" autocomplete="off"> Professor
</label>
</div>
<br></br>
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6" id="divemail">
<div class="form-group">
<input type="text" name="email" id="email" class="form-control input-lg" placeholder="e-mail" tabindex="3">
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-6" id="esconder">
<div class="form-group">
<input type="email" name="matricula" id="ifYes" class="form-control input-lg" placeholder="matricula" tabindex="4">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="form-group">
<input type="password" name="password" id="password" class="form-control input-lg" placeholder="senha" tabindex="5">
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="form-group">
<input type="password" name="password_confirmation" id="password_confirmation" class="form-control input-lg" placeholder="confirmar senha" tabindex="6">
</div>
</div>
</div>
<hr class="colorgraph">
<div class="row">
<div class="col-xs-12 col-md-12"><button type="submit" value="enviar" class="btn btn-lg btn-primary btn-block btn-signin" tabindex="7">enviar </button></div>
</div>
</form>
</div>
</div>
</div>
</div>
/* Credit to bootsnipp.com for the css for the color graph */
body, html {
height: 100%;
background-repeat: no-repeat;
background-image: linear-gradient(rgb(202, 223, 231),rgb(222,243,251));
}
.card-container.card {
width: 70%;
padding: 40px 40px;
}
.card {
background-color: #FFFFFF;
/* just in case there no content*/
padding: 20px 25px 30px;
margin: 0 auto 25px;
margin-top: 50px;
/* shadows and rounded borders */
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
-moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
}
.colorgraph {
height: 5px;
border-top: 0;
background: #5C6674;
border-radius: 5px;
}
#
.btn.btn-signin {
/*background-color: #4d90fe; */
background-color: rgb(104, 145, 162);
/* background-color: linear-gradient(rgb(104, 145, 162), rgb(12, 97, 33));*/
padding: 0px;
font-weight: 700;
font-size: 14px;
height: 36px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
border: none;
-o-transition: all 0.218s;
-moz-transition: all 0.218s;
-webkit-transition: all 0.218s;
transition: all 0.218s;
}
.btn.btn-signin:hover,
.btn.btn-signin:active,
.btn.btn-signin:focus {
background-color: rgb(12, 97, 33);
}
$(function () {
$('input[type=radio]').change( function() {
if (document.getElementById('estudante').checked) {
document.getElementById('divemail').className = "col-xs-6 col-sm-6 col-md-6";
document.getElementById('esconder').style.display="block";
$( "#ifYes" ).fadeIn( "fast");
}
else {
$( "#ifYes" ).fadeOut( "fast", function() {
document.getElementById('esconder').style.display="none";
document.getElementById('divemail').className = "col-xs-12 col-sm-12 col-md-12";
});
}
});
$('.button-checkbox').each(function () {
// Settings
var $widget = $(this),
$button = $widget.find('button'),
$checkbox = $widget.find('input:checkbox'),
color = $button.data('color'),
settings = {
on: {
icon: 'glyphicon glyphicon-check'
},
off: {
icon: 'glyphicon glyphicon-unchecked'
}
};
// Event Handlers
$button.on('click', function () {
$checkbox.prop('checked', !$checkbox.is(':checked'));
$checkbox.triggerHandler('change');
updateDisplay();
});
$checkbox.on('change', function () {
updateDisplay();
});
// Actions
function updateDisplay() {
var isChecked = $checkbox.is(':checked');
// Set the button's state
$button.data('state', (isChecked) ? "on" : "off");
// Set the button's icon
$button.find('.state-icon')
.removeClass()
.addClass('state-icon ' + settings[$button.data('state')].icon);
// Update the button's color
if (isChecked) {
$button
.removeClass('btn-default')
.addClass('btn-' + color + ' active');
}
else {
$button
.removeClass('btn-' + color + ' active')
.addClass('btn-default');
}
}
// Initialization
function init() {
updateDisplay();
// Inject the icon if applicable
if ($button.find('.state-icon').length == 0) {
$button.prepend('<i class="state-icon ' + settings[$button.data('state')].icon + '"></i>');
}
}
init();
});
});