-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75a7189
commit 70f5729
Showing
18 changed files
with
365 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,36 @@ | ||
@if (getStyle === 'select-mode-button' || getStyle === 'select-mode-button-large' || getStyle === 'forward-button') { | ||
<button | ||
[disabled]="disabled" | ||
[class]="buttonStyle" | ||
> | ||
@if (buttonStyle === 'forward-button') { | ||
<div [class]="'full-gradient-inner'"> | ||
<div class="button-text"> | ||
{{ buttonText }} | ||
<mat-icon class="back-button-icon" aria-label="play_arrow">arrow_forward_ios</mat-icon> | ||
</div> | ||
</div> | ||
} | ||
@else { | ||
<div [class]="'non-gradient-inner'"> | ||
<div class="button-text"> | ||
<ng-content select="[slot='custom-mat-icon']"></ng-content> | ||
@if (getStyle === 'select-mode-button-large' ){ | ||
<span class="large-text">{{ buttonText }}</span> | ||
} @else { | ||
{{ buttonText }} | ||
} | ||
</div> | ||
</div> | ||
} | ||
</button> | ||
} @else { | ||
<button | ||
[disabled]="disabled" | ||
[class]="buttonStyle" | ||
> | ||
<div class="button-text"> | ||
@if (iconSrc) { | ||
@if (getStyle === 'back-button'){ | ||
<img class="back-button-icon" [src]="iconSrc" [alt]="alt"> | ||
} @else if (getStyle === 'home-button') { | ||
<img class="button-icon" [src]="iconSrc" [alt]="alt"> | ||
} @else { | ||
<img class="default" [src]="iconSrc" [alt]="alt"> | ||
} | ||
} | ||
{{ buttonText }} | ||
</div> | ||
</button> | ||
} | ||
|
||
|
||
@if (getStyle === 'select-mode-button' || getStyle === 'select-mode-button-large' || getStyle === 'forward-button') { | ||
<button [disabled]="disabled" [class]="buttonStyle"> | ||
@if (buttonStyle === 'forward-button') { | ||
<div [class]="'full-gradient-inner'"> | ||
<div class="button-text"> | ||
{{ buttonText }} | ||
<mat-icon class="back-button-icon" aria-label="play_arrow">arrow_forward_ios</mat-icon> | ||
</div> | ||
</div> | ||
} @else { | ||
<div [class]="'non-gradient-inner'"> | ||
<div class="button-text"> | ||
<ng-content select="[slot='custom-mat-icon']"></ng-content> | ||
@if (getStyle === 'select-mode-button-large' ){ | ||
<span class="large-text">{{ buttonText }}</span> | ||
} @else { | ||
{{ buttonText }} | ||
} | ||
</div> | ||
</div> | ||
} | ||
</button> | ||
} @else { | ||
<button [disabled]="disabled" [class]="buttonStyle"> | ||
<div class="button-text"> | ||
@if (iconSrc) { @if (getStyle === 'back-button'){ | ||
<img class="back-button-icon" [src]="iconSrc" [alt]="alt" /> | ||
} @else if (getStyle === 'home-button') { | ||
<img class="button-icon" [src]="iconSrc" [alt]="alt" /> | ||
} @else { | ||
<img class="default" [src]="iconSrc" [alt]="alt" /> | ||
} } | ||
{{ buttonText }} | ||
</div> | ||
</button> | ||
} |
203 changes: 99 additions & 104 deletions
203
src/app/game/custom-button/custom-button.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,99 @@ | ||
@import "../../../variables.scss"; | ||
|
||
|
||
@mixin button($gradient-border: false, $full-gradient: false, $back: false, $large: false){ | ||
height: 4rem; | ||
min-width: 14rem; | ||
max-width: 22rem; | ||
|
||
border-radius: 5rem; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
background-color: $button_background_color; | ||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.15); | ||
|
||
|
||
@if $back { | ||
background-color: black; | ||
border-color: white; | ||
border: 0.2rem solid; | ||
font-size: var(--fontSizeSmall); | ||
} | ||
@if $gradient-border{ | ||
background: linear-gradient(90deg, #1F60DE 0%, #681FDE 25%, #EC526D 50%, #EEC589 75%, #1CCEDA 100%); | ||
color: $text_primary_color; | ||
} | ||
@if $full-gradient { | ||
background: linear-gradient(0deg, #1F60DE 0%, #681FDE 14%, #EC526D 71%, #EDBA86 100%); | ||
color: $button_content_color; | ||
} | ||
@if $large{ | ||
height: 4.5rem; | ||
min-width: 18rem; | ||
} | ||
} | ||
|
||
@mixin rainbowContent($full-gradient: true){ | ||
width: 95%; | ||
height: 80%; | ||
border-radius: 5em; | ||
|
||
padding: 0 1rem 0 1rem; | ||
|
||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
@if $full-gradient{ | ||
background-color: rgba(0, 0, 0, 0.3); | ||
} @else { | ||
background-color: $button_background_color; | ||
} | ||
} | ||
|
||
.button-text { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 1rem; | ||
|
||
font-size: var(--fontSizeSmall); | ||
} | ||
|
||
.large-text{ | ||
font-size: var(--fontSizeMedium); | ||
} | ||
|
||
|
||
.full-gradient-inner{ | ||
@include rainbowContent(true) | ||
} | ||
|
||
.non-gradient-inner{ | ||
@include rainbowContent(false) | ||
} | ||
|
||
.default-button { | ||
@include button; | ||
} | ||
|
||
.back-button, .home-button { | ||
@include button(false, false, true); | ||
height: 3.5rem; | ||
} | ||
|
||
.select-mode-button { | ||
@include button(false, true); | ||
|
||
} | ||
|
||
.select-mode-button-large { | ||
@include button(false, true, false, true); | ||
} | ||
|
||
.forward-button { | ||
@include button(true); | ||
} | ||
|
||
|
||
@import '../../../variables.scss'; | ||
|
||
@mixin button($gradient-border: false, $full-gradient: false, $back: false, $large: false) { | ||
height: 4rem; | ||
min-width: 14rem; | ||
max-width: 22rem; | ||
|
||
border-radius: 5rem; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
background-color: $button_background_color; | ||
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.15); | ||
|
||
@if $back { | ||
background-color: black; | ||
border-color: white; | ||
border: 0.2rem solid; | ||
font-size: var(--fontSizeSmall); | ||
} | ||
@if $gradient-border { | ||
background: linear-gradient(90deg, #1f60de 0%, #681fde 25%, #ec526d 50%, #eec589 75%, #1cceda 100%); | ||
color: $text_primary_color; | ||
} | ||
@if $full-gradient { | ||
background: linear-gradient(0deg, #1f60de 0%, #681fde 14%, #ec526d 71%, #edba86 100%); | ||
color: $button_content_color; | ||
} | ||
@if $large { | ||
height: 4.5rem; | ||
min-width: 18rem; | ||
} | ||
} | ||
|
||
@mixin rainbowContent($full-gradient: true) { | ||
width: 95%; | ||
height: 80%; | ||
border-radius: 5em; | ||
|
||
padding: 0 1rem 0 1rem; | ||
|
||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
@if $full-gradient { | ||
background-color: rgba(0, 0, 0, 0.3); | ||
} @else { | ||
background-color: $button_background_color; | ||
} | ||
} | ||
|
||
.button-text { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 1rem; | ||
|
||
font-size: var(--fontSizeSmall); | ||
} | ||
|
||
.large-text { | ||
font-size: var(--fontSizeMedium); | ||
} | ||
|
||
.full-gradient-inner { | ||
@include rainbowContent(true); | ||
} | ||
|
||
.non-gradient-inner { | ||
@include rainbowContent(false); | ||
} | ||
|
||
.default-button { | ||
@include button; | ||
} | ||
|
||
.back-button, | ||
.home-button { | ||
@include button(false, false, true); | ||
height: 3.5rem; | ||
} | ||
|
||
.select-mode-button { | ||
@include button(false, true); | ||
} | ||
|
||
.select-mode-button-large { | ||
@include button(false, true, false, true); | ||
} | ||
|
||
.forward-button { | ||
@include button(true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,27 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { ButtonIconStyleClass, ButtonStyleClass } from '@/app/shared/buttonStyles'; | ||
import { RouterLink, RouterLinkActive } from '@angular/router'; | ||
import { MatIcon } from '@angular/material/icon'; | ||
|
||
|
||
@Component({ | ||
selector: 'app-custom-button', | ||
templateUrl: './custom-button.component.html', | ||
styleUrls: ['./custom-button.component.scss'], | ||
standalone: true, | ||
imports: [RouterLink, RouterLinkActive, MatIcon] | ||
}) | ||
export class CustomButton { | ||
@Input() buttonStyle: ButtonStyleClass = ButtonStyleClass.default; | ||
@Input() buttonText: string = "Button"; | ||
@Input() disabled = false; | ||
@Input() ariaLabel = ''; | ||
@Input() alt = '' | ||
|
||
@Input() iconSrc?: string; | ||
|
||
@Input() innerBackgroundStyle: 'full-gradient-inner' | 'non-gradient-inner' = 'non-gradient-inner'; | ||
|
||
get getStyle(): string { | ||
return this.buttonStyle | ||
} | ||
} | ||
import { Component, Input } from '@angular/core'; | ||
import { ButtonStyleClass } from '@/app/shared/buttonStyles'; | ||
import { RouterLink, RouterLinkActive } from '@angular/router'; | ||
import { MatIcon } from '@angular/material/icon'; | ||
|
||
@Component({ | ||
selector: 'app-custom-button', | ||
templateUrl: './custom-button.component.html', | ||
styleUrls: ['./custom-button.component.scss'], | ||
standalone: true, | ||
imports: [RouterLink, RouterLinkActive, MatIcon], | ||
}) | ||
export class CustomButtonComponent { | ||
@Input() buttonStyle: ButtonStyleClass = ButtonStyleClass.default; | ||
@Input() buttonText = 'Button'; | ||
@Input() disabled = false; | ||
@Input() ariaLabel = ''; | ||
@Input() alt = ''; | ||
|
||
@Input() iconSrc?: string; | ||
|
||
@Input() innerBackgroundStyle: 'full-gradient-inner' | 'non-gradient-inner' = 'non-gradient-inner'; | ||
|
||
get getStyle(): string { | ||
return this.buttonStyle; | ||
} | ||
} |
16 changes: 8 additions & 8 deletions
16
...ate-result/game-intermediate-result-footer/game-intermediate-result-footer.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<footer> | ||
<app-custom-button | ||
aria-disabled="true" | ||
[buttonStyle]="buttonStyleClass" | ||
[buttonText]=" buttonTextKey | translate " | ||
(keydown)="nextPage()" | ||
(click)="nextPage()" | ||
> | ||
<mat-icon slot="custom-mat-icon" class="button-icon-gradient" aria-label="play_arrow">arrow_forward_ios</mat-icon> | ||
</app-custom-button> | ||
aria-disabled="true" | ||
[buttonStyle]="buttonStyleClass" | ||
[buttonText]="buttonTextKey | translate" | ||
(keydown)="nextPage()" | ||
(click)="nextPage()" | ||
> | ||
<mat-icon slot="custom-mat-icon" class="button-icon-gradient" aria-label="play_arrow">arrow_forward_ios</mat-icon> | ||
</app-custom-button> | ||
</footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
...ate-result/game-intermediate-result-header/game-intermediate-result-header.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<header class="header"> | ||
<app-custom-button | ||
[buttonStyle]="homeButtonStyleClass" | ||
[buttonText]=" 'END_GAME_BUTTON' | translate " | ||
iconSrc="../../../../assets/house.svg" | ||
(click)="openDialog()" | ||
alt="Go home button" | ||
aria-label="Home button" | ||
/> | ||
[buttonStyle]="homeButtonStyleClass" | ||
[buttonText]="'END_GAME_BUTTON' | translate" | ||
iconSrc="../../../../assets/house.svg" | ||
(click)="openDialog()" | ||
alt="Go home button" | ||
aria-label="Home button" | ||
/> | ||
<app-game-progress-bar class="game-progress-bar"></app-game-progress-bar> | ||
<img class="logo" src="assets/logo/IO-logo-inverted_transparent-bg.png" alt="logo" /> | ||
</header> |
Oops, something went wrong.