Skip to content

Instantly share code, notes, and snippets.

@janzeteachesit
Created March 22, 2019 07:20
Show Gist options
  • Save janzeteachesit/37c8a0aef797bff8f5a1781b200e5eea to your computer and use it in GitHub Desktop.
Save janzeteachesit/37c8a0aef797bff8f5a1781b200e5eea to your computer and use it in GitHub Desktop.
Invader Zim Survey
<h1 id="title">Invader Zim Survey</h1>
<div id="form-outer">
<p id="description">
The Earth is mine to devastate... and I already promised the moon to GIR.
</p>
<form id="survey-form" method="GET" action="https://crossorigin.me/https://freecodecamp.com">
<!-- species -->
<div class="rowTab">
<div class="labels">
<label for="species">What are you?</label>
</div>
<div class="rightTab">
<select id="dropdown" name="species" class="dropdown">
<option disable selectedd value> Select an option</option>
<option value="irken">Irken</option>
<option value="human">Human</option>
<option value="alien">Nhar-Gh'ok</option>
<option value="alien">Vortian</option>
<option value="alien">Meekrob</option>
<option value="preferNo">Prefer not to say</option>
<option value="other">Other</option>
</select>
</div>
</div>
<!-- gateway -->
<div class="rowTab">
<div class="labels">
<label for="userRating">What was your gateway to Invader Zim?</label>
</div>
<div class="rightTab">
<ul style="list-style: none;">
<li class="radio"><label>the TV Series<input name="radio-buttons" value="1" type="radio" class="userRatings" ></label></li>
<li class="radio"><label>the Comic book series<input name="radio-buttons" value="2" type="radio" class="userRatings" ></label></li>
<li class="radio"><label>the TV Movie<input name="radio-buttons" value="3" type="radio" class="userRatings" ></label></li>
</ul>
</div>
</div>
<!-- most -->
<div class="rowTab">
<div class="labels">
<label for="most-like">Favorite? (There can be only one!)</label>
</div>
<div class="rightTab">
<select id="most-like" name="mostLike" class="dropdown">
<option disabled selected value>Select an option</option>
<option value="zim">Zim</option>
<option value="gir">Gir</option>
<option value="dib">Dib</option>
<option value="gaz">Gaz</option>
</select>
</div>
</div>
<!-- second -->
<div class="rowTab">
<div class="labels">
<label for="preferences">Almost favorite? (Check all that apply)</label>
</div>
<div class="rightTab">
<ul id="preferences" style="list-style: none;">
<li class="checkbox"><label><input name="prefer" value="1" type="checkbox" class="userRatings">Professor Membrane</label></li>
<li class="checkbox"><input name="prefer" value="2" type="checkbox" class="userRatings">Mrs. Bitters</li>
<li class="checkbox"><label><input name="prefer" value="3" type="checkbox" class="userRatings">The Almighty Tallest Red and Purple</label></li>
<li class="checkbox"><label><input name="prefer" value="4" type="checkbox" class="userRatings">Tak</label></li>
<li class="checkbox"><label><input name="prefer" value="5" type="checkbox" class="userRatings">Minimoose</label></li>
<li class="checkbox"><label><input name="prefer" value="6" type="checkbox" class="userRatings">Keef</label></li>
<li class="checkbox"><label><input name="prefer" value="7" type="checkbox" class="userRatings">Roboparents</label></li>
</ul>
</div>
</div>
<!-- name -->
<div class="rowTab">
<div class="labels">
<label id="name-label" for="name">How shall you be called? </label>
</div>
<div class="rightTab">
<input autofocus type="text" name="name" id="name" class="input-field" placeholder="Enter your preferred designation." required>
</div>
</div>
<!-- contact -->
<div class="rowTab">
<div class="labels">
<label id="email-label" for="email">How shall you be contacted?</label>
</div>
<div class="rightTab">
<input type="email" name="email" id="email" class="input-field" required placeholder="Enter your contact info, if necessary.">
</div>
</div>
<!-- years since decanting -->
<div class="rowTab">
<div class="labels">
<label id="number-label" for="age">Years since leaving the smeetery?</label>
</div>
<div class="rightTab">
<input type="number" name="age" id="number" min="1" max="125" class="input-field" placeholder="Enter your Earth, not Irken, years.">
</div>
</div>
<!-- comments -->
<div class="rowTab">
<div class="labels">
<label for="comments">Did we miss anything?</label>
</div>
<div class="rightTab">
<textarea id="comments" class="input-field" style="height:50px;resize:vertical;" name="comment" placeholder="Enter your comment here..."></textarea>
</div>
</div>
<button id="submit" type="submit">Submit</button>
</div>
/*
Responsive Web Design Projects - Build a Survey Form
Fulfill the below user stories and get all of the tests to pass. Give it your own personal style.
You can use HTML, JavaScript, and CSS to complete this project. Plain CSS is recommended because that is what the lessons have covered so far and you should get some practice with plain CSS. You can use Bootstrap or SASS if you choose. Additional technologies (just for example jQuery, React, Angular, or Vue) are not recommended for this project, and using them is at your own risk. Other projects will give you a chance to work with different technology stacks like React. We will accept and try to fix all issue reports that use the suggested technology stack for this project. Happy coding!
User Story #1: I can see a title with id="title" in H1 sized text.
User Story #2: I can see a short explanation with id="description" in P sized text.
User Story #3: I can see a form with id="survey-form".
User Story #4: Inside the form element, I am required to enter my name in a field with id="name".
User Story #5: Inside the form element, I am required to enter an email in a field with id="email".
User Story #6: If I enter an email that is not formatted correctly, I will see an HTML5 validation error.
User Story #7: Inside the form, I can enter a number in a field with id="number".
User Story #8: If I enter non-numbers in the number input, I will see an HTML5 validation error.
User Story #9: If I enter numbers outside the range of the number input, which are defined by the min and max attributes, I will see an HTML5 validation error.
User Story #10: For the name, email, and number input fields inside the form I can see corresponding labels that describe the purpose of each field with the following ids: id="name-label", id="email-label", and id="number-label".
User Story #11: For the name, email, and number input fields, I can see placeholder text that gives me a description or instructions for each field.
User Story #12: Inside the form element, I can select an option from a dropdown that has a corresponding id="dropdown".
User Story #13: Inside the form element, I can select a field from one or more groups of radio buttons. Each group should be grouped using the name attribute.
User Story #14: Inside the form element, I can select several fields from a series of checkboxes, each of which must have a value attribute.
User Story #15: Inside the form element, I am presented with a textarea at the end for additional comments.
User Story #16: Inside the form element, I am presented with a button with id="submit" to submit all my inputs.
*/
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
@import url(https://fonts.googleapis.com/css?family=Raleway:400,500);
html,body {
background-color: #000000;
text-align: center;
font-family: 'Raleway', Helvetica, sans-serif;
min-width: 320px;
color: #5f8716;
text-shadow: 1.5px 1.5px 2.5px #000;
font-weight: bold;
}
header {
font-size: 2em;
font-weight: bold;
margin: 20px;
text-shadow: 1.5px 1.5px 2.5px #fff;
}
#form-outer {
background-color: #9060d8;
margin: 0 auto;
border-radius: 4px;
width: 75%;
max-width: 900px;
padding: 10px;
padding-top: 20px;
}
.labels {
display: inline-block;
text-align: right;
width: 40%;
padding: 5px;
vertical-align: top;
margin-top: 10px;
}
.rightTab {
display: inline-block;
text-align: left;
width: 48%;
vertical-align: middle;
}
.input-field {
height: 20px;
width: 280px;
padding: 5px;
margin: 10px;
border: 1px solid #c0c0c0;
border-radius: 2px;
background-color: #000000;
}
::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
color: #9000f0;
opacity: 1; /* Firefox */
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: #9000f0;
}
::-ms-input-placeholder { /* Microsoft Edge */
color: #9000f0;
}
#userAge {
width: 40px;
}
.userRatings,
input[type="checkbox"] {
float: left;
margin-right: 5px;
}
#submit {
background-color: #59ace0;
border-radius: 4px;
color: white;
font-size: 1em;
height: 40px;
width: 96px;
margin: 10px;
border: 0px solid;
}
.dropdown {
height: 35px;
width: 140px;
padding: 5px;
margin: 10px;
margin-top: 15px;
border: 1px solid #c0c0c0;
border-radius: 2px;
background-color: #000000;
color: #9000f0;
}
.radio, .checkbox {
position: relative;
left: -43px;
margin-left: 10px;
display: block;
padding-bottom: 10px;
}
@media screen and (max-width: 833px) {
.input-field {
width: 80%;
}
select {
width: 90%;
}
}
@media screen and (max-width: 520px) {
.labels {
width: 100%;
text-align: left;
}
.rightTab {
width: 80%;
float: left;
}
.input-field {
width: 100%;
}
select {
width: 100%;
}
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment