Skip to content

Instantly share code, notes, and snippets.

@curricle
Created November 7, 2020 20:20
Show Gist options
  • Save curricle/f7fe40c2efb61a8dfcc47bdf6ae874d8 to your computer and use it in GitHub Desktop.
Save curricle/f7fe40c2efb61a8dfcc47bdf6ae874d8 to your computer and use it in GitHub Desktop.
FCC Survey (Forked)
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<body>
<article>
<header>
<h1 id="title">Design Professional Survey</h1>
<p id="description">Thank you for taking the time to fill out our design survey.</p>
</header>
<form id="survey-form">
<fieldset>
<legend>Are you currently a design professional?</legend>
<label for="yes" class="radio">
<input type="radio" id="yes" value="yes" name="radio-group">
Yes
</label>
<label for="no" class="radio">
<input type="radio" id="no" value="no" name="radio-group">
No
</label>
</fieldset>
<label for="dropdown" class="dropdown">How would you describe yourself?
<select name="dropdown" id="dropdown">
<option value="student">Student</option>
<option value="professional">Professional</option>
<option value="educator">Educator</option>
<option value="hobbyist">Hobbyist</option>
</select>
</label>
<label for="name" id="name-label">Name:
<input type="text" id="name" placeholder="Full Name" required>
</label>
<label for="email" id="email-label">Email:
<input type="email" id="email" placeholder="Email" required>
</label>
<label for="number" id="number-label">How many years of experience do you have?
<input type="number" id="number" min="0" max="50" placeholder="Ex: 2">
</label>
<fieldset id="topics">
<legend>Which topics are most relevant to you?</legend>
<div class="column">
<label for="check1" id="check1-label" class="checkbox">
<input type="checkbox" id="check1" value="ui-ux">
UI/UX
</label>
<label for="check2" id="check2-label" class="checkbox">
<input type="checkbox" id="check2" value="graphic">
Graphic Design
</label>
<label for="check3" id="check3-label" class="checkbox">
<input type="checkbox" id="check3" value="motion">Motion Design
</label>
</div>
<div class="column">
<label for="check4" id="check4-label" class="checkbox">
<input type="checkbox" id="check4" value="web">
Web Design
</label>
<label for="check5" id="check5-label" class="checkbox">
<input type="checkbox" id="check5" value="product">
Product Design
</label>
<label for="check6" id="check6-label" class="checkbox">
<input type="checkbox" id="check6" value="packaging-design">Packaging Design
</label>
</div>
</fieldset>
<label for="textarea" class="textarea">Further comments:
<textarea id="textarea" placeholder="Let us know!"></textarea>
</label>
<label for="submit">
<button type="submit" id="submit">Submit</button>
</label>
</form>
</article>
</body>
// !! IMPORTANT README:
// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place.
/***********
INSTRUCTIONS:
- Select the project you would
like to complete from the dropdown
menu.
- Click the "RUN TESTS" button to
run the tests against the blank
pen.
- Click the "TESTS" button to see
the individual test cases.
(should all be failing at first)
- Start coding! As you fulfill each
test case, you will see them go
from red to green.
- As you start to build out your
project, when tests are failing,
you should get helpful errors
along the way!
************/
// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!
// Once you have read the above messages, you can delete all comments.
:root {
--dark-grey: rgba(54, 54, 54, 1);
--grey-gradient: linear-gradient(186deg, rgba(54, 54, 54,1) 0%, rgba(73, 74, 73,1) 40%, rgba(235, 235, 235,1) 40.1%, rgba(235, 235, 235,1) 100%);
}
html, * {
font-family: 'Open Sans', sans-serif;
box-sizing: border-box;
}
body {
background: var(--grey-gradient);
}
header {
text-align: center;
padding: 30px;
color: white;
}
article {
width: 50%;
margin: 0 auto;
}
form {
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.3);
padding: 20px;
background: white;
}
fieldset {
display: flex;
flex-direction: row;
flex-wrap: wrap;
border: none;
}
label {
display: flex;
flex-direction: column;
margin: 10px;
}
.column {
width: 50%;
}
#topics {
justify-content: space-between;
padding: 5px;
}
.radio, .checkbox {
flex-direction: row;
align-items: center;
}
input, select, textarea {
padding: 5px;
}
select, textarea, input[type="text"], input[type="email"], input[type="number"] {
margin-top: 3px;
}
input[type="checkbox"], input[type="radio"] {
height: 25px;
margin-right: 10px;
}
button {
background: var(--dark-grey);
color: white;
border-radius: 5px;
border: none;
width: 100%;
margin: 0 auto;
padding: 10px;
font-weight: 700;
}
button:hover {
background: white;
color: var(--dark-grey);
border: var(--dark-grey) 1px solid;
cursor: pointer;
transition: background .5s;
}
@media (max-width: 640px) {
article {
width: 90%;
}
.column {
width: 100%;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment