just a bump

This commit is contained in:
ajuvercr 2020-09-05 18:01:24 +02:00 committed by ajuvercr
parent 422919ed9c
commit 3c5bd9767a
3 changed files with 192 additions and 150 deletions

View file

@ -4,7 +4,7 @@ type: meerkeuze
antwoorden: antwoorden:
- tekst: Studenten die uit dezelfde streek afkomstig zijn - tekst: Studenten die uit dezelfde streek afkomstig zijn
vraag: Uit welke streek ben jij afkomstig? vraag: Uit welke streek ben jij afkomstig?
type: dropdown type: specialCase1
antwoorden: antwoorden:
- tekst: TODO - tekst: TODO
verenigingen: verenigingen:
@ -41,7 +41,7 @@ antwoorden:
- tekst: Japan - tekst: Japan
verenigingen: verenigingen:
- naam: tnok - naam: tnok
- tekst: Vietnam - tekst: Vietnam
verenigingen: verenigingen:
@ -49,5 +49,4 @@ antwoorden:
- tekst: Sub-Sahara Afrika - tekst: Sub-Sahara Afrika
verenigingen: verenigingen:
--- ---

View file

@ -1,227 +1,240 @@
:root { :root {
--white: hsl(0, 0%, 98%); --white: hsl(0, 0%, 98%);
--darkblue: #013e7a; --darkblue: #013e7a;
--lightblue: #1a77d3; --lightblue: #1a77d3;
--cyan: hsl(192, 100%, 83%); --cyan: hsl(192, 100%, 83%);
--lightCyan: hsl(192, 100%, 94%); --lightCyan: hsl(192, 100%, 94%);
--yellow: #fed318; --yellow: #fed318;
} }
html, body { html,
padding: 0; body {
margin: 0; padding: 0;
margin: 0;
} }
html { html {
background: var(--white); background: var(--white);
height: 100%; height: 100%;
} }
body { body {
height: 100%; height: 100%;
font-family: futura, Avenir Next, Verdana, Geneva, Tahoma, sans-serif; font-family: futura, Avenir Next, Verdana, Geneva, Tahoma, sans-serif;
} }
.align { .align {
margin: 0 auto; margin: 0 auto;
max-width: 1280px; max-width: 1280px;
padding: 0 1em; padding: 0 1em;
} }
.beforeTheFold, main { .beforeTheFold,
position: relative; main {
min-height: 100%; position: relative;
min-height: 100%;
} }
button, input { button,
font-size: inherit; input {
font-family: inherit; font-size: inherit;
color: inherit; font-family: inherit;
background-color: transparent; color: inherit;
background-color: transparent;
} }
button { button {
border: 0.15em solid var(--darkblue); border: 0.15em solid var(--darkblue);
} }
input { input {
border: none; border: none;
border-bottom: 0.15em solid var(--darkblue); border-bottom: 0.15em solid var(--darkblue);
padding: 0.1em 0.3em; padding: 0.1em 0.3em;
} }
header { header {
position: relative; position: relative;
background-color: var(--lightCyan); background-color: var(--lightCyan);
} }
header.homepage { header.homepage {
background-color: transparent; background-color: transparent;
} }
nav a { nav a {
text-decoration: none; text-decoration: none;
font-family: futura, Avenir Next, Verdana, Geneva, Tahoma, sans-serif; font-family: futura, Avenir Next, Verdana, Geneva, Tahoma, sans-serif;
color: var(--darkblue); color: var(--darkblue);
padding: 1rem 2rem; padding: 1rem 2rem;
margin: 0 1rem; margin: 0 1rem;
} }
nav ul { nav ul {
list-style: none; list-style: none;
justify-content: space-between; justify-content: space-between;
} }
nav li { nav li {
display: inline-block; display: inline-block;
} }
nav { nav {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 1rem 0; padding: 1rem 0;
} }
header .logo { header .logo {
width: 79px; width: 79px;
height: 83px; height: 83px;
} }
h2 { h2 {
font-family: futura, Avenir Next, Verdana, Geneva, Tahoma, sans-serif; font-family: futura, Avenir Next, Verdana, Geneva, Tahoma, sans-serif;
font-size: 3.4rem; font-size: 3.4rem;
color: var(--darkblue); color: var(--darkblue);
} }
.beforeTheFold h2 { .beforeTheFold h2 {
max-width: 30rem; max-width: 30rem;
} }
.intro { .intro {
position: relative; position: relative;
} }
.studentZijn { .studentZijn {
margin: 4rem 0 2rem 3rem; margin: 4rem 0 2rem 3rem;
margin: 11vh 0 2rem 3rem; margin: 11vh 0 2rem 3rem;
} }
.hidden { .hidden {
display: none; display: none;
} }
.quote { .quote {
margin-top: 3rem; margin-top: 3rem;
display: flex; display: flex;
position: relative; position: relative;
z-index: 2; z-index: 2;
} }
.quote img { .quote img {
width: 103px; width: 103px;
height: 185px; height: 185px;
margin-right: 2rem; margin-right: 2rem;
} }
.quote p { .quote p {
max-width: 25rem; max-width: 25rem;
font-size: 1.5rem; font-size: 1.5rem;
font-family: Avenir Next, Verdana, Geneva, Tahoma, sans-serif; font-family: Avenir Next, Verdana, Geneva, Tahoma, sans-serif;
font-style: italic; font-style: italic;
font-weight: 500; font-weight: 500;
margin: 0.5em 0; margin: 0.5em 0;
} }
.quizSpotlight { .quizSpotlight {
margin-top: 2rem; margin-top: 2rem;
font-size: 2rem; font-size: 2rem;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
font-weight: bold; font-weight: bold;
} }
.quizSpotlight a { .quizSpotlight a {
position: relative; position: relative;
text-decoration: none; text-decoration: none;
background: var(--white); background: var(--white);
color: var(--darkblue); color: var(--darkblue);
border: 0.4rem solid var(--darkblue); border: 0.4rem solid var(--darkblue);
padding: 1rem 2rem; padding: 1rem 2rem;
margin-right: 3rem; margin-right: 3rem;
} }
.quizSpotlight a:hover { .quizSpotlight a:hover {
background-color: var(--lightblue); background-color: var(--lightblue);
border: 0.4rem solid var(--lightblue); border: 0.4rem solid var(--lightblue);
color: var(--white); color: var(--white);
} }
.scroll { .scroll {
display: block; display: block;
position: absolute; position: absolute;
bottom: 0.5rem; bottom: 0.5rem;
left: 0; left: 0;
right: 0; right: 0;
text-align: center; text-align: center;
z-index: 1; z-index: 1;
} }
.scroll a { .scroll a {
display: inline-block; display: inline-block;
color: var(--darkblue); color: var(--darkblue);
font-size: 1.1rem; font-size: 1.1rem;
text-decoration: none; text-decoration: none;
padding: 0.7rem 1.1rem; padding: 0.7rem 1.1rem;
font-weight: 500; font-weight: 500;
text-shadow: text-shadow: 0 0 1em hsla(0, 0%, 100%, 1), 0 0 1em hsla(0, 0%, 100%, 1),
0 0 1em hsla(0, 0%, 100%, 1), 0 0 0.1em hsla(0, 0%, 100%, 1);
0 0 1em hsla(0, 0%, 100%, 1),
0 0 0.1em hsla(0, 0%, 100%, 1);
} }
.shade { .shade {
z-index: -1; z-index: -1;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
height: 7rem; height: 7rem;
background: linear-gradient( background: linear-gradient(hsla(0, 0%, 100%, 0), hsla(0, 0%, 100%, 0.6));
hsla(0, 0%, 100%, 0),
hsla(0, 0%, 100%, 0.6)
);
} }
.backgroundSquare { .backgroundSquare {
z-index: -2; z-index: -2;
position: absolute; position: absolute;
background-color: var(--lightCyan); background-color: var(--lightCyan);
} }
.header_blueSquare { .header_blueSquare {
right: 20%; right: 20%;
left: -1000px; left: -1000px;
left: -100vw; left: -100vw;
top: -1000px; top: -1000px;
top: -100vw; top: -100vw;
bottom: -1rem; bottom: -1rem;
z-index: -3; z-index: -3;
} }
.header_photo { .header_photo {
background: url(/assets/placeholder.jpg) center center; background: url(/assets/placeholder.jpg) center center;
background-size: cover; background-size: cover;
right: 0; right: 0;
left: 50%; left: 50%;
bottom: 0; bottom: 0;
top: 20%; top: 20%;
} }
.randomVerenigingen p:nth-child(odd) { .randomVerenigingen p:nth-child(odd) {
-webkit-text-stroke-width: 2px; -webkit-text-stroke-width: 2px;
-webkit-text-stroke-color: var(--lightblue); -webkit-text-stroke-color: var(--lightblue);
color: transparent; color: transparent;
} }
.randomVerenigingen p { .randomVerenigingen p {
text-transform: uppercase; text-transform: uppercase;
} }
.underline, .active_link { .underline,
box-shadow: inset 0 -0.15em 0 var(--yellow); .active_link {
box-shadow: inset 0 -0.15em 0 var(--yellow);
}
#postcodeField {
-webkit-appearance: none;
margin: 0;
}
#postcodeField::-webkit-outer-spin-button,
#postcodeField::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
#postcodeField[type="number"] {
-moz-appearance: textfield;
} }

