feat: restyle unauthenticated screens #1103

Merged
dpschen merged 29 commits from feature/login-pages into main 2021-12-12 16:40:14 +00:00
Owner

I wanted to give the no-auth screens a new look. Here's what I ended up with:

image

The image is something we could change with every release.

I wanted to give the no-auth screens a new look. Here's what I ended up with: ![image](/attachments/d272f36b-03c1-40ca-91f6-30f34e03e5fd) The image is something we could change with every release.
konrad added 6 commits 2021-11-28 14:52:30 +00:00
konrad requested review from dpschen 2021-11-28 14:52:34 +00:00
Member

Hi konrad!

Thank you for creating a PR!

I've deployed the changes of this PR on a preview environment under this URL: https://1103-featurelogin-pages--vikunja-frontend-preview.netlify.app

You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.

Have a nice day!

Beep boop, I'm a bot.

Hi konrad! Thank you for creating a PR! I've deployed the changes of this PR on a preview environment under this URL: https://1103-featurelogin-pages--vikunja-frontend-preview.netlify.app You can use this url to view the changes live and test them out. You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/. Have a nice day! > Beep boop, I'm a bot.
Member

Login wrapper collides with llama

Login wrapper collides with llama
Member

The Login / Register buttons are confusing:

When you are on login and click on "Register": it seems that only the position is toggled.

=> The action on the button, the color and position changes for the buttons on the two routes but the label stays the same.

Below screenshots from fb and twitter for inspiration.

(I know this was the case before but since we are trying improve UX here I guess this makes sense to add)

The Login / Register buttons are confusing: When you are on login and click on "Register": it seems that only the position is toggled. => The action on the button, the color and position changes for the buttons on the two routes but the label stays the same. Below screenshots from fb and twitter for inspiration. (I know this was the case before but since we are trying improve UX here I guess this makes sense to add)
Member

The success messages feels like a duplication of the content of the api-config.

Maybe just changing the value is enough? Or use a success notification?

The success messages feels like a duplication of the content of the api-config. Maybe just changing the value is enough? Or use a success notification?
dpschen requested changes 2021-12-09 18:23:17 +00:00
dpschen left a comment
Member

Hope I was not to picky. I'm trying to align our coding style.
If too annoying please tell me =)

