Skip to content

Commit

Permalink
[Hexlet#1448] Page adaptation fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
canekg committed Jan 15, 2024
1 parent b51d69f commit 018c330
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 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
17 changes: 17 additions & 0 deletions resources/sass/_activity_chart.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@
grid-auto-flow: column;
grid-auto-columns: var(--square-size);
padding: 0;
overflow-x: auto;
}

.squares::-webkit-scrollbar {
width: 10px;
height: 8px;
}

.squares::-webkit-scrollbar-track {
-webkit-box-shadow: 5px 5px 5px -5px rgba(34, 60, 80, 0.2) inset;
background-color: #f9f9fd;
border-radius: 10px;
}

.squares::-webkit-scrollbar-thumb {
border-radius: 10px;
background: linear-gradient(180deg, #00c6fb, #005bea);
}

.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 018c330

Please sign in to comment.