Skip to content

Commit

Permalink
💄 General day stats with RTSP layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Heroyt committed May 7, 2024
1 parent a94feaa commit 016598a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 2 additions & 4 deletions assets/scss/gate/todayStatsRtsp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
align-content: center;
font-size: 1.55rem;
grid-row-gap: 1rem;
grid-template-areas: 'logo title streams' '. score streams' '. best streams' '. . streams';
grid-template-areas: 'logo streams title' '. streams score' '. streams score' '. streams best';
grid-template-columns: 22rem 1fr 35rem;
grid-template-rows: 5rem 1fr 1fr 1fr 3rem;

.streams {
align-content: center;
display: grid;
grid-area: streams;
grid-gap: 1rem;
grid-template-columns: 1fr;
height: 100%;
width: 100%;

Expand All @@ -40,7 +38,7 @@
display: flex;
flex-direction: column;
grid-area: score;
justify-content: space-between;
justify-content: space-evenly;
justify-self: stretch;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ public function run() : ResponseInterface {
'settings' => $this->getSettings(),
'screenHash' => $generalStatsHash,
'widgets' => [
'generalStats' => [
'data' => $generalStatsData,
'template' => $this->generalStats->getTemplate(),
],
'generalStats' => $generalStatsData,
],
'addJs' => ['gate/todayRtsp.js'],
'addCss' => ['gate/todayStatsRtsp.css'],
Expand Down
5 changes: 4 additions & 1 deletion templates/gate/screens/generalDayStatsRtsp.latte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

{varType App\Gate\Settings\RtspSettings $settings}
{var int $maxStreams = min($settings->maxStreams, count($settings->streams))}
{var int $columns = $maxStreams < 3 ? 1 : 2}
{var int $rows = ceil($maxStreams / $columns)}

{define containerClasses}
today-rtsp
Expand All @@ -16,7 +18,8 @@
<h1 class="title text-center text-white-forced">{lang 'Výsledky dne', context: 'gate'}</h1>

<div class="streams" data-max-streams="{$maxStreams}"
data-streams="{json_encode($settings->streams)}" style="grid-template-rows: repeat({$maxStreams}, 1fr);">
data-streams="{json_encode($settings->streams)}"
style="grid-template-columns: repeat({$columns}, 1fr); grid-template-rows: repeat({$rows}, 1fr);">
<video n:for="$i = 0; $i < $maxStreams; $i++"
data-index="{$i}"
class="stream"
Expand Down
4 changes: 3 additions & 1 deletion templates/gate/screens/todayHighlightsRtsp.latte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
{varType App\Gate\Settings\RtspSettings $settings}

{var int $maxStreams = min($settings->maxStreams, count($settings->streams))}
{var int $columns = $maxStreams < 3 ? 1 : 2}
{var int $rows = ceil($maxStreams / $columns)}

{define containerClasses}
today-highlights-rtsp
Expand All @@ -19,7 +21,7 @@

<div class="streams" data-max-streams="{$maxStreams}"
data-streams="{json_encode($settings->streams)}"
style="grid-template-columns: repeat({$maxStreams < 3 ? 1 : 2}, 1fr);">
style="grid-template-columns: repeat({$columns}, 1fr); grid-template-rows: repeat({$rows}, 1fr);">
<video n:for="$i = 0; $i < $maxStreams; $i++"
data-index="{$i}"
class="stream"
Expand Down
2 changes: 1 addition & 1 deletion templates/gate/widgets/generalStats.latte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
App\GameModels\Game\Player|null $topShots,
}

<div class="score d-flex flex-column justify-content-between align-items-stretch">
<div class="score d-flex flex-column">
<div class="d-flex flex-column shadow">
<div class="bg-blue-800 text-white-forced text-center rounded-top-10 py-3 fw-bold">
{svgIcon 'star', '', '2rem'}
Expand Down

0 comments on commit 016598a

Please sign in to comment.