View file

@ -1,13 +1,21 @@
<h2> <%= question[:vraag] %> </h2> <h2> <%= question[:vraag] %> </h2>
<select <% if question[:type] == "meerkeuze" %> multiple="multiple" <% end %> <% if question[:type] == "specialCase1" %>
<p>
Geef je postcode in
</p>
<input id="postcodeField" type=number value="9000">
</input>
<%else%>
<select <% if question[:type] == "meerkeuze" %> multiple="multiple" <% end %>
id="<%= (question[:tekst] || "") + (question[:vraag] || "") %>_option"> id="<%= (question[:tekst] || "") + (question[:vraag] || "") %>_option">
<option value="" selected="selected disabled hidden">Maak uw keuze</option> <option value="" selected="selected disabled hidden">Maak uw keuze</option>
<% for answer in question[:antwoorden]%> <% for answer in question[:antwoorden]%>
<option value='<%= answer[:tekst] + (answer[:vraag] || "") %>'> <option value='<%= answer[:tekst] + (answer[:vraag] || "") %>'>
<%= answer[:tekst] %> <%= answer[:tekst] %>
</option> </option>
<% end %> <% end %>
</select> </select>
<% end %>
<% for answer in question[:antwoorden]%> <% for answer in question[:antwoorden]%>
<% if answer[:vraag] %> <% if answer[:vraag] %>
<div id='<%= html_escape(answer[:tekst] + answer[:vraag]) %>' style="display:none;"> <div id='<%= html_escape(answer[:tekst] + answer[:vraag]) %>' style="display:none;">
@ -17,6 +25,28 @@
<% end %> <% end %>
<script> <script>
{ {
(function setupPostCodeField() {
const postCodes = (function genPostCodes() {
console.log("Running postcodes");
const postCodes = {};
<% verenigingen().each do |ver| %>
console.log("<%=ver[:naam]%>");
<% if ver[:postcodes] %>
<% for postcode in ver[:postcodes] %>
console.log("<%=postcode%>");
<% end %>
<% end %>
<% end %>
})();
console.log("Running");
// const postField =
})();
// Reference back to the last selected option // Reference back to the last selected option
// This way we can 'deselect' the question results // This way we can 'deselect' the question results
let last_answered = []; let last_answered = [];