JSFiddle - React, Tailwind, and code Playground
by bjenkins22
HTML
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="container-fluid content-container">
<div class="row">
<div class="well col-md-10 col-md-offset-1 col-xs-10 col-xs-offset-1">
<form id="thisform">
<div class="form-group">
<label>Select a security question</label>
<select class="form-control" id="question_select" onchange="fuckyou()">
<option>What is your password?</option>
<option>Could a Redditor make this?</option>
</select>
</div>
<div class="form-group">
<label>Answer</label>
<input id="answer" type="text" class="form-control" placeholder="Answer">
</div>
<button id="submit_button" class="btn btn-primary" type="submit">
Submit
</button>
<div id="fuckyou">
<h1>
Fuck You
</h1>
</div>
</form>
</div>
</div>
</div>
CSS
@import url('https://fonts.googleapis.com/css?family=Great+Vibes');
.content-container{
margin-top: 30px;
}
@keyframes colorchange{
0% {color: red;}
20% {color: orange;}
40% {color: yellow;}
60% {color: green;}
80% {color: blue;}
100% {color: purple;}
}
#fuckyou{
display: none;
animation-name: colorchange;
animation-duration: 3s;
animation-iteration-count: infinite;
text-shadow: 0 0 10px #FF0000;
}
h1{
text-align: center;
font-size: 70px;
font-family: 'Great Vibes', cursive;
}
JavaScript
$('#question_select').change(function(){
if($('#question_select').find(":selected").text() == 'Could a Redditor make this?'){
$('#answer').css('display', 'none');
$('#submit_button').css('display', 'none');
$('#fuckyou').css('display', 'inherit');
}
else{
$('#answer').css('display', 'inherit');
$('#submit_button').css('display', 'inherit');
$('#fuckyou').css('display', 'none');
}
});