wip animate dezimalstellen

This commit is contained in:
salam committed 2026-08-30 19:05:31 +02:00
1 parent 14c571a77a
commit 7876c7ab3f
3 files changed
+25 -39

No files matched your search

+11 -6
View File
@@ -148,6 +148,10 @@ class StatsMedianAverage extends StatsOverviewWidget
}
}
// i box 1 3 4 5 devono sempre avere 1 decimale, se il valore è 12 fai scrivere 12.0
// il box 2 sempre un numero intero
// il box 6 sempre a due decimali, se trovi 2 fai scrivere 2.00
$boxes = [];
if ($similar_past_matches != 'none') {
@@ -163,7 +167,7 @@ class StatsMedianAverage extends StatsOverviewWidget
$boxes[] = Stat::make('Average '.$statistic_type, self::template_box3('Home', 'Away', $value_home, $value_away))
->description('Team '.$team_position)
->extraAttributes([
'x-init' => "animate('average_home', $value_home); animate('average_away', $value_away)",
'x-init' => "animate('average_home', $value_home, 1); animate('average_away', $value_away, 1)",
'class' => 'box-success',
]);
// BOX 6
@@ -179,7 +183,7 @@ class StatsMedianAverage extends StatsOverviewWidget
$boxes[] = Stat::make($statistic_type, self::template_box1($expectations_home, $expectations_away))
->description('Expected Values')
->extraAttributes([
'x-init' => "animate('expectations_home', $expectations_home); animate('expectations_away', $expectations_away)",
'x-init' => "animate('expectations_home', $expectations_home, 1); animate('expectations_away', $expectations_away, 1)",
'class' => 'box-yellow',
]);
@@ -197,7 +201,7 @@ class StatsMedianAverage extends StatsOverviewWidget
$boxes[] = Stat::make('Average '.$statistic_type, self::template_box3($home_team, $away_team, $value_home, $value_away))
->description('Team '.$team_position)
->extraAttributes([
'x-init' => "animate('average_home', $value_home); animate('average_away', $value_away)",
'x-init' => "animate('average_home', $value_home, 1); animate('average_away', $value_away, 1)",
'class' => 'box-success',
]);
@@ -205,7 +209,7 @@ class StatsMedianAverage extends StatsOverviewWidget
$boxes[] = Stat::make('Average '.$statistic_type, self::template_box4($home_team, $away_team, $average_team_home, $average_team_away))
->description('Team Season')
->extraAttributes([
'x-init' => "animate('av_team_home', $average_team_home); animate('av_team_away', $average_team_away)",
'x-init' => "animate('av_team_home', $average_team_home, 1); animate('av_team_away', $average_team_away, 1)",
'class' => 'box-success',
]);
@@ -213,7 +217,7 @@ class StatsMedianAverage extends StatsOverviewWidget
$boxes[] = Stat::make('Average '.$statistic_type, self::template_box5('Home', 'Away', $average_league_home, $average_league_away))
->description('League Season')
->extraAttributes([
'x-init' => "animate('av_league_home', $average_league_home); animate('av_league_away', $average_league_away)",
'x-init' => "animate('av_league_home', $average_league_home, 1); animate('av_league_away', $average_league_away, 1)",
'class' => 'box-success',
]);
@@ -221,7 +225,7 @@ class StatsMedianAverage extends StatsOverviewWidget
$boxes[] = Stat::make('Odds', self::templateOdds($data, $win, $draw, $lost))
->description($team_position)
->extraAttributes([
'x-init' => "animate('win', $win); animate('draw', $draw); animate('lost', $lost)",
'x-init' => "animate('win', $win, 2); animate('draw', $draw, 2); animate('lost', $lost, 2)",
'class' => 'box-purple',
]);
}
@@ -236,6 +240,7 @@ class StatsMedianAverage extends StatsOverviewWidget
return $boxes;
}
// TEAMPLATE BOX 1
protected function template_box1(float $expectations_home, float $expectations_away): HtmlString