diff --git a/.github/workflows/test.yml-template b/.github/workflows/test.yml-template new file mode 100644 index 000000000..8b5743ecb --- /dev/null +++ b/.github/workflows/test.yml-template @@ -0,0 +1,29 @@ +name: Test + +on: + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test + - name: Upload HTML report(backstop data) + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + name: report + path: backstop_data diff --git a/README.md b/README.md index 37cba2aad..3c73cd437 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs ❗️ Replace `` with your Github username and copy the links to `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_calendar/) -- [TEST REPORT LINK](https://.github.io/layout_calendar/report/html_report/) +- [DEMO LINK](https://maponomarenko.github.io/layout_calendar/) +- [TEST REPORT LINK](https://maponomarenko.github.io/layout_calendar/report/html_report/) ❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it. diff --git a/package-lock.json b/package-lock.json index 08a8b9f22..cfc7c3796 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@mate-academy/backstop-config": "latest", "@mate-academy/bemlint": "latest", "@mate-academy/linthtml-config": "latest", - "@mate-academy/scripts": "^1.8.6", + "@mate-academy/scripts": "^1.9.12", "@mate-academy/stylelint-config": "latest", "@parcel/transformer-sass": "^2.12.0", "backstopjs": "6.3.23", @@ -1212,10 +1212,11 @@ "dev": true }, "node_modules/@mate-academy/scripts": { - "version": "1.8.6", - "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.8.6.tgz", - "integrity": "sha512-b4om/whj4G9emyi84ORE3FRZzCRwRIesr8tJHXa8EvJdOaAPDpzcJ8A0sFfMsWH9NUOVmOwkBtOXDu5eZZ00Ig==", + "version": "1.9.12", + "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.9.12.tgz", + "integrity": "sha512-/OcmxMa34lYLFlGx7Ig926W1U1qjrnXbjFJ2TzUcDaLmED+A5se652NcWwGOidXRuMAOYLPU2jNYBEkKyXrFJA==", "dev": true, + "license": "MIT", "dependencies": { "@octokit/rest": "^17.11.2", "@types/get-port": "^4.2.0", diff --git a/package.json b/package.json index 8ba3c0562..5691b66ca 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@mate-academy/backstop-config": "latest", "@mate-academy/bemlint": "latest", "@mate-academy/linthtml-config": "latest", - "@mate-academy/scripts": "^1.8.6", + "@mate-academy/scripts": "^1.9.12", "@mate-academy/stylelint-config": "latest", "@parcel/transformer-sass": "^2.12.0", "backstopjs": "6.3.23", diff --git a/src/index.html b/src/index.html index c10199d38..a78161baf 100644 --- a/src/index.html +++ b/src/index.html @@ -12,7 +12,41 @@ href="styles/index.scss" /> - -

Calendar

+ + +
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
+ diff --git a/src/styles/blocks/calendar.scss b/src/styles/blocks/calendar.scss new file mode 100644 index 000000000..6b704cc39 --- /dev/null +++ b/src/styles/blocks/calendar.scss @@ -0,0 +1,55 @@ +.page { + margin: 0; + display: flex; + flex-direction: row; + justify-content: space-between; +} + +.calendar { + display: flex; + flex-wrap: wrap; + width: $calendar-width; + padding: 0; + margin: auto; + gap: $gap; + + &__day { + box-sizing: border-box; + width: $day-size; + height: $day-size; + background-color: $day-color; + border: $day-border; + display: flex; + justify-content: center; + align-items: center; + font-family: Arial, sans-serif; + font-size: $font-size; + position: relative; + + &:hover { + background-color: #FFBFCB; + transform: translate(0, -20px); + } + + @for $i from 1 through 31 { + &:nth-child(#{$i}) { + &::before { + content: "#{$i}"; + } + } + } + } + + @each $day, $number in $weekdays { + &__start-day--#{$day}> :first-child { + margin-left: (($number - 1) * $day-size) + ($number - 1) * $gap; + + } + } + + @for $length from 28 through 31 { + &__month-length--#{$length}> :nth-child(n + #{$length + 1}) { + display: none; + } + } +} \ No newline at end of file diff --git a/src/styles/blocks/variables.scss b/src/styles/blocks/variables.scss new file mode 100644 index 000000000..5165ebc1c --- /dev/null +++ b/src/styles/blocks/variables.scss @@ -0,0 +1,15 @@ +$day-size: 100px; +$day-color: #eee; +$day-border: 1px solid #000; +$font-size: 30px; +$gap: 1px; +$calendar-width: 7 * $day-size + 6 * $gap; +$weekdays: ( + 'mon' 1, + 'tue' 2, + 'wed' 3, + 'thu' 4, + 'fri' 5, + 'sat' 6, + 'sun' 7 +); \ No newline at end of file diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f1..01270e924 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,2 @@ -body { - margin: 0; -} +@import './blocks/variables'; +@import './blocks/calendar'; \ No newline at end of file