Skip to content

Commit

Permalink
Merge pull request #26 from mathieuher/preview/buttons
Browse files Browse the repository at this point in the history
refactor(buttons): rework buttons design
  • Loading branch information
mathieuher authored Jan 26, 2025
2 parents 7260448 + 4e8b912 commit 6dd0997
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 50 deletions.
53 changes: 21 additions & 32 deletions src/app/common/scss/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,36 @@
background-color: transparent;
box-shadow: none;
height: 40px;
font-size: var(--text-subtitle);
font-size: var(--text-standard);
font-family: "Kode mono", monospace;
text-align: center;
border-radius: var(--border-radius-large);
cursor: pointer;
transition: background-color var(--transition-time) ease-in-out;
transition: var(--transition-time) ease-in-out;
border: 0px;

border: 1px solid var(--color-primary);
color: var(--color-primary);
background-color: var(--color-primary);
color: var(--color-surface);

&.placeholder {
margin-top: 1rem;
}

&.tertiary {
border: 1px solid var(--color-tertiary);
color: var(--color-tertiary);

&:hover:not([disabled]) {
background-color: var(--color-tertiary-lightest);
}
}

&.error {
border: 1px solid var(--color-error);
color: var(--color-error);
background-color: var(--color-tertiary);
color: var(--color-surface);

&:hover:not([disabled]) {
background-color: var(--color-error-lightest);
background-color: var(--color-tertiary-hover);
}
}

&:hover:not([disabled]) {
background-color: var(--color-primary-lightest);
background-color: var(--color-primary-hover);
}

&[disabled] {
border-color: var(--color-disabled);
background-color: var(--color-disabled-lightest);
color: var(--color-disabled);
cursor: initial;
}
Expand Down Expand Up @@ -244,8 +236,8 @@
.retro-input {
font-size: var(--text-standard);
border-radius: var(--border-radius-large);
border-color: var(--color-tertiary);
color: var(--color-tertiary);
border-color: var(--color-primary);
color: var(--color-primary);
font-family: var(--text-font-family);
height: 40px;
padding: 0 0.5rem;
Expand Down Expand Up @@ -287,34 +279,31 @@
display: flex;
flex-direction: row;
padding: 0.5rem;
border: 1px solid var(--color-primary);
border: 0px;
border-radius: var(--border-radius);
font-size: var(--text-standard);
color: var(--color-primary);
color: var(--color-surface);
background-color: var(--color-primary);
justify-content: space-between;
align-items: center;
transition: background-color var(--transition-time) ease-in-out;
transition: var(--transition-time) ease-in-out;

&:hover {
background-color: var(--color-primary-lightest);
background-color: var(--color-primary-hover);
}

&.tertiary {
border: 1px solid var(--color-tertiary);
color: var(--color-tertiary);
color: var(--color-surface);
background-color: var(--color-tertiary);

&:hover {
background-color: var(--color-tertiary-lightest);
background-color: var(--color-tertiary-hover);
}
}

&.inactive {
border: 1px solid var(--color-disabled);
background-color: var(--color-disabled-lightest);
color: var(--color-disabled);

&:hover {
background-color: var(--color-disabled-lightest);
}
}

.icon {
Expand Down
4 changes: 3 additions & 1 deletion src/app/common/scss/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ html {
--color-app-background: #1e1e1e;
--color-surface: #ffffff;
--color-primary: #22165f;
--color-primary-light: #3a249d;
--color-primary-hover: #312763;
--color-primary-light: #6251af;
--color-primary-lightest: #ede9ff;
--color-tertiary: #9747ff;
--color-tertiary-hover: #9f5afa;
--color-tertiary-light: #9f78ca;
--color-tertiary-lightest: #f2e5ff;
--color-success: #10c045;
Expand Down
4 changes: 3 additions & 1 deletion src/app/pages/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<button class="retro-button" routerLink="/ride-local">
Ride local
</button>
<button class="retro-button" routerLink="/login">Ride online</button>
<button class="retro-button tertiary" routerLink="/login">
Ride online
</button>
</div>
</div>
4 changes: 2 additions & 2 deletions src/app/pages/local-event/local-event.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<div class="retro-footer">
@if(event.type !== 'race' || event.incomingRaces.length) {
<button
class="retro-button"
class="retro-button tertiary"
[disabled]="event.type === 'race' && !event.incomingRaces.length"
(click)="startRace()"
>
Expand All @@ -74,4 +74,4 @@
</button>
}
</div>
}
}
4 changes: 2 additions & 2 deletions src/app/pages/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<div class="retro-text error">{{ loginError() }}</div>
}
<button
class="retro-button"
class="retro-button tertiary"
[disabled]="loginForm.invalid"
(click)="login()"
>
Expand Down Expand Up @@ -86,7 +86,7 @@
<div class="retro-text error">{{ registerError() }}</div>
}
<button
class="retro-button"
class="retro-button tertiary"
[disabled]="registerForm.invalid"
(click)="register()"
>
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/online-event/online-event.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
</div>
<div class="retro-footer">
<button
class="retro-button"
class="retro-button tertiary"
routerLink="/online-race/{{ event()?.id }}"
[disabled]="event()?.racesLimit && !remainingRaces()?.length"
>
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/profile/profile.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<app-toolbar>
<ng-container ngProjectAs="left-actions">
<app-button-icon icon="close" (click)="goBack()"></app-button-icon>
<app-button-icon icon="close" routerLink="/login"></app-button-icon>
</ng-container>
</app-toolbar>
<div class="retro-content">
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/race/race.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
height: 100%;
top: 0px;
left: 0px;
background-color: rgba(255, 255, 255, 0.9);
background-color: rgba(255, 255, 255, 0.95);
color: var(--color-primary);

