From 2fb72ceb0382659393e95672f6fbf9e554617cd3 Mon Sep 17 00:00:00 2001 From: svetlagasheva Date: Tue, 29 Jan 2019 13:33:37 +0200 Subject: [PATCH 01/11] user-select: text; for inputs --- src/App/styles.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App/styles.less b/src/App/styles.less index da0ea8c21..9ab13c600 100644 --- a/src/App/styles.less +++ b/src/App/styles.less @@ -59,6 +59,7 @@ user-select: none; text-decoration: none; outline: none; + appearance: none; } html, body, :global(#app) { @@ -77,6 +78,10 @@ html, body, :global(#app) { height: 100%; } + input { + user-select: text; + } + ::-webkit-scrollbar { width: var(--scroll-bar-width); } From a837a0701fa6d648fa37aba7ee0fbaad843bce02 Mon Sep 17 00:00:00 2001 From: svetlagasheva Date: Tue, 29 Jan 2019 14:27:43 +0200 Subject: [PATCH 02/11] background image renamed --- .../{home-testimonials.jpg => login_background.jpg} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename images/{home-testimonials.jpg => login_background.jpg} (100%) diff --git a/images/home-testimonials.jpg b/images/login_background.jpg similarity index 100% rename from images/home-testimonials.jpg rename to images/login_background.jpg From 8e72845e77fbec49c382fc45cc4295df140fae34 Mon Sep 17 00:00:00 2001 From: svetlagasheva Date: Tue, 29 Jan 2019 14:30:49 +0200 Subject: [PATCH 03/11] intro screen style improvements --- src/common/Checkbox/styles.less | 4 +- src/routes/Intro/Intro.js | 56 ++++--- src/routes/Intro/styles.less | 252 +++++++++++++++++++------------- 3 files changed, 183 insertions(+), 129 deletions(-) diff --git a/src/common/Checkbox/styles.less b/src/common/Checkbox/styles.less index 10986c425..ffe321f53 100644 --- a/src/common/Checkbox/styles.less +++ b/src/common/Checkbox/styles.less @@ -16,8 +16,8 @@ opacity: 0; height: 0; width: 0; - top: -99999999px; - left: -99999999px; + top: 0; + left: 0; } &:global(.checked) { diff --git a/src/routes/Intro/Intro.js b/src/routes/Intro/Intro.js index ea94e84d4..8bbce9e13 100644 --- a/src/routes/Intro/Intro.js +++ b/src/routes/Intro/Intro.js @@ -18,6 +18,7 @@ class Intro extends Component { this.termsRef = React.createRef(); this.privacyPolicyRef = React.createRef(); this.marketingRef = React.createRef(); + this.errorRef = React.createRef(); this.state = { selectedForm: FORMS.SIGN_UP, @@ -32,6 +33,7 @@ class Intro extends Component { } changeSelectedForm = (event) => { + event.currentTarget.blur(); this.setState({ selectedForm: event.currentTarget.dataset.option, termsAccepted: false, @@ -85,6 +87,12 @@ class Intro extends Component { nextState.error !== this.state.error; } + componentDidUpdate(prevProps, prevState) { + if (prevState.error !== this.state.error && this.state.error.length > 0) { + this.errorRef.current.scrollIntoView(); + } + } + loginOnSubmit = (event) => { event.preventDefault(); if (this.state.email.length < 8) { @@ -144,7 +152,7 @@ class Intro extends Component { } } - validateGuestLogin = (event) => { + guestLoginOnSubmit = (event) => { if (!this.state.termsAccepted) { event.preventDefault(); this.setState({ error: 'You must accept the Terms of Service' }); @@ -154,15 +162,15 @@ class Intro extends Component { renderSignUpForm = () => { return (
- - - - + + + + { this.state.error.length > 0 ? -
{this.state.error}
+
{this.state.error}
: null } @@ -174,12 +182,12 @@ class Intro extends Component { renderLoginForm = () => { return ( - - + + Forgot password? { this.state.error.length > 0 ? -
{this.state.error}
+
{this.state.error}
: null } @@ -188,7 +196,7 @@ class Intro extends Component { ); } - renderSelectedMenu = () => { + renderSelectedForm = () => { switch (this.state.selectedForm) { case FORMS.SIGN_UP: return this.renderSignUpForm(); @@ -203,20 +211,22 @@ class Intro extends Component { return (
-
-
- -
Login with Facebook
+
+
+
+ +
Login with Facebook
+
+
We won't post anything on your behalf
+ {this.renderSelectedForm()} +
{this.state.selectedForm === FORMS.SIGN_UP ? 'LOG IN' : 'SING UP WITH EMAIL'}
+ { + this.state.selectedForm === FORMS.SIGN_UP ? + GUEST LOGIN + : + null + }
-
We won't post anything on your behalf
- {this.renderSelectedMenu()} -
{this.state.selectedForm === FORMS.SIGN_UP ? 'LOG IN' : 'SING UP WITH EMAIL'}
- { - this.state.selectedForm === FORMS.SIGN_UP ? - GUEST LOGIN - : - null - }
); diff --git a/src/routes/Intro/styles.less b/src/routes/Intro/styles.less index f9eb4c98c..e53cdf3bd 100644 --- a/src/routes/Intro/styles.less +++ b/src/routes/Intro/styles.less @@ -9,7 +9,7 @@ z-index: 0; width: 100%; height: 100%; - background-image: url('/images/home-testimonials.jpg'); + background-image: url('/images/login_background.jpg'); background-size: cover; background-attachment: fixed; @@ -23,126 +23,170 @@ background-color: var(--color-backgrounddark80); } - .intro { + .scroll-container { position: absolute; z-index: 1; top: 0; left: 0; right: 0; bottom: 0; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; + overflow-y: auto; + overflow-x: hidden; - .facebook-button { - width: var(--login-form-width); - height: calc(var(--login-form-width) * 0.25); - display: flex; - align-items: center; - justify-content: center; - cursor: pointer; - padding: calc(var(--spacing) * 1.25) 0; - background: var(--color-secondarydark); + .intro { + width: 270px; + margin: auto; - .icon { - height: 100%; - margin-right: var(--spacing); - fill: var(--color-surfacelighter); - } - - .label { - font-size: 1.1em; - color: var(--color-surfacelighter); - } - } - - .facebook-subtext { - margin: calc(var(--spacing) * 0.5) 0 calc(var(--spacing) * 4) 0; - color: var(--color-surface); - } - - .form-container { - width: var(--login-form-width); - display: flex; - align-items: center; - justify-content: center; - flex-direction: column; - - .email { - width: 100%; - margin-bottom: var(--spacing); - padding: 0.5em 0; - border-bottom: 1px solid var(--color-surface); - font-size: 1.1em; - color: var(--color-surfacelighter); - outline: none; - background: none; - - &::placeholder { - color: var(--color-surfacelight); - } - } - - .password { - width: 100%; - margin-bottom: var(--spacing); - padding: 0.5em 0; - border-bottom: 1px solid var(--color-surface); - font-size: 1.1em; - color: var(--color-surfacelighter); - outline: none; - background: none; - - &::placeholder { - color: var(--color-surfacelight); - } - } - - .checkbox-label { - width: 100%; - margin-bottom: var(--spacing); - } - - - .forgot-password { + .facebook-button { + width: var(--login-form-width); + height: calc(var(--login-form-width) * 0.25); + display: flex; + align-items: center; + justify-content: center; + padding: calc(var(--spacing) * 1.25) 0; + border: 2px solid transparent; + background: var(--color-secondarydark); cursor: pointer; - margin-bottom: var(--spacing); - color: var(--color-surfacelight); - &:hover { + .icon { + height: 100%; + margin-right: var(--spacing); + fill: var(--color-surfacelighter); + } + + .label { + font-size: 1.1em; color: var(--color-surfacelighter); } - } - .error { - margin-bottom: var(--spacing); - text-align: center; - color: var(--color-signal1); - } + &:focus { + border-color: var(--color-surfacelighter); + } - .submit-button { - width: 100%; - cursor: pointer; - outline: none; - padding: calc(var(--spacing) * 1.1); - font-size: 1.1em; - font-weight: 600; - color: var(--color-surfacelighter); - background-color: var(--color-primarydark); - - &:hover, &:focus { - background-color: var(--color-primary); + &:hover { + border-color: transparent; } } - } - .option { - margin-top: calc(var(--spacing) * 2); - cursor: pointer; - font-size: 1.1em; - font-weight: 600; - color: var(--color-surfacelighter); + .facebook-subtext { + margin: calc(var(--spacing) * 0.5) 0 calc(var(--spacing) * 4) 0; + text-align: center; + color: var(--color-surface); + } + + .form-container { + width: var(--login-form-width); + display: flex; + align-items: stretch; + justify-content: center; + flex-direction: column; + + .text-input { + margin: 0 calc(var(--spacing) * 0.5) var(--spacing) calc(var(--spacing) * 0.5); + padding: 0.5em 0; + border-bottom: 1px solid var(--color-surface); + font-size: 1.1em; + color: var(--color-surfacelighter); + background: none; + + &::placeholder { + color: var(--color-surfacelight); + } + + &:hover, &:focus { + border-bottom-color: var(--color-surfacelighter); + + &::placeholder { + color: var(--color-surfacelighter); + } + } + } + + .checkbox-label { + width: 100%; + margin-bottom: var(--spacing); + padding: calc(var(--spacing) * 0.5); + text-align: left; + border: 2px solid transparent; + + &:focus-within { + border-color: var(--color-surfacelighter); + } + } + + + .forgot-password { + align-self: flex-end; + margin-bottom: var(--spacing); + padding: calc(var(--spacing) * 0.5); + border: 2px solid transparent; + color: var(--color-surfacelight); + cursor: pointer; + + &:hover, &:focus { + color: var(--color-surfacelighter); + } + + &:focus { + border-color: var(--color-surfacelighter); + } + + &:hover { + border-color: transparent; + } + } + + .error { + margin-bottom: var(--spacing); + text-align: center; + color: var(--color-signal1); + } + + .submit-button { + width: 100%; + outline: none; + padding: calc(var(--spacing) * 1.1); + font-size: 1.1em; + font-weight: 600; + border: 2px solid transparent; + color: var(--color-surfacelighter); + background-color: var(--color-primarydark); + cursor: pointer; + + &:hover, &:focus { + background-color: var(--color-primary); + } + + &:focus { + border: 2px solid var(--color-surfacelighter); + } + + &:hover { + border-color: transparent; + } + } + } + + .option { + width: 100%; + display: inline-block; + margin-top: var(--spacing); + padding: calc(var(--spacing) * 0.5); + text-align: center; + font-size: 1.1em; + font-weight: 600; + border: 2px solid transparent; + color: var(--color-surfacelighter); + cursor: pointer; + + &:focus { + border: 2px solid var(--color-surfacelighter); + } + + &:hover { + border-color: transparent; + } + } } } } \ No newline at end of file From fe2ded7f324d7023a5dba6cd7d935f81e543b157 Mon Sep 17 00:00:00 2001 From: svetlagasheva Date: Tue, 29 Jan 2019 17:59:42 +0200 Subject: [PATCH 04/11] CheckboxLabel renamed to ConsentCheckbox --- src/routes/Intro/CheckboxLabel/index.js | 3 --- .../ConsentCheckbox.js} | 10 +++++----- src/routes/Intro/ConsentCheckbox/index.js | 3 +++ .../{CheckboxLabel => ConsentCheckbox}/styles.less | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 src/routes/Intro/CheckboxLabel/index.js rename src/routes/Intro/{CheckboxLabel/CheckboxLabel.js => ConsentCheckbox/ConsentCheckbox.js} (69%) create mode 100644 src/routes/Intro/ConsentCheckbox/index.js rename src/routes/Intro/{CheckboxLabel => ConsentCheckbox}/styles.less (96%) diff --git a/src/routes/Intro/CheckboxLabel/index.js b/src/routes/Intro/CheckboxLabel/index.js deleted file mode 100644 index 830cfc415..000000000 --- a/src/routes/Intro/CheckboxLabel/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import CheckboxLabel from './CheckboxLabel'; - -export default CheckboxLabel; diff --git a/src/routes/Intro/CheckboxLabel/CheckboxLabel.js b/src/routes/Intro/ConsentCheckbox/ConsentCheckbox.js similarity index 69% rename from src/routes/Intro/CheckboxLabel/CheckboxLabel.js rename to src/routes/Intro/ConsentCheckbox/ConsentCheckbox.js index d3e4974ed..9dfd91105 100644 --- a/src/routes/Intro/CheckboxLabel/CheckboxLabel.js +++ b/src/routes/Intro/ConsentCheckbox/ConsentCheckbox.js @@ -4,8 +4,8 @@ import classnames from 'classnames'; import { Checkbox } from 'stremio-common'; import styles from './styles'; -const CheckboxLabel = React.forwardRef(({ className, label, link, href, checked, onClick }, ref) => ( -