diff --git a/src/index.html b/src/index.html index c10199d38..2c793f8dd 100644 --- a/src/index.html +++ b/src/index.html @@ -13,6 +13,38 @@ /> -

Calendar

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/styles/index.scss b/src/styles/index.scss deleted file mode 100644 index 293d3b1f1..000000000 --- a/src/styles/index.scss +++ /dev/null @@ -1,3 +0,0 @@ -body { - margin: 0; -} diff --git a/src/styles/main.scss b/src/styles/main.scss new file mode 100644 index 000000000..4b779138e --- /dev/null +++ b/src/styles/main.scss @@ -0,0 +1,67 @@ +$cell-size: 100px; +$gap: 1px; +$days: ( + 'mon': 0, + 'tue': 1, + 'wed': 2, + 'thu': 3, + 'fri': 4, + 'sat': 5, + 'sun': 6, +); + +html { + font-family: Arial, Helvetica, sans-serif; + font-size: 30px; +} + +body { + margin: 0; + height: 100vh; + display: flex; + justify-content: center; + align-items: center; +} + +.calendar { + display: flex; + flex-wrap: wrap; + gap: 1px; + padding: 10px; + width: calc($cell-size * 7 + $gap * 6); + + &__day { + box-sizing: border-box; + display: flex; + width: 100px; + height: 100px; + border: 1px solid black; + background-color: #eee; + justify-content: center; + align-items: center; + transition-duration: 0.5s; + &:hover { + cursor: pointer; + background-color: #ffbfcb; + transform: translateY(-20px); + } + } +} + +@for $i from 1 through 31 { + .calendar__day:nth-child(n + #{$i})::before { + content: '#{$i}'; + } +} + +@for $i from 28 through 31 { + .calendar--month-length-#{$i} .calendar__day:nth-child(n + #{$i + 1}) { + display: none; + } +} + +@each $day, $i in $days { + .calendar--start-day-#{$day} .calendar__day:first-child { + margin-left: calc(#{$i} * $cell-size + #{$i * $gap}); + } +}