Skip to content
Snippets Groups Projects
Commit 2766bf06 authored by Yehor Potebenko's avatar Yehor Potebenko
Browse files

refactor: add some scss mixins and templates

parent 71a7358e
No related branches found
No related tags found
3 merge requests!5First version,!1Main page markup,!4Main page server todos
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
@import '@scss-modules/global'; @import '@scss-modules/global';
@import '@scss-modules/global-templates'; @import '@scss-modules/global-templates';
@import '@scss-modules/main/palette'; @import '@scss-modules/main/palette';
@import '@scss-modules/main/templates';
.wrapper { .wrapper {
@extend %wrapper; @extend %wrapper;
...@@ -13,29 +14,20 @@ ...@@ -13,29 +14,20 @@
body { body {
&.lock { &.lock {
overflow: hidden; @extend %body-lock;
} }
} }
.header { .header {
position: fixed; @include fixed-header(998);
top: 0;
left: 0;
width: 100%;
padding-top: 35px; padding-top: 35px;
z-index: 998;
&__menu { &__menu {
margin-top: 0; @include null-ul();
margin-bottom: 0;
padding-left: 0;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
> * {
list-style-type: none;
}
} }
} }
...@@ -74,53 +66,12 @@ body { ...@@ -74,53 +66,12 @@ body {
} }
.popup { .popup {
position: fixed; @extend .popup;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: $transparent-dark-red;
opacity: 0;
visibility: hidden;
transition: all 0.8s ease 0s;
z-index: 999;
&__body {
min-height: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 30px 10px;
}
&__content {
text-align: right;
transition: all 0.8s ease 0s;
transform: perspective(600px) translate(0px, -100%) rotateX(45deg);
> * {
&.popup__close {
display: inline-block;
}
}
}
&.open {
opacity: 1;
visibility: visible;
}
&.open &__content {
transform: perspective(600px) translate(0px, 0%) rotateX(0deg);
}
} }
.todo-popup { .todo-popup {
&__content { &__content {
width: 42.9%; @include popup-base-content(42.9%, 25px 25px 30px 25px, $alice-blue, 20px);
padding: 25px 25px 30px 25px;
background-color: $alice-blue;
border-radius: 20px;
} }
&__wrapper { &__wrapper {
...@@ -133,31 +84,18 @@ body { ...@@ -133,31 +84,18 @@ body {
max-width: 32.2%; max-width: 32.2%;
margin: 0 auto 17px; margin: 0 auto 17px;
text-align: center; text-align: center;
font-weight: 700; @include lets-do-title(36px, 43px);
font-size: 36px;
line-height: 43px;
background: linear-gradient(266.66deg, $heliotrope 1.54%, $matisse 101.33%);
background-clip: text;
-webkit-background-clip: text;
color: transparent;
} }
&__question { &__question {
margin-top: 0; margin-top: 0;
margin-bottom: 20px; margin-bottom: 20px;
text-align: left; text-align: left;
font-family: 'Inder', sans-serif; @include popup-question-template(20px, 25px, $scampi, (Inder, sans-serif));
font-weight: 400;
font-size: 20px;
line-height: 25px;
color: $scampi;
} }
&__list { &__list {
margin-top: 0; @include null-ul(318px);
padding-left: 0;
list-style-type: none;
margin-bottom: 318px;
display: inline-block; display: inline-block;
margin-right: auto; margin-right: auto;
} }
...@@ -201,14 +139,8 @@ body { ...@@ -201,14 +139,8 @@ body {
.task-popup { .task-popup {
&__content { &__content {
margin-left: 0; @extend %null-fieldset;
margin-right: 0; @include popup-base-content(22.78%, 16px 18px 12px, $medium-purple, 20px);
border: none;
width: 22.78%;
border-radius: 20px;
background-color: $medium-purple;
padding: 16px 18px 12px;
text-align: left; text-align: left;
> * { > * {
...@@ -290,10 +222,7 @@ body { ...@@ -290,10 +222,7 @@ body {
.profile-popup { .profile-popup {
&__content { &__content {
padding: 25px; @include popup-base-content(35.69%, 25px, $white, 20px);
width: 35.69%;
background-color: $white;
border-radius: 20px;
} }
&__wrapper { &__wrapper {
...@@ -339,12 +268,10 @@ body { ...@@ -339,12 +268,10 @@ body {
} }
.profile-list { .profile-list {
margin-top: 0; @include null-ul(11px);
padding-left: 0;
list-style-type: none;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-bottom: 11px;
&__item { &__item {
font-size: 16px; font-size: 16px;
...@@ -371,10 +298,7 @@ body { ...@@ -371,10 +298,7 @@ body {
.stop-popup { .stop-popup {
&__content { &__content {
padding: 15px 26px 20px 21px; @include popup-base-content(22.78%, 15px 26px 20px 21px, $alice-blue, 20px);
width: 22.78%;
background-color: $alice-blue;
border-radius: 20px;
text-align: center; text-align: center;
} }
...@@ -394,20 +318,11 @@ body { ...@@ -394,20 +318,11 @@ body {
max-width: 108px; max-width: 108px;
margin: 0 auto; margin: 0 auto;
text-align: center; text-align: center;
font-weight: 700; @include lets-do-title(30px, 36px);
font-size: 30px;
line-height: 36px;
background: linear-gradient(266.66deg, $heliotrope 1.54%, $matisse 101.33%);
background-clip: text;
-webkit-background-clip: text;
color: transparent;
} }
&__question { &__question {
font-weight: 400; @include popup-question-template(16px, 19px, $matisse);
font-size: 16px;
line-height: 19px;
color: $matisse;
} }
&__buttons { &__buttons {
......
...@@ -9,6 +9,27 @@ ...@@ -9,6 +9,27 @@
flex: 1 1 auto; flex: 1 1 auto;
} }
%null-fieldset {
margin-left: 0;
margin-right: 0;
border: none;
}
@mixin null-ul($margin-bottom: 0, $margin-top: 0, $padding-left: 0, $list-style-type: none) {
margin-top: $margin-top;
margin-bottom: $margin-bottom;
padding-left: $padding-left;
list-style-type: $list-style-type;
}
@mixin fixed-header($z-index: 999) {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: $z-index;
}
@mixin _container($max-width, $side-padding) { @mixin _container($max-width, $side-padding) {
box-sizing: content-box; box-sizing: content-box;
margin: 0 auto; margin: 0 auto;
......
.popup {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: $transparent-dark-red;
opacity: 0;
visibility: hidden;
transition: all 0.8s ease 0s;
z-index: 999;
&__body {
min-height: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 30px 10px;
}
&__content {
text-align: right;
transition: all 0.8s ease 0s;
transform: perspective(600px) translate(0px, -100%) rotateX(45deg);
> * {
&.popup__close {
display: inline-block;
}
}
}
&.open {
opacity: 1;
visibility: visible;
}
&.open &__content {
transform: perspective(600px) translate(0px, 0%) rotateX(0deg);
}
}
%body-lock {
overflow: hidden;
}
@mixin popup-base-content($width, $padding, $background-color, $border-radius) {
width: $width;
padding: $padding;
background-color: $background-color;
border-radius: $border-radius;
}
@mixin lets-do-title(
$font-size,
$line-height,
$font-weight: 700,
$linear-gradient: linear-gradient(266.66deg, $heliotrope 1.54%, $matisse 101.33%)
) {
font-weight: $font-weight;
font-size: $font-size;
line-height: $line-height;
background: $linear-gradient;
background-clip: text;
-webkit-background-clip: text;
color: transparent;
}
@mixin popup-question-template(
$font-size,
$line-height,
$color,
$font-family: (Aleo, sans-serif),
$font-weight: 400
) {
font-size: $font-size;
line-height: $line-height;
color: $color;
font-family: $font-family;
font-weight: $font-weight;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment