Skip to content

Commit 37339fb

Browse files
authored
Merge pull request #105 from StraykerPL/feature/78-check-if-any-styling-instructions-are-breaking-conventions
Check if any styling instructions are breaking conventions
2 parents 2e15dcd + d27c713 commit 37339fb

File tree

13 files changed

+43
-51
lines changed

13 files changed

+43
-51
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Test Environment - [GitHub Pages](https://straykerpl.github.io/RockPaperScissors
6464

6565
### Built with
6666

67+
- Angular 14 on Node.js v18.12.0,
6768
- HTML5,
6869
- Sass (SCSS notation + BEM),
6970
- TypeScript,
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
$mainContentGap: 3.125rem;
2+
$rulesButtonSpacing: 1.875rem;
3+
14
.main-container {
2-
padding-top: 3.125rem;
5+
padding-top: $mainContentGap;
36

47
&__play-area {
58
display: flex;
69
flex-direction: column;
710
align-items: center;
8-
row-gap: 3.125rem;
11+
row-gap: $mainContentGap;
912
}
1013

1114
&__footer {
1215
display: flex;
1316
flex-direction: row;
1417
justify-content: flex-end;
1518
position: fixed;
16-
bottom: 1.875rem;
17-
right: 1.875rem;
19+
bottom: $rulesButtonSpacing;
20+
right: $rulesButtonSpacing;
1821
}
1922
}

rock-paper-scissors-frontend/src/app/components/header/header.component.scss

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
@use "variables";
2+
@use "mixins";
23

34
.header {
5+
@include mixins.default-centering;
46
width: 37.5rem;
57
height: 6.25rem;
6-
display: flex;
7-
flex-direction: row;
88
justify-content: space-between;
9-
align-items: center;
109
padding: 1.25rem;
1110
border: 2px solid variables.$boxBorderColor;
1211
border-radius: 15px;
1312

1413
&__logo {
15-
display: flex;
16-
flex-direction: row;
17-
justify-content: center;
18-
align-items: center;
14+
@include mixins.default-centering;
1915
width: 12.5rem;
2016
height: 6.25rem;
2117
}

rock-paper-scissors-frontend/src/app/components/play-area/play-area.component.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use "variables";
2+
@use "mixins";
23

34
// From https://stackoverflow.com/questions/37923231/how-can-i-use-a-material-design-icon-as-a-css-background-image-value - see ReadMe for explenation.
45
$backgroundIcon: url('data:image/svg+xml;utf-8,<svg width="313" height="278" xmlns="http://www.w3.org/2000/svg"><path stroke="%23000" stroke-width="15" fill="none" opacity=".2" d="M156.5 262 300 8H13z"/></svg>');
@@ -10,11 +11,8 @@ $backgroundIcon: url('data:image/svg+xml;utf-8,<svg width="313" height="278" xml
1011
justify-content: center;
1112

1213
&__start {
13-
display: flex;
14-
flex-direction: row;
14+
@include mixins.default-centering;
1515
flex-wrap: wrap;
16-
justify-content: center;
17-
align-items: center;
1816
column-gap: 5rem;
1917
row-gap: 2.5rem;
2018
width: 37.5rem;

rock-paper-scissors-frontend/src/app/components/play-area/play-area.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export class PlayAreaComponent implements OnInit {
2727

2828
ngOnInit() {}
2929

30-
async gameStart(value: PlayOption) {
31-
this.playerChoice = value;
30+
async gameStart(playerOption: PlayOption) {
31+
this.playerChoice = playerOption;
3232
this.showChoices = true;
3333

3434
await this.gameService.sleep(3000);

rock-paper-scissors-frontend/src/app/components/play-option/play-option.component.scss

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
@use "mixins" as mixins;
1+
@use "mixins";
22

33
.play-option {
4+
@include mixins.default-centering;
45
width: 12.5rem;
56
height: 12.5rem;
67
border-radius: 100%;
7-
display: flex;
8-
flex-direction: row;
9-
justify-content: center;
10-
align-items: center;
118

129
&--big {
1310
transform: scale(1.5);
@@ -38,14 +35,11 @@
3835
}
3936

4037
&__inner-circle {
38+
@include mixins.default-centering;
4139
width: 9.375rem;
4240
height: 9.375rem;
4341
border-radius: 100%;
4442
background-color: white;
45-
display: flex;
46-
flex-direction: row;
47-
justify-content: center;
48-
align-items: center;
4943
box-shadow: inset 0px 8px 0px 0px hsl(228, 23%, 79%);
5044

5145
&-icon {

rock-paper-scissors-frontend/src/app/components/rules-button/rules-button.component.scss

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
@use "variables";
2+
@use "mixins";
23

34
$letterSpacingValue: 2px;
45
$borderRadiusValue: 10px;
56

67
.rules-button {
7-
display: flex;
8+
@include mixins.default-centering;
89
flex-direction: column;
9-
align-items: center;
10-
justify-content: center;
11-
min-width: 7rem;
12-
min-height: 2.25rem;
10+
height: 2.25rem;
1311
width: 7rem;
1412
border: 2px solid variables.$boxBorderColor;
1513
border-radius: $borderRadiusValue;
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<div class="rulesdialog">
2-
<div class="rulesdialog__header">
3-
<h2 class="rulesdialog__header-title">RULES</h2>
4-
<button class="rulesdialog__header-close-button" mat-dialog-close>
1+
<div class="rules-dialog">
2+
<div class="rules-dialog__header">
3+
<h2 class="rules-dialog__header-title">RULES</h2>
4+
<button class="rules-dialog__header-close-button" mat-dialog-close>
55
<mat-icon
6-
class="rulesdialog__header-close-button-icon"
6+
class="rules-dialog__header-close-button-icon"
77
svgIcon="close-icon">
88
</mat-icon>
99
</button>
1010
</div>
11-
<div class="rulesdialog__image">
12-
<mat-icon class="rulesdialog__image-icon" svgIcon="rules-diag"> </mat-icon>
11+
<div class="rules-dialog__image">
12+
<mat-icon class="rules-dialog__image-icon" svgIcon="rules-diag"></mat-icon>
1313
</div>
1414
</div>

rock-paper-scissors-frontend/src/app/components/rules-modal/rules-modal.component.scss

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
@use "variables";
2+
@use "mixins";
23

3-
.rulesdialog {
4-
display: flex;
4+
.rules-dialog {
5+
@include mixins.default-centering;
56
flex-direction: column;
6-
align-items: center;
7-
justify-content: center;
87
row-gap: 1.25rem;
98

109
&__header {
@@ -20,10 +19,8 @@
2019
}
2120

2221
&-close-button {
23-
display: flex;
22+
@include mixins.default-centering;
2423
flex-direction: column;
25-
justify-content: center;
26-
align-items: center;
2724
border: none;
2825
background-color: transparent;
2926

rock-paper-scissors-frontend/src/app/components/score-box/score-box.component.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
@use "variables";
2+
@use "mixins";
23

34
.score-box {
4-
display: flex;
5+
@include mixins.default-centering;
56
flex-direction: column;
6-
justify-content: center;
7-
align-items: center;
87
row-gap: 0.25rem;
98
background-color: white;
109
width: 9.375rem;

rock-paper-scissors-frontend/src/shared/styles/_mixins.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@
33
background: linear-gradient(0deg, $startColor 0%, $endColor 100%);
44
box-shadow: 0px 8px 0px 0px $shadowColor;
55
}
6+
7+
@mixin default-centering {
8+
display: flex;
9+
flex-direction: row;
10+
justify-content: center;
11+
align-items: center;
12+
}

rock-paper-scissors-frontend/src/shared/styles/_variables.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ $backgroundGradient: radial-gradient(
44
hsl(214, 47%, 23%),
55
hsl(237, 49%, 15%)
66
);
7-
$bodyMinHeight: 95%;
87
$desktopWidth: 1366px;
98
$mobileWidth: 375px;
109
$font: "Barlow Semi Condensed", sans-serif;

rock-paper-scissors-frontend/src/styles.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ $rock-paper-scissors-frontend-theme: mat.define-light-theme(
4040
// that you are using.
4141
@include mat.all-component-themes($rock-paper-scissors-frontend-theme);
4242

43-
html {
43+
html,
44+
body {
4445
height: variables.$pageHeightPercent;
4546
}
4647

4748
body {
4849
background-image: variables.$backgroundGradient;
4950
background-repeat: no-repeat;
50-
min-height: variables.$bodyMinHeight;
5151
font-family: variables.$font;
5252
font-weight: variables.$defaultFontWeight;
5353
color: variables.$defaultFontColor;

0 commit comments

Comments
 (0)