.ranking {
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/reset-password/reset-password.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
/>
</div>
<button
class="retro-button"
class="retro-button tertiary"
[disabled]="email.invalid"
(click)="sendMail()"
>
Expand Down
7 changes: 3 additions & 4 deletions src/app/pages/ride-local/ride-local.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</select>
}
</div>
<button class="retro-button tertiary" routerLink="/manage-tracks">
<button class="retro-button" routerLink="/manage-tracks">
Manage local tracks
</button>
</div>
Expand All @@ -31,7 +31,6 @@
@if(form.value.riders?.length! > 1) {
<app-button-icon
icon="delete"
class="tertiary"
(click)="removeRider($index)"
></app-button-icon>
}
Expand All @@ -45,7 +44,7 @@
</div>
}
<button
class="retro-button tertiary"
class="retro-button"
(click)="addRider()"
[disabled]="form.value.riders?.length! >= 4"
>
Expand All @@ -60,7 +59,7 @@
</div>
<div class="retro-footer">
<button
class="retro-button"
class="retro-button tertiary"
(click)="startEvent()"
[disabled]="!form.valid"
>
Expand Down
6 changes: 3 additions & 3 deletions src/app/pages/ride-online/ride-online.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

.server-infos {
padding: 0.25rem;
background-color: var(--color-tertiary-lightest);
color: var(--color-tertiary);
background-color: var(--color-tertiary);
color: var(--color-surface);
border-radius: var(--border-radius-large);
font-size: var(--text-small);
}
}
}
5 changes: 4 additions & 1 deletion src/app/pages/upgrade/upgrade.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
.retro-button {
text-align: left;
font-size: 0.8rem;
/* background-color: var(--color-primary-lightest);
color: var(--color-primary);
*/
}

.button-price {
Expand All @@ -25,7 +28,7 @@
justify-content: flex-end;
font-size: var(--text-small);
color: var(--color-surface);
background-color: var(--color-tertiary-light);
background-color: var(--color-primary);
border-radius: var(--border-radius);
}
}
Expand Down

0 comments on commit 6dd0997

Please sign in to comment.