From cf5397296262662e8319533366b3c7984912bec9 Mon Sep 17 00:00:00 2001 From: LabPetro Date: Mon, 24 Jul 2023 21:02:10 +0300 Subject: [PATCH] antisnake solution --- readme.md | 4 ++-- src/index.html | 27 ++++++++++++++--------- src/styles/blocks/container.scss | 37 ++++++++++++++++++++++++++++++++ src/styles/blocks/reset.scss | 7 ++++++ src/styles/main.scss | 6 +++--- src/styles/utils/_variables.scss | 1 + 6 files changed, 67 insertions(+), 15 deletions(-) create mode 100644 src/styles/blocks/container.scss create mode 100644 src/styles/blocks/reset.scss create mode 100644 src/styles/utils/_variables.scss diff --git a/readme.md b/readme.md index d68d05d4a..14756a8fd 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ # Antisnake Replace `` with your Github username and copy the links to Pull Request description: -- [DEMO LINK](https://.github.io/layout_antisnake/) -- [TEST REPORT LINK](https://.github.io/layout_antisnake/report/html_report/) +- [DEMO LINK](https://LabPetro.github.io/layout_antisnake/) +- [TEST REPORT LINK](https://LabPetro.github.io/layout_antisnake/report/html_report/) > Follow [this instructions](https://github.com/mate-academy/layout_task-guideline#how-to-solve-the-layout-tasks-on-github) ___ diff --git a/src/index.html b/src/index.html index e8ae736a0..39667de4e 100644 --- a/src/index.html +++ b/src/index.html @@ -1,13 +1,20 @@ - - - - - Antisnake - - - -

Antisnake

- + + + + + Antisnake + + + +
+
1
+
2
+
3
+
4
+
5
+
6
+
+ diff --git a/src/styles/blocks/container.scss b/src/styles/blocks/container.scss new file mode 100644 index 000000000..e530c0757 --- /dev/null +++ b/src/styles/blocks/container.scss @@ -0,0 +1,37 @@ +.container { + width: 100%; + display: grid; + justify-content: center; + + @media screen and (min-width: $box-size) { + grid-template-columns: repeat(1, 1fr); + } + + @media screen and (min-width: 600px) { + grid-template-columns: repeat(2, 1fr); + } + + @media screen and (min-width: 900px) { + grid-template-columns: repeat(3, 1fr); + } + + &__block { + display: grid; + min-width: $box-size; + height: $box-size; + justify-items: center; + align-items: center; + color: #fff; + font-family: Arial, Helvetica, sans-serif; + font-size: 100px; + + @for $i from 0 through 5 { + $red-factor: 100% - (20% * $i); + $color: rgb($red-factor, 0%, 0%); + + &--box#{$i + 1} { + background-color: $color; + } + } + } +} diff --git a/src/styles/blocks/reset.scss b/src/styles/blocks/reset.scss new file mode 100644 index 000000000..abe6d10c2 --- /dev/null +++ b/src/styles/blocks/reset.scss @@ -0,0 +1,7 @@ +* { + box-sizing: border-box; +} + +body { + margin: 0; +} diff --git a/src/styles/main.scss b/src/styles/main.scss index 293d3b1f1..b64fe4e2f 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -1,3 +1,3 @@ -body { - margin: 0; -} +@import "./utils/variables"; +@import "./blocks/reset.scss"; +@import "./blocks/container.scss"; diff --git a/src/styles/utils/_variables.scss b/src/styles/utils/_variables.scss new file mode 100644 index 000000000..92e061548 --- /dev/null +++ b/src/styles/utils/_variables.scss @@ -0,0 +1 @@ +$box-size: 300px;