Hope I was not to picky. I'm trying to align our coding style. If too annoying please tell me =)
@ -17,0 +19,4 @@
.message-wrapper {
border-radius: $radius;
background: var(--white);
overflow: hidden;
  • I don't get the need for the new wrapper.

  • What's the overflow for?

- I don't get the need for the new wrapper. - What's the `overflow` for?
Author
Owner

That's because the message background is transparent. When I put the message on something with a background, it would shine through. The overlay puts a white background behind it so the message background color is always the same.

I just realized I don't need the overflow so I just removed it.

That's because the message background is transparent. When I put the message on something with a background, it would shine through. The overlay puts a white background behind it so the message background color is always the same. I just realized I don't need the overflow so I just removed it.
konrad marked this conversation as resolved
@ -14,2 +24,3 @@
import Logo from '@/components/home/Logo.vue'
import message from '@/components/misc/message'
import Message from '@/components/misc/message'
import Legal from '../../components/misc/legal'

Use @

Use `@`
Author
Owner

Done.

Done.
konrad marked this conversation as resolved
@ -26,1 +37,4 @@
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;

Super picky: use place-items: center (I think this is replaced with the same after parsed :D)

Super picky: use `place-items: center` (I think this is replaced with the same after parsed :D)
Author
Owner

Oh, that sounds like a nice property, never heard of it before.

Oh, that sounds like a nice property, never heard of it before.
konrad marked this conversation as resolved
@ -32,1 +47,3 @@
margin: 0 auto;
min-height: 60vh;
display: flex;
background: var(--white);

Picky:
Use background-color => more specific, doesn't change other values if they are set (they are not in this case). Makes it easier to overwrite if necessary.

Picky: Use `background-color` => more specific, doesn't change other values if they are set (they are not in this case). Makes it easier to overwrite if necessary.
konrad marked this conversation as resolved
@ -33,0 +49,4 @@
background: var(--white);
border-radius: $radius;
box-shadow: var(--shadow-md);
overflow: hidden;

Why overflow: hidden?

Why overflow: hidden?
Author
Owner

To prevent the background from overflowing in the (rounded) corners.

To prevent the background from overflowing in the (rounded) corners.
konrad marked this conversation as resolved
@ -33,0 +51,4 @@
box-shadow: var(--shadow-md);
overflow: hidden;
@media screen and (max-width: $desktop) {

Use mobile first:

	@media screen and (min-width: $desktop) {
    		border-radius: $radius;
    }

=> no need to reset the border-radius for mobile

Use mobile first: ```scss @media screen and (min-width: $desktop) { border-radius: $radius; } ``` => no need to reset the border-radius for mobile
konrad marked this conversation as resolved
@ -33,0 +58,4 @@
.image {
width: 60%;
background: url('@/assets/no-auth-image.jpg') no-repeat bottom;

Use mobile first:

.image {
    @media screen and (max-width: $tablet) {
        display: none;
    }
    @media screen and (min-width: $tablet) {
        width: 40%;
        background: url('@/assets/no-auth-image.jpg') no-repeat bottom/cover;
        position: relative;
    }
    @media screen and (min-width: $desktop) {
        width: 60%;
    }
}

Compress image and load with something like https://github.com/JonasKruckenberg/imagetools

Use mobile first: ```scss .image { @media screen and (max-width: $tablet) { display: none; } @media screen and (min-width: $tablet) { width: 40%; background: url('@/assets/no-auth-image.jpg') no-repeat bottom/cover; position: relative; } @media screen and (min-width: $desktop) { width: 60%; } } ``` Compress image and load with something like https://github.com/JonasKruckenberg/imagetools
Author
Owner

Compress image and load with something like https://github.com/JonasKruckenberg/imagetools

With the vite wrapper and use it for other images as well?

> Compress image and load with something like https://github.com/JonasKruckenberg/imagetools With the vite wrapper and use it for other images as well?

Yes. But maybe let's move this to a new issue.

Yes. But maybe let's move this to a new issue.
Author
Owner

yeah I think we should.

yeah I think we should.
konrad marked this conversation as resolved
@ -34,0 +81,4 @@
background: rgba(0, 0, 0, .2);
display: flex;
flex-direction: column;
justify-content: end;

Since the image is defined via CSS:
Not sure why the overlay is needed at all:
If the image uses flex itself you could position the title and message directly as a child.

Title could have: margin-top: auto or justify-self: flex-end. I think both should work.

EDIT:
I just saw that the overlay is used for the background-overlay. But the same could be archieved without DOM impact / new element by styling a ::after.

I got a warning for end so I guess it's still better to use flex-end.
=> Maybe support is better, and it seems that postcss-preset-env / autoprefixer doesn't change this automatically.

Picky: same for background as above.

Since the image is defined via CSS: Not sure why the overlay is needed at all: If the image uses flex itself you could position the title and message directly as a child. Title could have: `margin-top: auto` or `justify-self: flex-end`. I think both should work. **EDIT:** I just saw that the overlay is used for the background-overlay. But the same could be archieved without DOM impact / new element by styling a `::after`. I got a warning for `end` so I guess it's still better to use `flex-end`. => Maybe support is better, and it seems that postcss-preset-env / autoprefixer doesn't change this automatically. Picky: same for background as above.
Author
Owner

Moved this to an after pseudo class.

Moved this to an after pseudo class.
konrad marked this conversation as resolved
@ -34,0 +89,4 @@
}
.content {
width: 50%;

If .image is either 40% or 60% why is this 50% wide? Also use mobile first for the width value.

If `.image` is either 40% or 60% why is this 50% wide? Also use mobile first for the width value.
Author
Owner

Change it so everything is always 50%. That seems to work great.

Also use mobile first for the width value.

I'm not quite sure why but it does not work when I only use min-width: $desktop.

Change it so everything is always 50%. That seems to work great. > Also use mobile first for the width value. I'm not quite sure why but it does not work when I only use `min-width: $desktop`.

The default width of a flex child is auto as far as i know.

The default width of a flex child is auto as far as i know.
dpschen marked this conversation as resolved
@ -34,3 +100,4 @@
}
}
.logo {

On desktop:
Maybe the logo should be not centered but left aligned with the content below.
=> Might make the Title easier to read because there is more room between those two headlines

On desktop: Maybe the logo should be not centered but left aligned with the content below. => Might make the Title easier to read because there is more room between those two headlines
Author
Owner

You mean aligned in the middle like this?

You mean aligned in the middle like this?
Author
Owner

Okay wow I can't put images in a comment here, here's the screenshot I wanted to post:

Okay wow I can't put images in a comment here, here's the screenshot I wanted to post: ![](https://kolaente.dev/attachments/1847041a-d987-46e1-9d70-99c5745e8306)

I'm also not really happy with this. Let's keep it for now how it is.

I'm also not really happy with this. Let's keep it for now how it is.
dpschen marked this conversation as resolved
@ -34,4 +101,4 @@
}
.logo {
color: var(--logo-text-color);

Color seems to be applied twice (from inside the component aswell).

Color seems to be applied twice (from inside the component aswell).
konrad marked this conversation as resolved
@ -36,3 +103,4 @@
.logo {
color: var(--logo-text-color);
max-width: 100%;
margin: 1rem 0;

Picky: new css love: use margin-block: 1rem; => transformed by postcss-preset-env. Reason: you don't want to define the inline (left, right) value, but do it here as a sideeffect.

Picky: new css love: use `margin-block: 1rem;` => transformed by postcss-preset-env. Reason: you don't want to define the inline (left, right) value, but do it here as a sideeffect.
Author
Owner

hmm it looks like this isn't transformed. But it definitely is a nice propery.

hmm it looks like this isn't transformed. But it definitely is a nice propery.

I checked this again.

I think that the browsers that we want to support according to our browserslist all support it natively so there is no need for postcss-preset-env to transform it =)

Because it does do that via postcss-logical

I checked this again. I think that the browsers that we want to support according to our browserslist all support it natively so there is no need for postcss-preset-env to transform it =) Because it does do that via [postcss-logical](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical)
konrad marked this conversation as resolved
@ -39,0 +106,4 @@
margin: 1rem 0;
}
.message {

Add class to Message component and use that.
=> By using a class inside the component we would create an implicit dependency.

Add class to Message component and use that. => By using a class inside the component we would create an implicit dependency.
Author
Owner

It looks like the class here wasn't used anywhere. I've removed it.

It looks like the class here wasn't used anywhere. I've removed it.
konrad marked this conversation as resolved
@ -25,0 +4,4 @@
<message variant="success" class="has-text-centered" v-if="confirmedEmailSuccess">
{{ $t('user.auth.confirmEmailSuccess') }}
</message>
<api-config @foundApi="hasApiUrl = true"/>

There is no <api-config> in the Register and Reset-password route. Should it be there aswell?

There is no `<api-config>` in the Register and Reset-password route. Should it be there aswell?
Author
Owner

I think it should. I've moved the <api-config/> component to the wrapper and the logo as well in the process. Should be better now.

I think it should. I've moved the `<api-config/>` component to the wrapper and the logo as well in the process. Should be better now.
konrad marked this conversation as resolved
@ -79,1 +58,3 @@
</div>
<div class="field is-grouped login-buttons">
<div class="control is-expanded">
<x-button

Make login button larger
=> "hard" to tap on mobile if you keep in mind that this is the primary action of the page.

Make login button larger => "hard" to tap on mobile if you keep in mind that this is the primary action of the page.
Author
Owner

Would like to do that in #1104 while changing the register link wording you mentioned earlier.

Would like to do that in #1104 while changing the register link wording you mentioned earlier.
konrad marked this conversation as resolved
@ -98,3 +79,2 @@
</div>
<legal/>
<message variant="danger" v-if="errorMessage">

The error message should be on top => can't see on small screens without scrolling

The error message should be on top => can't see on small screens without scrolling
Author
Owner

Done.

Done.
konrad marked this conversation as resolved
@ -64,0 +52,4 @@
</message>
</form>
<div class="has-text-centered" v-if="successMessage">
<message variant="success">

Move error and succes to top here aswell.

Move error and succes to top here aswell.
konrad marked this conversation as resolved
@ -44,3 +32,2 @@
</x-button>
</div>
<Legal />
<message variant="danger" v-if="errorMsg">

Move error messages here to top aswell.

Move error messages here to top aswell.
konrad marked this conversation as resolved
Member

The one column variant might gain from having a smaller max-width.

The one column variant might gain from having a smaller max-width.
konrad was assigned by dpschen 2021-12-10 11:55:04 +00:00
konrad added 1 commit 2021-12-11 17:16:25 +00:00
continuous-integration/drone/pr Build is failing Details
1ff667e598
chore: show llama background only on fullhd and up
Author
Owner

Login wrapper collides with llama

Oh right. Now hiding it on smaller screens where it would collide.

The Login / Register buttons are confusing:

Makes sense. I'd like to move changing this to #1104 since this PR is mostly about styling while #1104 is about ux.

Maybe just changing the value is enough? Or use a success notification?

I like the idea of a notification.

> Login wrapper collides with llama Oh right. Now hiding it on smaller screens where it would collide. > The Login / Register buttons are confusing: Makes sense. I'd like to move changing this to #1104 since this PR is mostly about styling while #1104 is about ux. > Maybe just changing the value is enough? Or use a success notification? I like the idea of a notification.
konrad added 1 commit 2021-12-11 17:21:23 +00:00
continuous-integration/drone/pr Build is passing Details
8ba8be103a
Merge branch 'main' into feature/login-pages
# Conflicts:
#	src/components/misc/no-auth-wrapper.vue
#	src/i18n/lang/en.json
konrad added 1 commit 2021-12-11 17:23:07 +00:00
continuous-integration/drone/pr Build is passing Details
d37fc06c2f
feat: use a success notification instead of a message
konrad added 1 commit 2021-12-11 17:26:31 +00:00
continuous-integration/drone/pr Build is passing Details
70ba20a66e
chore: remove overflow
konrad added 1 commit 2021-12-11 17:27:42 +00:00
continuous-integration/drone/pr Build is passing Details
6fff15518d
chore: use place-items
konrad added 1 commit 2021-12-11 17:28:43 +00:00
continuous-integration/drone/pr Build is passing Details
613c2bd374
chore: use background-color
konrad added 1 commit 2021-12-11 17:30:47 +00:00
continuous-integration/drone/pr Build is passing Details
498ecc7505
chore: mobile first
konrad added 1 commit 2021-12-11 17:37:03 +00:00
continuous-integration/drone/pr Build is passing Details
9b58c5fb6b
fix: make sure image + content are always 50% width
Author
Owner
konrad added 1 commit 2021-12-11 19:36:36 +00:00
continuous-integration/drone/pr Build is passing Details
fc8321df6b
chore: cleanup double color definition
konrad added 1 commit 2021-12-11 19:37:39 +00:00
continuous-integration/drone/pr Build is passing Details
be8f93c50b
chore: remove unused class
konrad added 1 commit 2021-12-11 19:41:08 +00:00
continuous-integration/drone/pr Build is passing Details
97945f3f42
feat: move messages to the top
Author
Owner

The one column variant might gain from having a smaller max-width.

So basically more horizontal margin?

> The one column variant might gain from having a smaller max-width. So basically more horizontal margin?
konrad added 1 commit 2021-12-11 19:50:31 +00:00
continuous-integration/drone/pr Build is passing Details
334c5610d9
chore: use after instead of new element for overlay
konrad added 1 commit 2021-12-11 19:51:03 +00:00
continuous-integration/drone/pr Build is passing Details
7969daa341
chore: use background-color
konrad added 1 commit 2021-12-11 20:02:27 +00:00
continuous-integration/drone/pr Build is passing Details
babfd24739
chore: use flex-end
konrad added 1 commit 2021-12-11 20:19:12 +00:00
continuous-integration/drone/pr Build is failing Details
1c339a7fe0
feat: move title and api config to no auth wrapper
Member

So basically more horizontal margin?

Auto margin and a max-width.

> So basically more horizontal margin? Auto margin and a max-width.
Member

I think it should be "Using Vikunja installation at" [...]" (instead of "on") in for the notification aswell as the api-config. (unsure am not native ;) )

I think it should be "Using Vikunja installation **at**" [...]" (instead of "on") in for the notification aswell as the api-config. (unsure am not native ;) )
Member

The image still seems to be the large version (according to the gitea size value).

The image still seems to be the large version (according to the gitea size value).
dpschen reviewed 2021-12-12 13:41:40 +00:00
@ -27,0 +52,4 @@
place-items: center;
@media screen and (min-width: $fullhd) {
background: url('@/assets/llama.svg?url') no-repeat bottom left fixed;

Just checked this: The llama is so nice, it's too bad it's not visivle on mobile. How about adding a padding-bottom for mobile?

Just checked this: The llama is so nice, it's too bad it's not visivle on mobile. How about adding a padding-bottom for mobile?
Author
Owner

done!

done!
konrad marked this conversation as resolved
konrad added 1 commit 2021-12-12 13:48:48 +00:00
continuous-integration/drone/pr Build is failing Details
18b0ed4a29
feat: smaller max width for form on mobile
konrad added 3 commits 2021-12-12 13:54:35 +00:00
Author
Owner

Auto margin and a max-width.

Done.

I think it should be "Using Vikunja installation at" [...]" (instead of "on") in for the notification aswell as the api-config. (unsure am not native ;) )

I think it makes sense though. Changed it.

The image still seems to be the large version (according to the gitea size value).

Added the compressed version you sent me, I think it should be fine now?

> Auto margin and a max-width. Done. > I think it should be "Using Vikunja installation at" [...]" (instead of "on") in for the notification aswell as the api-config. (unsure am not native ;) ) I think it makes sense though. Changed it. > The image still seems to be the large version (according to the gitea size value). Added the compressed version you sent me, I think it should be fine now?
konrad added 1 commit 2021-12-12 13:56:45 +00:00
continuous-integration/drone/pr Build is passing Details
c0b8d08239
fix: lint
dpschen reviewed 2021-12-12 14:14:07 +00:00
@ -33,0 +71,4 @@
}
.image {
width: 50%;

Move these rules to the @media screen and (min-width: $tablet) media query
=> makes it clearer that it just appies there.

	width: 50%;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
    
	&::after {
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, .2);
		z-index: 10;
	}

	> * {
		z-index: 20;
	}

Move media queries before &::after and > *
=> those are styling other elements
=> move styles together that style the same stuff

If you change &::after in &::before you can remove the z-index if you replace
z-index: 20; with position: relative (this creates a new stacking context.
=> less complexity with managing z-index.

Move these rules to the `@media screen and (min-width: $tablet)` media query => makes it clearer that it just appies there. ```scss width: 50%; padding: 1rem; display: flex; flex-direction: column; justify-content: flex-end; &::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, .2); z-index: 10; } > * { z-index: 20; } ``` Move media queries before `&::after` and `> *` => those are styling other elements => move styles together that style the same stuff If you change `&::after` in `&::before` you can remove the z-index if you replace `z-index: 20;` with `position: relative` (this creates a new [stacking context](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Positioning/Understanding_z_index/The_stacking_context). => less complexity with managing z-index.
Author
Owner

Done!

Done!
konrad marked this conversation as resolved
dpschen reviewed 2021-12-12 14:21:19 +00:00
@ -34,0 +106,4 @@
}
}
.content {

Use mobile first:

.content {
    // start with common stuff
    display: flex;
    justify-content: space-between;
    flex-direction: column;
	padding: 2rem 2rem 1.5rem;
    
    // define stuff that applies mobile only
	@media screen and (max-width: $desktop) {
        width: 100%;
		max-width: 450px;
		margin-inline: auto;
	}
    
    // define desktop only stuff
    @media screen and (min-width: $desktop) {
		width: 50%;
	}
}
Use mobile first: ```scss .content { // start with common stuff display: flex; justify-content: space-between; flex-direction: column; padding: 2rem 2rem 1.5rem; // define stuff that applies mobile only @media screen and (max-width: $desktop) { width: 100%; max-width: 450px; margin-inline: auto; } // define desktop only stuff @media screen and (min-width: $desktop) { width: 50%; } } ```
Author
Owner

Done!

Done!
konrad marked this conversation as resolved
konrad added 1 commit 2021-12-12 14:51:42 +00:00
continuous-integration/drone/pr Build was killed Details
3ab2efb32c
chore: rearrange styles
konrad added 1 commit 2021-12-12 14:52:48 +00:00
continuous-integration/drone/pr Build was killed Details
6ef22705b6
chore: rearrange styles yet again
konrad added 1 commit 2021-12-12 14:56:10 +00:00
continuous-integration/drone/pr Build is passing Details
f4bdfe38a3
chore: more mobile first
dpschen approved these changes 2021-12-12 15:18:31 +00:00
dpschen merged commit 32353e3b76 into main 2021-12-12 16:40:14 +00:00
dpschen deleted branch feature/login-pages 2021-12-12 16:40:14 +00:00
This repo is archived. You cannot comment on pull requests.
No description provided.