From 983ca5732df4dda4a14c6af2fc6b3eda7a4d0647 Mon Sep 17 00:00:00 2001 From: "georgia.shaw" Date: Wed, 18 Sep 2019 12:47:52 +0100 Subject: [PATCH 1/5] organise css files and add classes --- public/css/formStyle.css | 78 ++++++++++---------- public/css/homeStyle.css | 130 ++++++++++++++-------------------- public/js/userForm.js | 10 +-- src/views/HIW.hbs | 25 +++---- src/views/form.hbs | 98 ++++++++++++------------- src/views/home.hbs | 13 ++-- src/views/partials/header.hbs | 12 ++-- 7 files changed, 174 insertions(+), 192 deletions(-) diff --git a/public/css/formStyle.css b/public/css/formStyle.css index ac96765..9cee519 100644 --- a/public/css/formStyle.css +++ b/public/css/formStyle.css @@ -1,4 +1,4 @@ -/* ---------------------------------------------INPUT & BUTTONS ---------------------------------------------*/ +/* ---------------------------------FORM ------------------------------------*/ .user-form { display: flex; flex-direction: column; @@ -12,30 +12,46 @@ width: 100vw; } -input { - padding: 10px; - width: 100%; - font-size: 17px; +/*---------------------------- INPUT BOXES ------------------------------*/ +.user-input-outer-wrap { + /*this is what hides each part of the form - don't remove!*/ + display: none; +} + +.user-input { + border-radius: 3rem; + box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); + border: 2px solid #ebfffb; + background: #ffffff; + font-family: "Roboto", sans-serif; + margin: 0 0 1.5rem 0; + max-width: 20rem; + font-size: 1.1rem; + padding: 0.7rem; text-align: center; + /*this keeps the text that user enters centered*/ } -input.invalid { +.user-input.invalid { background-color: #ffdddd; } -.user-input { - display: none; +.user-input-title { + font-family: "Righteous", cursive; } -.button-wrap { - display: flex; - flex-direction: row; - justify-content: center; - width: 100vw; +.user-input::placeholder { + text-align: center; + font-family: "Roboto", sans-serif; + color: #a2a1a1; } -/* ---------------------------------------------STEPS ---------------------------------------------*/ +.time-and-date-wrap { + display: flex; + flex-direction: column; +} +/* --------------------------STEPS/PAGINATION DOTS ---------------------------*/ .step-wrap { display: flex; flex-direction: row; @@ -45,30 +61,30 @@ input.invalid { height: 15px; width: 15px; margin: 0 2px; - background-color: #bbbbbb; + background-color: #97a3cc; border: none; border-radius: 50%; display: inline-block; - opacity: 0.5; - box-shadow: inset 0 0 10px #3232ff; + /* opacity: 0.5; */ + box-shadow: inset 0 0 5px #6375b3; } .step.active { opacity: 1; - background-color: #637bd0; + background-color: #3b487a; } .step.finish { - background-color: #4a5b99; + background-color: #4f62a6; } -/* ---------------------------------------------RADIO BUTTONS ---------------------------------------------*/ - +/* -----------------------------RADIO BUTTONS -------------------------------*/ .radio-toolbar { display: flex; flex-direction: column; justify-content: center; } + .radio-toolbar input[type="radio"] { opacity: 0; position: fixed; @@ -77,17 +93,9 @@ input.invalid { .radio-toolbar label { display: inline-block; - background-color: #ddd; - /* padding: 10px 20px; */ - margin: 5px 0; - font-family: "Montserrat", sans-serif; - /* font-size: 16px; */ - /* border: 2px solid #444; */ + margin: 0.8rem 0; border-radius: 3rem; - padding: 10px; - width: 100%; - font-size: 17px; - text-align: center; + padding: 0.8rem; box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); border: 2px solid #ebfffb; background: #ffffff; @@ -97,11 +105,3 @@ input.invalid { background-color: #637bd0; border-color: #637bd0; } - -.radio-toolbar input[type="radio"]:focus + label { - /* border: 2px dashed #444; */ -} - -.radio-toolbar input[type="radio"]:hover + label { - /* border: 2px dashed #aaaaaa; */ -} diff --git a/public/css/homeStyle.css b/public/css/homeStyle.css index 43ad0b7..384778d 100644 --- a/public/css/homeStyle.css +++ b/public/css/homeStyle.css @@ -1,14 +1,13 @@ +/*--------------------------------GENERAL-------------------------------------*/ + html { box-sizing: border-box; } body { background: #ebfffb; -} - -header { - display: flex; - flex-direction: row; + text-align: center; + font-family: "Montserrat", sans-serif; } *, @@ -17,62 +16,52 @@ header { box-sizing: inherit; } -.logo { - width: 50px; - height: 50px; -} - -/* ---------------------------------------------- FONTS -----------------------------------------------------------*/ - -h1, -h3, -p { - font-family: "Montserrat", sans-serif; - text-align: center; +a { + text-decoration: none; } -h2 { - text-align: center; - font-family: "Righteous", cursive; +a:visited { + color: black; } -/* ---------------------------------------------- BUTTONS -----------------------------------------------------------*/ -button { - background-color: #db3306; - color: #ffffff; - border: none; - padding: 15px 20px; - font-size: 17px; - font-family: "Montserrat", sans-serif; - cursor: pointer; - border-radius: 3rem; - box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); - margin: 0.5rem 0.5rem 2rem 0.5rem; -} +/*----------------------------------HEADER------------------------------------*/ -button:hover { - opacity: 0.8; +header { + display: flex; + flex-direction: row; } -/* ---------------------------------------------- ALERT BOX -----------------------------------------------------------*/ - -.box { - /* width: 40%; */ +.header-button-wrap { margin: 0 auto; background: rgba(255, 255, 255, 0.2); border: 2px solid #fff; border-radius: 20px/50px; background-clip: padding-box; - text-align: center; - font-family: "Montserrat", sans-serif; align-self: center; } -.box:visited { +.header-button-wrap:visited { text-decoration: none; } -.overlay { +.header-button-link-wrap { + display: flex; + flex-wrap: wrap; +} + +.logo { + width: 50px; + height: 50px; +} + +.question-mark { + width: 35px; + height: 40px; +} + +/* ------------------------------ ALERT BOX ----------------------------------*/ + +.popup-home-overlay { position: fixed; top: 0; bottom: 0; @@ -83,7 +72,8 @@ button:hover { visibility: hidden; opacity: 0; } -.overlay:target { + +.popup-home-overlay:target { visibility: visible; opacity: 1; } @@ -103,6 +93,7 @@ button:hover { color: #333; font-family: Tahoma, Arial, sans-serif; } + .popup .close { position: absolute; top: 20px; @@ -113,9 +104,11 @@ button:hover { text-decoration: none; color: #333; } + .popup .close:hover { color: #06d85f; } + .popup .content { max-height: 30%; overflow: auto; @@ -127,42 +120,27 @@ button:hover { justify-content: space-around; } -input { +/* ------------------------------ BUTTONS ------------------------------------*/ + +.standard-button { + background-color: #db3306; + color: #ffffff; + border: none; + padding: 1rem 1.3rem; + font-size: 1.05rem; + cursor: pointer; border-radius: 3rem; box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); - border: 2px solid #ebfffb; - background: #ffffff; - font-family: "Roboto", sans-serif; - /* padding-left: 1.5rem; */ - margin: 0 0 1.5rem 0; - max-width: 20rem; -} - -a { - text-decoration: none; -} - -a:visited { - color: black; - font-family: "Montserrat", sans-serif; -} - -input::placeholder { - text-align: center; - font-family: "Roboto", sans-serif; - color: #a2a1a1; + margin: 0.5rem 0.5rem 2rem 0.5rem; } -.question-mark { - width: 35px; - height: 40px; +.standard-button:hover { + opacity: 0.8; } -@media screen and (max-width: 700px) { - .box { - /* width: 70%; */ - } - .popup { - width: 70%; - } +.button-wrap { + display: flex; + flex-direction: row; + justify-content: center; + /* width: 100vw; */ } diff --git a/public/js/userForm.js b/public/js/userForm.js index b4faa10..f9f834e 100644 --- a/public/js/userForm.js +++ b/public/js/userForm.js @@ -16,7 +16,7 @@ const updateName = () => { }; const showTab = n => { - const labelArray = document.querySelectorAll(".user-input"); + const labelArray = document.querySelectorAll(".user-input-outer-wrap"); labelArray[n].style.display = "block"; if (n === 0) { @@ -41,14 +41,14 @@ showTab(currentTab); const prevInput = e => { e.preventDefault(); - const labelArray = document.querySelectorAll(".user-input"); + const labelArray = document.querySelectorAll(".user-input-outer-wrap"); labelArray[currentTab].style.display = "none"; currentTab = currentTab - 1; showTab(currentTab); }; const validateEmpty = () => { - const labelArray = document.querySelectorAll(".user-input"); + const labelArray = document.querySelectorAll(".user-input-outer-wrap"); let labelInput, valid = true; @@ -65,7 +65,7 @@ const validateEmpty = () => { const validatePostcode = () => { let valid = true; - const labelArray = document.querySelectorAll(".user-input"); + const labelArray = document.querySelectorAll(".user-input-outer-wrap"); const postcodeInput = labelArray[currentTab].querySelector( ".user-input-postcode" ); @@ -80,7 +80,7 @@ const validatePostcode = () => { }; const nextInput = e => { e.preventDefault(); - const labelArray = document.querySelectorAll(".user-input"); + const labelArray = document.querySelectorAll(".user-input-outer-wrap"); if (!validateEmpty()) return false; if (currentTab == 1 || currentTab == 3) { diff --git a/src/views/HIW.hbs b/src/views/HIW.hbs index e05296c..624a6a3 100644 --- a/src/views/HIW.hbs +++ b/src/views/HIW.hbs @@ -1,14 +1,15 @@
{{> headerNoHelp}}
-

How It Works

-

Want to meet up with someone but can’t decide on a location? - - We take your frustration away, and find a location for you! - - Based on your current locations and preferences, we’ll suggest a list of perfect venues for you and your friend. - - Then, you’ll both have the chance to swipe through and select your favourite venues. - - Once we have a match, we’ll show you how to get there, too.

- -
\ No newline at end of file +

How It Works

+
+

Want to meet up with someone but can’t decide on a location?

+

We take your frustration away, and find a + location for you!

+

Based on your current locations and preferences, we’ll suggest a + ist of perfect venues for you and your friend.

+

Then, you’ll both have the chance to swipe through and select your + favourite venues.

+

Once we have a match, we’ll show you how to get there, too.

+
+ + diff --git a/src/views/form.hbs b/src/views/form.hbs index b1b83a4..a58d339 100644 --- a/src/views/form.hbs +++ b/src/views/form.hbs @@ -6,72 +6,74 @@
-
+ +
-

What's your name?

- +

What's your name?

+ +
-
-
+
-

What's your postcode?

- +

What's your postcode?

+ +
-
- -
+
-

What's your
friend's name?

- - +

What's your
friend's name?

+ +
-
-
+
-

What's 's postcode?

- +

What's 's postcode?

+ +
-
-
+
-

When do you
want to meet?

- - - +

When do you
want to meet?

+
+ + +
+
-
- -
-

What do you want to do?

-
- - - - - - - - -
+
+

What do you want to do?

+
+ + + + + + + +
+
+
- - + +
+
- - - - - - -
+ + + + + + +
+
diff --git a/src/views/home.hbs b/src/views/home.hbs index 16d094c..216230b 100644 --- a/src/views/home.hbs +++ b/src/views/home.hbs @@ -1,8 +1,9 @@
{{> headerNoHelp}}
-

Want to meet up with a friend?

-

Great! Tell us where you are and we’ll find a perfect venue that’s smack in the middle of both of you.

- - - -
\ No newline at end of file +

Want to meet up with a friend?

+

Great! Tell us where you are and we’ll find a perfect venue that’s smack in the middle of both of you.

+
+ + +
+ diff --git a/src/views/partials/header.hbs b/src/views/partials/header.hbs index 4066b62..9f332dd 100644 --- a/src/views/partials/header.hbs +++ b/src/views/partials/header.hbs @@ -1,9 +1,9 @@ -
- +
+
-
+