Skip to content

Commit

Permalink
Merge pull request Hexlet#1609 from canekg/fixAdaptive
Browse files Browse the repository at this point in the history
[Hexlet#1448] Page adaptation fixed
  • Loading branch information
fey authored Jan 17, 2024
2 parents b51d69f + 1c97207 commit eb9416d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/Helpers/ChartHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function getChart(?int $userId = null): \Generator
return $group->count();
});

$chart = CarbonPeriod::create(now()->subMonths(24), '1 day', now())
$chart = CarbonPeriod::create(now()->subMonths(12), '1 day', now())
->map(function (Carbon $dayDate) use ($countActivitiesByDays): int {
$day = $dayDate->format('Y-m-d');
$dayActivitiesCount = $countActivitiesByDays->get($day, 0);
Expand Down
3 changes: 2 additions & 1 deletion resources/sass/_activity_chart.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
grid-template-rows: repeat(7, var(--square-size));
grid-auto-flow: column;
grid-auto-columns: var(--square-size);
padding: 0;
padding: 0 0 5px 0;
overflow-x: auto;
}

.graph {
Expand Down
9 changes: 8 additions & 1 deletion resources/sass/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@
.bg-light {
background-color: #343a40 !important;
}
}
}

@media (max-width: 576px) {
main.flex-grow-1 {
margin-left: 16px;
margin-right: 16px;
}
}
4 changes: 2 additions & 2 deletions resources/views/components/activity_chart.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="graph mt-4">
<div class="d-flex justify-content-end overflow-hidden m-4">
<div class="container graph mt-4">
<div class="d-flex justify-content-center overflow-hidden m-4">
<ul class="squares mb-0">
@foreach ($chart as $square)
<li data-level="{{ $square }}"></li>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/home/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
</a>
</li>
</ul>
<div class="container mt-2">
<div class="row text-center">
<div class="container m-0 p-0 mt-2">
<div class="row m-0 p-0 text-center">
<div class="col mt-4">
<p>{{ __('welcome.statistic.table.count_points') }}:</p>
<h3>{{ $statisticTable['countPoints'] }}</h3>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@include('layouts._nav')
@include('flash::message')
@hasSection('content')
<main class='flex-grow-1 m-0'>
<main class='flex-grow-1'>
<div class="container p-0">
@yield('content')
</div>
Expand Down

0 comments on commit eb9416d

Please sign in to comment.