This commit is contained in:
salam committed 2026-06-05 12:34:24 +02:00
1 parent d954a9fa5c
commit 4b4952bfec
16 files changed
+251 -340

No files matched your search

+1 -20
View File
@@ -50,24 +50,6 @@ class Statistic extends BaseDashboard
return '';
}
public function updatedFilter($value) // Or whatever your property name is
{
$this->dispatch('filterChanged', filterValue: $value);
}
// protected function getHeaderActions(): array
// {
// return [
// Action::make('collapseAll')
// ->label('Collapse All Charts')
// ->icon('heroicon-m-chevron-up')
// ->color('gray')
// ->action(function ($record, $livewire) {
// $livewire->dispatch('collapse-all-charts');
// }),
// ];
// }
public function filtersForm(Schema $schema): Schema
{
return $schema
@@ -94,7 +76,6 @@ class Statistic extends BaseDashboard
$set('match_id', null);
$set('team_id', null);
$set('tm_player_id', null);
$this->dispatch('filterChanged', filterValue: $state);
}),
Select::make('match_id')
->hiddenLabel()
@@ -198,7 +179,7 @@ class Statistic extends BaseDashboard
'ofs' => 'Offside',
'crd' => 'Cards',
'snt' => 'Shots On Target',
'tsh' => 'Total shots',
'tsh' => 'Total Shots',
]),
Select::make('similar_past_matches')
->hiddenLabel()
@@ -7,11 +7,11 @@ class HelperStatisticType
protected static array $types = [
'gls' => 'Goals',
'crn' => 'Corner',
'fls' => 'Fouls Commited',
'fls' => 'Fouls',
'ofs' => 'Offside',
'crd' => 'Cards',
'snt' => 'Shots On Target',
'tsh' => 'Total shots',
'snt' => 'S on T',
'tsh' => 'Shots',
];
public static function get($filter): string
@@ -228,6 +228,10 @@ class LoadPerformance
public static function shortenEnding(array &$labels, array &$homes, array &$aways)
{
if (! isset($homes['all'])) {
return;
}
$count_home = 0;
$count_away = 0;
for ($i = \count($homes['all']) - 1; $i > 0; $i--) {
+29 -61
View File
@@ -7,6 +7,7 @@ use App\Filament\Widgets\Data\LoadEvents;
use App\Utilities\Round;
use Filament\Widgets\StatsOverviewWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;
use Illuminate\Support\HtmlString;
use Livewire\Attributes\Reactive;
class StatsMedianAverage extends StatsOverviewWidget
@@ -18,6 +19,8 @@ class StatsMedianAverage extends StatsOverviewWidget
#[Reactive]
public ?array $filters = [];
public ?int $count;
public function mount(array $filters)
{
$this->filters = $filters;
@@ -36,7 +39,7 @@ class StatsMedianAverage extends StatsOverviewWidget
'lg' => 6,
];
$statistic_type = ucfirst(HelperStatisticType::get($this->filters));
$statistic_type = HelperStatisticType::get($this->filters);
if (! isset($data['datasets'][0])) {
$data['datasets'][0]['data'] = [];
@@ -60,36 +63,12 @@ class StatsMedianAverage extends StatsOverviewWidget
if (! $total_home) {
return [
Stat::make('stat1', 'stat1')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Number of events',
'value' => '0',
]),
Stat::make('stat2', 'stat2')->view('filament.resources.events.widgets.statistic-average', [
'titel' => 'Average '.$statistic_type,
'value1' => 0,
'value2' => 0,
'home' => $home_team,
'away' => $away_team,
]),
Stat::make('stat3', 'stat3')->view('filament.resources.events.widgets.statistic-average', [
'titel' => 'Median '.$statistic_type,
'value1' => 0,
'value2' => 0,
'home' => $home_team,
'away' => $away_team,
]),
Stat::make('stat4', 'stat4')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Win',
'value' => 0,
]),
Stat::make('stat5', 'stat5')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Draw',
'value' => 0,
]),
Stat::make('stat6', 'stat6')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Lost',
'value' => 0,
]),
Stat::make('Number of events', 0),
Stat::make('Average '.$statistic_type, self::template(0, 0, $home_team, $away_team)),
Stat::make('Median '.$statistic_type, self::template(0, 0, $home_team, $away_team)),
Stat::make('Win', 0),
Stat::make('Draw', 0),
Stat::make('Lost', 0),
];
}
@@ -119,37 +98,26 @@ class StatsMedianAverage extends StatsOverviewWidget
$draw = $data['results']['d'] ? number_format(Round::odd($total_home / $data['results']['d']), 2) : 0;
$lost = $data['results']['l'] ? number_format(Round::odd($total_home / $data['results']['l']), 2) : 0;
$value_home = number_format($summe_home / $total_home, 1);
$value_away = number_format($summe_away / $total_away, 1);
return [
Stat::make('stat1', 'stat1')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => 'Number of events',
'value' => $total_home,
]),
Stat::make('stat2', 'stat2')->view('filament.resources.events.widgets.statistic-average', [
'titel' => 'Average '.$statistic_type,
'value1' => number_format($summe_home / $total_home, 1),
'value2' => number_format($summe_away / $total_away, 1),
'home' => $home_team,
'away' => $away_team,
]),
Stat::make('stat3', 'stat3')->view('filament.resources.events.widgets.statistic-average', [
'titel' => 'Median '.$statistic_type,
'value1' => $median_home,
'value2' => $median_away,
'home' => $home_team,
'away' => $away_team,
]),
Stat::make('stat4', 'stat4')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => ($data['similar_past_matches'] != 'none') ? 'Win' : 'Win: '.$data['results']['w'],
'value' => $win,
]),
Stat::make('stat5', 'stat5')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => ($data['similar_past_matches'] != 'none') ? 'Draw' : 'Draw: '.$data['results']['d'],
'value' => $draw,
]),
Stat::make('stat6', 'stat6')->view('filament.resources.events.widgets.statistic-regular', [
'titel' => ($data['similar_past_matches'] != 'none') ? 'Lost' : 'Lost: '.$data['results']['l'],
'value' => $lost,
]),
Stat::make('Number of events', new HtmlString('<div id="number-of-events">'.$total_home.'</div>'))->extraAttributes(['x-init' => "animate('number-of-events', $total_home)"]),
Stat::make('Average '.$statistic_type, self::template('avhome', 'avaway', $home_team, $away_team))->extraAttributes(['x-init' => "animate('avhome', $value_home); animate('avaway', $value_away)"]),
Stat::make('Median '.$statistic_type, self::template('mehome', 'meaway', $home_team, $away_team))->extraAttributes(['x-init' => "animate('mehome', $median_home); animate('meaway', $median_away)"]),
Stat::make($data['similar_past_matches'] != 'none' ? 'Win' : 'Win: '.$data['results']['w'], new HtmlString('<div id="number-of-win">'.$win.'</div>'))->extraAttributes(['x-init' => "animate('number-of-win', $win)"]),
Stat::make($data['similar_past_matches'] != 'none' ? 'Draw' : 'Draw: '.$data['results']['d'], new HtmlString('<div id="number-of-draw">'.$draw.'</div>'))->extraAttributes(['x-init' => "animate('number-of-draw', $draw)"]),
Stat::make($data['similar_past_matches'] != 'none' ? 'Lost' : 'Lost: '.$data['results']['l'], new HtmlString('<div id="number-of-lost">'.$lost.'</div>'))->extraAttributes(['x-init' => "animate('number-of-lost', $lost)"]),
];
}
protected function template(string $home_id, string $away_id, string $home_name, string $away_name): HtmlString
{
return new HtmlString('<div class="grid grid-cols-2 justify-center font-bold text-4xl">
<span class="text-center" id="'.$home_id.'"></span>
<span class="text-center" id="'.$away_id.'"></span>
<span class="text-center text-xs text-gray-500 dark:text-gray-400">'.$home_name.'</span>
<span class="text-center text-xs text-gray-500 dark:text-gray-400">'.$away_name.'</span>
</div>');
}
}
+2
View File
@@ -5,6 +5,7 @@ namespace App\Providers;
use App\Filament\Resources\Events\Pages\ListEvents;
use Carbon\Carbon;
use Filament\Support\Assets\Css;
use Filament\Support\Assets\Js;
use Filament\Support\Colors\Color;
use Filament\Support\Facades\FilamentAsset;
use Filament\Support\Facades\FilamentColor;
@@ -35,6 +36,7 @@ class AppServiceProvider extends ServiceProvider
FilamentAsset::register([
Css::make('font-stylesheet', __DIR__.'/../../resources/css/font.css'),
Js::make('number-animator', __DIR__.'/../../resources/js/number-animator.js'),
]);
FilamentView::registerRenderHook(
+122 -122
View File
@@ -507,9 +507,9 @@
}
},
"node_modules/@rollup/rollup-android-arm-eabi": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.60.4.tgz",
"integrity": "sha512-F5QXMSiFebS9hKZj02XhWLLnRpJ3B3AROP0tWbFBSj+6kCbg5m9j5JoHKd4mmSVy5mS/IMQloYgYxCuJC0fxEQ==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.61.1.tgz",
"integrity": "sha512-JnBB8MdXj45cajvTuO5FmPlvFVJRQgvrz1uSEl3NwqFnReAPGwb8EanbGi4z2nRaqLzjJSv5/JmycoTKlRZxHA==",
"cpu": [
"arm"
],
@@ -521,9 +521,9 @@
]
},
"node_modules/@rollup/rollup-android-arm64": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.60.4.tgz",
"integrity": "sha512-GxxTKApUpzRhof7poWvCJHRF51C67u1R7D6DiluBE8wKU1u5GWE8t+v81JvJYtbawoBFX1hLv5Ei4eVjkWokaw==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.61.1.tgz",
"integrity": "sha512-Jx2g7iSjw4AOT0HDPHM9RV3GNjRXwybWtSFZiZAYUTjUwjVrYIwq3kBf+LnhqJlzXFAqTAh2F7IGI+O568exPw==",
"cpu": [
"arm64"
],
@@ -535,9 +535,9 @@
]
},
"node_modules/@rollup/rollup-darwin-arm64": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.60.4.tgz",
"integrity": "sha512-tua0TaJxMOB1R0V0RS1jFZ/RpURFDJIOR2A6jWwQeawuFyS4gBW+rntLRaQd0EQ4bd6Vp44Z2rXW+YYDBsj6IA==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.61.1.tgz",
"integrity": "sha512-0F1L/Z3Eqv8mT2n3dCpeO8GcTvHvVqkP5/t6DMsn0KzhYVcg+s7Ncl5DS8qjKYEeio6Az0Gt6nyBORay5qIlCA==",
"cpu": [
"arm64"
],
@@ -549,9 +549,9 @@
]
},
"node_modules/@rollup/rollup-darwin-x64": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.60.4.tgz",
"integrity": "sha512-CSKq7MsP+5PFIcydhAiR1K0UhEI1A2jWXVKHPCBZ151yOutENwvnPocgVHkivu2kviURtCEB6zUQw0vs8RrhMg==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.61.1.tgz",
"integrity": "sha512-qLttcH871ujY4YcVfUSShhOw+CsoTatYz8gRbHO7Bb92QH059/P0y5do1KMs41fY0BpD2x4AJH/gID0zFiqVKQ==",
"cpu": [
"x64"
],
@@ -563,9 +563,9 @@
]
},
"node_modules/@rollup/rollup-freebsd-arm64": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.60.4.tgz",
"integrity": "sha512-+O8OkVdyvXMtJEciu2wS/pzm1IxntEEQx3z5TAVy4l32G0etZn+RsA48ARRrFm6Ri8fvqPQfgrvNxSjKAbnd3g==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.61.1.tgz",
"integrity": "sha512-fUI4RapGE0Oh3mb8mgfvC1O2nU1RpDZUKnDQm3xB1Ipg7C2wTs5Kstz7G2uWK99a8S2yTMq8/P4uycwNa0nJyw==",
"cpu": [
"arm64"
],
@@ -577,9 +577,9 @@
]
},
"node_modules/@rollup/rollup-freebsd-x64": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.60.4.tgz",
"integrity": "sha512-Iw3oMskH3AfNuhU0MSN7vNbdi4me/NiYo2azqPz/Le16zHSa+3RRmliCMWWQmh4lcndccU40xcJuTYJZxNo/lw==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.61.1.tgz",
"integrity": "sha512-H5YrdvJaDtI/U9/emrD4b++xkvp3y/JvOe4rizHbxvkyMfRS/CiRYdji+Pl8D0brEaNFWUh1drQxgAGIl6Xudw==",
"cpu": [
"x64"
],
@@ -591,9 +591,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.60.4.tgz",
"integrity": "sha512-EIPRXTVQpHyF8WOo219AD2yEltPehLTcTMz2fn6JsatLYSzQf00hj3rulF+yauOlF9/FtM2WpkT/hJh/KJFGhA==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.61.1.tgz",
"integrity": "sha512-Q8CBCCQtDFrYtXoeUXSrnFXKOnyUhx6bz+SkL6A0E7V8kAiCJ5pamq1WtbfpVGhR5TSpXY6ak3avmDc5fHTyJA==",
"cpu": [
"arm"
],
@@ -608,9 +608,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.60.4.tgz",
"integrity": "sha512-J3Yh9PzzF1Ovah2At+lHiGQdsYgArxBbXv/zHfSyaiFQEqvNv7DcW98pCrmdjCZBrqBiKrKKe2V+aaSGWuBe/w==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.61.1.tgz",
"integrity": "sha512-nwnhk1581l0FBVellGcVCAT0Oi06onEA3WB53sf01VO3I0UPBkMH9sXONYME2K0ovXcNayJfNtHfm6mpJElatQ==",
"cpu": [
"arm"
],
@@ -625,9 +625,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-gnu": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.60.4.tgz",
"integrity": "sha512-BFDEZMYfUvLn37ONE1yMBojPxnMlTFsdyNoqncT0qFq1mAfllL+ATMMJd8TeuVMiX84s1KbcxcZbXInmcO2mRg==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.61.1.tgz",
"integrity": "sha512-x5Xr49hwt3hdW75UOZm3395YwwzPyauktslv29KpWL/T+vVAzoT3azLcTWv0eMciBNrx+DYjH4paehHoLpPvpg==",
"cpu": [
"arm64"
],
@@ -642,9 +642,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-musl": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.60.4.tgz",
"integrity": "sha512-pc9EYOSlOgdQ2uPl1o9PF6/kLSgaUosia7gOuS8mB69IxJvlclko1MECXysjs5ryez1/5zjYqx3+xYU0TU6R1A==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.61.1.tgz",
"integrity": "sha512-unMS3H73DpaoPyyEVPjGKleM/s0mkmsauTENpw4INQY8y4+IuLNjkueQ5QCtC0D3N38Y38yhAU8OoZ20S2Tm6w==",
"cpu": [
"arm64"
],
@@ -659,9 +659,9 @@
]
},
"node_modules/@rollup/rollup-linux-loong64-gnu": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.60.4.tgz",
"integrity": "sha512-NxnomyxYerDh5n4iLrNa+sH+Z+U4BMEE46V2PgQ/hoB909i8gV1M5wPojWg9fk1jWpO3IQnOs20K4wyZuFLEFQ==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.61.1.tgz",
"integrity": "sha512-zNZzGRnAhwjFEYmvphJRV5XaQGjs62cCmeYYHUT//NbvEnHauw+I85nGG+SiVg5ld4GX8D1IbKIX+ozITQnhMQ==",
"cpu": [
"loong64"
],
@@ -676,9 +676,9 @@
]
},
"node_modules/@rollup/rollup-linux-loong64-musl": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.60.4.tgz",
"integrity": "sha512-nbJnQ8a3z1mtmrwImCYhc6BGpThAyYVRQxw9uKSKG4wR6aAYno9sVjJ0zaZcW9BPJX1GbrDPf+SvdWjgTuDmnw==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.61.1.tgz",
"integrity": "sha512-LdpWGL8X209B2SIvWjqlc8VZgM6PKfontSerGepuldQmHYrAOtnMCXeJkxXGbC+PPZVOuu5czJo7fNV6aeW8rQ==",
"cpu": [
"loong64"
],
@@ -693,9 +693,9 @@
]
},
"node_modules/@rollup/rollup-linux-ppc64-gnu": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.60.4.tgz",
"integrity": "sha512-2EU6acNrQLd8tYvo/LXW535wupT3m6fo7HKo6lr7ktQoItxTyOL1ZCR/GfGCuXl2vR+zmfI6eRXkSemafv+iVg==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.61.1.tgz",
"integrity": "sha512-EC5kTtNaNGOmbMGqar8dvJy6y/hg99GAwjfBz++pxZhQATXGcRjd6c5en5wcbru0vkRmiMGsQKdMJOOf6sza4g==",
"cpu": [
"ppc64"
],
@@ -710,9 +710,9 @@
]
},
"node_modules/@rollup/rollup-linux-ppc64-musl": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.60.4.tgz",
"integrity": "sha512-WeBtoMuaMxiiIrO2IYP3xs6GMWkJP2C0EoT8beTLkUPmzV1i/UcOSVw1d5r9KBODtHKilG5yFxsGRnBbK3wJ4A==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.61.1.tgz",
"integrity": "sha512-8hiwp6D4acEcNK78I4rP0/XtS1sknWIAMJBPdR4l6zUtyTm5KiTDr5bXmWt4foY7nAN7AThDHgkLIEZOWKbzWw==",
"cpu": [
"ppc64"
],
@@ -727,9 +727,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.60.4.tgz",
"integrity": "sha512-FJHFfqpKUI3A10WrWKiFbBZ7yVbGT4q4B5o1qKFFojqpaYoh9LrQgqWCmmcxQzVSXYtyB5bzkXrYzlHTs21MYA==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.61.1.tgz",
"integrity": "sha512-10dh/h/BqA7DuMPWSxkR8uks18FRwnwOEqr5zOTEl+NOwP/OMzKX8OFR/Of9xxDA7D5qef1Nzar5WDD2kCCr1g==",
"cpu": [
"riscv64"
],
@@ -744,9 +744,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-musl": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.60.4.tgz",
"integrity": "sha512-mcEl6CUT5IAUmQf1m9FYSmVqCJlpQ8r8eyftFUHG8i9OhY7BkBXSUdnLH5DOf0wCOjcP9v/QO93zpmF1SptCCw==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.61.1.tgz",
"integrity": "sha512-YKJ5lg35DP17gcAOggnihe+APw9HLyj1Xn7gsmGumBJAUDa6NGXNixJzmkWLhcK9TOuuyQjdamzvJefkO7qHZQ==",
"cpu": [
"riscv64"
],
@@ -761,9 +761,9 @@
]
},
"node_modules/@rollup/rollup-linux-s390x-gnu": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.60.4.tgz",
"integrity": "sha512-ynt3JxVd2w2buzoKDWIyiV1pJW93xlQic1THVLXilz429oijRpSHivZAgp65KBu+cMcgf1eVVjdnTLvPxgCuoQ==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.61.1.tgz",
"integrity": "sha512-Mlil5G2Jj6a7B3LWGctg+XPL9vdXYuzCtNXfxOQ0nPjc2m6ueUktocPGH9bnAM0bNRKb/bAWTujUU7IJQdQA+g==",
"cpu": [
"s390x"
],
@@ -778,9 +778,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.60.4.tgz",
"integrity": "sha512-Boiz5+MsaROEWDf+GGEwF8VMHGhlUoQMtIPjOgA5fv4osupqTVnJteQNKJwUcnUog2G55jYXH7KZFFiJe0TEzQ==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.61.1.tgz",
"integrity": "sha512-bVWIOIk6pV01p4CdUbPP7CJ/434z+OooYjDuFcR+44N35YvKUC66G8MGnvcWx5mWKW3g61J+t74l3Kj15Kwn2Q==",
"cpu": [
"x64"
],
@@ -795,9 +795,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.60.4.tgz",
"integrity": "sha512-+qfSY27qIrFfI/Hom04KYFw3GKZSGU4lXus51wsb5EuySfFlWRwjkKWoE9emgRw/ukoT4Udsj4W/+xxG8VbPKg==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.61.1.tgz",
"integrity": "sha512-qy5pBvZbqNFheBz61R1rzsezjm0J7O2oNGoWtGoY89SZYLUfxAJTBAqDChqAIdB4rCiIbi9nF7yZ83GnNiLwSw==",
"cpu": [
"x64"
],
@@ -812,9 +812,9 @@
]
},
"node_modules/@rollup/rollup-openbsd-x64": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.60.4.tgz",
"integrity": "sha512-VpTfOPHgVXEBeeR8hZ2O0F3aSso+JDWqTWmTmzcQKted54IAdUVbxE+j/MVxUsKa8L20HJhv3vUezVPoquqWjA==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.61.1.tgz",
"integrity": "sha512-E83TXjI4zm0+5f2qO+UOudaCYIhYwpJ5jq6YCZNIZ+6CbfhKrkAGezeiASBL9ElxAxFsRS9ZhESv8mfnj6TKeg==",
"cpu": [
"x64"
],
@@ -826,9 +826,9 @@
]
},
"node_modules/@rollup/rollup-openharmony-arm64": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.60.4.tgz",
"integrity": "sha512-IPOsh5aRYuLv/nkU51X10Bf75Bsf6+gZdx1X+QP5QM6lIJFHHqbHLG0uJn/hWthzo13UAc2umiUorqZy3axoZg==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.61.1.tgz",
"integrity": "sha512-fbWnKqVkjrJN38vNe3ahkbk6iejS/3b0Nt7EEtPpE6RBacZcGXNKbzfHN3GUUlXOPghUg0j6XUGrtjX9z1sIvA==",
"cpu": [
"arm64"
],
@@ -840,9 +840,9 @@
]
},
"node_modules/@rollup/rollup-win32-arm64-msvc": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.60.4.tgz",
"integrity": "sha512-4QzE9E81OohJ/HKzHhsqU+zcYYojVOXlFMs1DdyMT6qXl/niOH7AVElmmEdUNHHS/oRkc++d5k6Vy85zFs0DEw==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.61.1.tgz",
"integrity": "sha512-ArMl38iVAbk0New1ogihQNY6iphLi4ZaRsa037gUzv5yeKPY8TD3Dmy4x2RNC1VztU/uqm+G+/RwFrSka3Oy2g==",
"cpu": [
"arm64"
],
@@ -854,9 +854,9 @@
]
},
"node_modules/@rollup/rollup-win32-ia32-msvc": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.60.4.tgz",
"integrity": "sha512-zTPgT1YuHHcd+Tmx7h8aml0FWFVelV5N54oHow9SLj+GfoDy/huQ+UV396N/C7KpMDMiPspRktzM1/0r1usYEA==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.61.1.tgz",
"integrity": "sha512-0mYtjHS9ucAbcATycCNK9IGBk/cCe/ma7EmSLGZdsxnOA8cjRIyU04wDpVAD9NiOfLUR9KTxdiO53uOkherqjQ==",
"cpu": [
"ia32"
],
@@ -868,9 +868,9 @@
]
},
"node_modules/@rollup/rollup-win32-x64-gnu": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.60.4.tgz",
"integrity": "sha512-DRS4G7mi9lJxqEDezIkKCaUIKCrLUUDCUaCsTPCi/rtqaC6D/jjwslMQyiDU50Ka0JKpeXeRBFBAXwArY52vBw==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.61.1.tgz",
"integrity": "sha512-gK1iCEPfpoSG9wfBihXxvBMi8ZfcWffYkEsC/Eih+iFENTaewvNcrEQ69lIOWYO5pePHKLHHO7nq5AILGO/HQQ==",
"cpu": [
"x64"
],
@@ -882,9 +882,9 @@
]
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.60.4.tgz",
"integrity": "sha512-QVTUovf40zgTqlFVrKA1uXMVvU2QWEFWfAH8Wdc48IxLvrJMQVMBRjuQyUpzZCDkakImib9eVazbWlC6ksWtJw==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.61.1.tgz",
"integrity": "sha512-X+zaP2x+j4RXGfbp/seSoRHWnPxzApilDszisZxbYH5C/jTxFhCtDNdPGZb9lJyYPs24wGxruPF7Y+sIXt9Gzw==",
"cpu": [
"x64"
],
@@ -1180,9 +1180,9 @@
}
},
"node_modules/@types/estree": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
"integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
"integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
"dev": true,
"license": "MIT"
},
@@ -1233,9 +1233,9 @@
"license": "MIT"
},
"node_modules/axios": {
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.16.1.tgz",
"integrity": "sha512-caYkukvroVPO8KrzuJEb50Hm07KwfBZPEC3VeFHTsqWHvKTsy54hjJz9BS/cdaypROE2rH6xvm9mHX4fgWkr3A==",
"version": "1.17.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.17.0.tgz",
"integrity": "sha512-J8SwNxprqqpbfenehxWYXE7CW+wM1BB4w3+N+g+/Wx40xM4rsLrfPmHHxSWIxJLYDgSY/HqlFPIYb2/S3rxafw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1423,9 +1423,9 @@
"license": "MIT"
},
"node_modules/enhanced-resolve": {
"version": "5.22.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.22.0.tgz",
"integrity": "sha512-xYcDWrpELkFzz9SpZ3PlI6Eu6eD93Yf0WLDRxikGhWJ3MAir2SNZTIVCVZqZ/NUyx8AdMc2gT9C0gPiw18kG+A==",
"version": "5.22.2",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.22.2.tgz",
"integrity": "sha512-0rxICaFZ7NQho/sHely2bvOPRP0Eu2B0NZ9zM54YvRvWMn7jfz3DmnOZDR9LlXDdDcqntAVc6Hfy4gr/tdH/Ag==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1727,9 +1727,9 @@
}
},
"node_modules/hasown": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz",
"integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==",
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
"integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2205,13 +2205,13 @@
}
},
"node_modules/rollup": {
"version": "4.60.4",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.4.tgz",
"integrity": "sha512-WHeFSbZYsPu3+bLoNRUuAO+wavNlocOPf3wSHTP7hcFKVnJeWsYlCDbr3mTS14FCizf9ccIxXA8sGL8zKeQN3g==",
"version": "4.61.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.61.1.tgz",
"integrity": "sha512-I4KW6iuRpuu2uHBLraZ1wNZe0DP7lnRha+VJ9tNaYVaVgKhW0aI3h4RYnoRPeql0flHm/Co55b7snEDcOfOJrA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/estree": "1.0.8"
"@types/estree": "1.0.9"
},
"bin": {
"rollup": "dist/bin/rollup"
@@ -2221,31 +2221,31 @@
"npm": ">=8.0.0"
},
"optionalDependencies": {
"@rollup/rollup-android-arm-eabi": "4.60.4",
"@rollup/rollup-android-arm64": "4.60.4",
"@rollup/rollup-darwin-arm64": "4.60.4",
"@rollup/rollup-darwin-x64": "4.60.4",
"@rollup/rollup-freebsd-arm64": "4.60.4",
"@rollup/rollup-freebsd-x64": "4.60.4",
"@rollup/rollup-linux-arm-gnueabihf": "4.60.4",
"@rollup/rollup-linux-arm-musleabihf": "4.60.4",
"@rollup/rollup-linux-arm64-gnu": "4.60.4",
"@rollup/rollup-linux-arm64-musl": "4.60.4",
"@rollup/rollup-linux-loong64-gnu": "4.60.4",
"@rollup/rollup-linux-loong64-musl": "4.60.4",
"@rollup/rollup-linux-ppc64-gnu": "4.60.4",
"@rollup/rollup-linux-ppc64-musl": "4.60.4",
"@rollup/rollup-linux-riscv64-gnu": "4.60.4",
"@rollup/rollup-linux-riscv64-musl": "4.60.4",
"@rollup/rollup-linux-s390x-gnu": "4.60.4",
"@rollup/rollup-linux-x64-gnu": "4.60.4",
"@rollup/rollup-linux-x64-musl": "4.60.4",
"@rollup/rollup-openbsd-x64": "4.60.4",
"@rollup/rollup-openharmony-arm64": "4.60.4",
"@rollup/rollup-win32-arm64-msvc": "4.60.4",
"@rollup/rollup-win32-ia32-msvc": "4.60.4",
"@rollup/rollup-win32-x64-gnu": "4.60.4",
"@rollup/rollup-win32-x64-msvc": "4.60.4",
"@rollup/rollup-android-arm-eabi": "4.61.1",
"@rollup/rollup-android-arm64": "4.61.1",
"@rollup/rollup-darwin-arm64": "4.61.1",
"@rollup/rollup-darwin-x64": "4.61.1",
"@rollup/rollup-freebsd-arm64": "4.61.1",
"@rollup/rollup-freebsd-x64": "4.61.1",
"@rollup/rollup-linux-arm-gnueabihf": "4.61.1",
"@rollup/rollup-linux-arm-musleabihf": "4.61.1",
"@rollup/rollup-linux-arm64-gnu": "4.61.1",
"@rollup/rollup-linux-arm64-musl": "4.61.1",
"@rollup/rollup-linux-loong64-gnu": "4.61.1",
"@rollup/rollup-linux-loong64-musl": "4.61.1",
"@rollup/rollup-linux-ppc64-gnu": "4.61.1",
"@rollup/rollup-linux-ppc64-musl": "4.61.1",
"@rollup/rollup-linux-riscv64-gnu": "4.61.1",
"@rollup/rollup-linux-riscv64-musl": "4.61.1",
"@rollup/rollup-linux-s390x-gnu": "4.61.1",
"@rollup/rollup-linux-x64-gnu": "4.61.1",
"@rollup/rollup-linux-x64-musl": "4.61.1",
"@rollup/rollup-openbsd-x64": "4.61.1",
"@rollup/rollup-openharmony-arm64": "4.61.1",
"@rollup/rollup-win32-arm64-msvc": "4.61.1",
"@rollup/rollup-win32-ia32-msvc": "4.61.1",
"@rollup/rollup-win32-x64-gnu": "4.61.1",
"@rollup/rollup-win32-x64-msvc": "4.61.1",
"fsevents": "~2.3.2"
}
},
@@ -2348,9 +2348,9 @@
}
},
"node_modules/tinyglobby": {
"version": "0.2.16",
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz",
"integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==",
"version": "0.2.17",
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
"integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2382,9 +2382,9 @@
"license": "0BSD"
},
"node_modules/vite": {
"version": "7.3.3",
"resolved": "https://registry.npmjs.org/vite/-/vite-7.3.3.tgz",
"integrity": "sha512-/4XH147Ui7OGTjg3HbdWe5arnZQSbfuRzdr9Ec7TQi5I7R+ir0Rlc9GIvD4v0XZurELqA035KVXJXpR61xhiTA==",
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/vite/-/vite-7.3.5.tgz",
"integrity": "sha512-KuOaNhcnGFN2zIPGA7wRmzF+lJA1sea7rHq17aiJ++9lzY1WWG6Jpwqwe1KNbRVPIqHmr8GLYx7jbrQcN/7/ww==",
"dev": true,
"license": "MIT",
"dependencies": {
+5
View File
@@ -14,5 +14,10 @@
"laravel-vite-plugin": "^2.0.0",
"tailwindcss": "^4.1.11",
"vite": "^7.0.4"
},
"allowScripts": {
"esbuild@0.25.12": true,
"esbuild@0.27.7": true,
"fsevents@2.3.3": true
}
}
+1
View File
@@ -0,0 +1 @@
var t=function(){return t=Object.assign||function(t){for(var i,e=1,s=arguments.length;e<s;e++)for(var n in i=arguments[e])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t},t.apply(this,arguments)},i=function(){function i(i,e,s){var n=this;this.endVal=e,this.options=s,this.version="2.10.0",this.defaults={startVal:0,decimalPlaces:0,duration:2,useEasing:!0,useGrouping:!0,useIndianSeparators:!1,smartEasingThreshold:999,smartEasingAmount:333,separator:",",decimal:".",prefix:"",suffix:"",autoAnimate:!1,autoAnimateDelay:200,autoAnimateOnce:!1},this.finalEndVal=null,this.useEasing=!0,this.countDown=!1,this.error="",this.startVal=0,this.paused=!0,this.once=!1,this.count=function(t){n.startTime||(n.startTime=t);var i=t-n.startTime;n.remaining=n.duration-i,n.useEasing?n.countDown?n.frameVal=n.startVal-n.easingFn(i,0,n.startVal-n.endVal,n.duration):n.frameVal=n.easingFn(i,n.startVal,n.endVal-n.startVal,n.duration):n.frameVal=n.startVal+(n.endVal-n.startVal)*(i/n.duration);var e=n.countDown?n.frameVal<n.endVal:n.frameVal>n.endVal;n.frameVal=e?n.endVal:n.frameVal,n.frameVal=Number(n.frameVal.toFixed(n.options.decimalPlaces)),n.printValue(n.frameVal),i<n.duration?n.rAF=requestAnimationFrame(n.count):null!==n.finalEndVal?n.update(n.finalEndVal):n.options.onCompleteCallback&&n.options.onCompleteCallback()},this.formatNumber=function(t){var i,e,s,a,o=t<0?"-":"";i=Math.abs(t).toFixed(n.options.decimalPlaces);var r=(i+="").split(".");if(e=r[0],s=r.length>1?n.options.decimal+r[1]:"",n.options.useGrouping){a="";for(var l=3,u=0,h=0,p=e.length;h<p;++h)n.options.useIndianSeparators&&4===h&&(l=2,u=1),0!==h&&u%l==0&&(a=n.options.separator+a),u++,a=e[p-h-1]+a;e=a}return n.options.numerals&&n.options.numerals.length&&(e=e.replace(/[0-9]/g,(function(t){return n.options.numerals[+t]})),s=s.replace(/[0-9]/g,(function(t){return n.options.numerals[+t]}))),o+n.options.prefix+e+s+n.options.suffix},this.easeOutExpo=function(t,i,e,s){return e*(1-Math.pow(2,-10*t/s))*1024/1023+i},this.options=t(t({},this.defaults),s),this.options.enableScrollSpy&&(this.options.autoAnimate=!0),void 0!==this.options.scrollSpyDelay&&(this.options.autoAnimateDelay=this.options.scrollSpyDelay),this.options.scrollSpyOnce&&(this.options.autoAnimateOnce=!0),this.formattingFn=this.options.formattingFn?this.options.formattingFn:this.formatNumber,this.easingFn=this.options.easingFn?this.options.easingFn:this.easeOutExpo,this.el="string"==typeof i?document.getElementById(i):i,e=null==e?this.parse(this.el.innerHTML):e,this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.endVal=this.validateValue(e),this.options.decimalPlaces=Math.max(this.options.decimalPlaces),this.resetDuration(),this.options.separator=String(this.options.separator),this.useEasing=this.options.useEasing,""===this.options.separator&&(this.options.useGrouping=!1),this.el?this.printValue(this.startVal):this.error="[CountUp] target is null or undefined","undefined"!=typeof window&&this.options.autoAnimate&&(this.error||"undefined"==typeof IntersectionObserver?this.error?console.error(this.error,i):console.error("IntersectionObserver is not supported by this browser"):this.setupObserver())}return i.prototype.setupObserver=function(){var t=this,e=i.observedElements.get(this.el);e&&e.unobserve(),i.observedElements.set(this.el,this),this.observer=new IntersectionObserver((function(i){for(var e=0,s=i;e<s.length;e++){var n=s[e];n.isIntersecting&&t.paused&&!t.once?(t.paused=!1,t.autoAnimateTimeout=setTimeout((function(){return t.start()}),t.options.autoAnimateDelay),t.options.autoAnimateOnce&&(t.once=!0,t.observer.disconnect())):n.isIntersecting||t.paused||(clearTimeout(t.autoAnimateTimeout),t.reset())}}),{threshold:0}),this.observer.observe(this.el)},i.prototype.unobserve=function(){var t;clearTimeout(this.autoAnimateTimeout),null===(t=this.observer)||void 0===t||t.disconnect(),i.observedElements.delete(this.el)},i.prototype.onDestroy=function(){clearTimeout(this.autoAnimateTimeout),cancelAnimationFrame(this.rAF),this.paused=!0,this.unobserve(),this.options.onCompleteCallback=null,this.options.onStartCallback=null},i.prototype.determineDirectionAndSmartEasing=function(){var t=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>t;var i=t-this.startVal;if(Math.abs(i)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=t;var e=this.countDown?1:-1;this.endVal=t+e*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=t,this.finalEndVal=null;null!==this.finalEndVal?this.useEasing=!1:this.useEasing=this.options.useEasing},i.prototype.start=function(t){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),t&&(this.options.onCompleteCallback=t),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},i.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,Line truncated
+32
View File
@@ -0,0 +1,32 @@
function animate(element, end, duration = 500) {
console.log(element, end);
var element = document.getElementById(element);
const startTime = performance.now();
// Cubic easing function: slows down at the start and end
const easeInOutCubic = (t) =>
t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
const updateCount = (currentTime) => {
const elapsedTime = currentTime - startTime;
let progress = elapsedTime / duration;
// Clamp progress to ensure it doesn't overshoot
if (progress > 1) progress = 1;
// Apply easing curve to progress
const easedProgress = easeInOutCubic(progress);
// Calculate current value and round to integer
const currentCount = Math.round(end * easedProgress * 100) / 100;
element.innerHTML = currentCount;
if (progress < 1) {
requestAnimationFrame(updateCount);
}
};
requestAnimationFrame(updateCount);
}
+4
View File
@@ -87,6 +87,10 @@ button[wire\:click="resetTableFiltersForm"] {
@apply p-2 border border-gray-200 shadow rounded-md cursor-pointer has-checked:bg-blue-50 has-checked:text-blue-900 dark:has-checked:bg-blue-950 dark:has-checked:text-blue-200
}
.fi-sc-component .fi-wi-stats-overview-stat {
@apply bg-green-50 dark:bg-green-900 border border-green-300 dark:border-green-700
}
/* #mapper_right .fi-dropdown-list-item,
#mapper_left .fi-dropdown-list-item {
padding: 2px;
@@ -1,4 +0,0 @@
import IntersectionFiller from './widget-chart-line-intersection-filler'
window.filamentChartJsPlugins ??= []
window.filamentChartJsPlugins.push(IntersectionFiller)
+32
View File
@@ -0,0 +1,32 @@
function animate(element, end, duration = 500) {
console.log(element, end);
var element = document.getElementById(element);
const startTime = performance.now();
// Cubic easing function: slows down at the start and end
const easeInOutCubic = (t) =>
t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
const updateCount = (currentTime) => {
const elapsedTime = currentTime - startTime;
let progress = elapsedTime / duration;
// Clamp progress to ensure it doesn't overshoot
if (progress > 1) progress = 1;
// Apply easing curve to progress
const easedProgress = easeInOutCubic(progress);
// Calculate current value and round to integer
const currentCount = Math.round(end * easedProgress * 100) / 100;
element.innerHTML = currentCount;
if (progress < 1) {
requestAnimationFrame(updateCount);
}
};
requestAnimationFrame(updateCount);
}
@@ -1,42 +0,0 @@
const fillPlugin = {
id: 'fillHigherValue',
beforeDatasetsDraw(chart) {
const { ctx } = chart;
const metaA = chart.getDatasetMeta(0); // Dataset A
const metaB = chart.getDatasetMeta(1); // Dataset B
ctx.save();
// Loop through your data points
for (let i = 0; i < metaA.data.length; i++) {
const pA = metaA.data[i];
const pB = metaB.data[i];
if (!pA || !pB) continue;
// Define your colors
const colorA = 'rgba(255, 99, 132, 0.4)'; // Color when Line A is higher
const colorB = 'rgba(54, 162, 235, 0.4)'; // Color when Line B is higher
// Determine which line is higher (remember canvas Y=0 is at the top)
if (pA.y < pB.y) {
ctx.fillStyle = colorA;
} else {
ctx.fillStyle = colorB;
}
// Draw the fill polygon segment between the two points
ctx.beginPath();
ctx.moveTo(pA.x, pA.y);
ctx.lineTo(pB.x, pB.y);
// If doing multiple segments, connect back to create a contiguous fill
if (metaA.data[i + 1] && metaB.data[i + 1]) {
ctx.lineTo(metaB.data[i + 1].x, metaB.data[i + 1].y);
ctx.lineTo(metaA.data[i + 1].x, metaA.data[i + 1].y);
}
ctx.closePath();
ctx.fill();
}
ctx.restore();
}
};
@@ -1,6 +1,10 @@
<div
class="h-full rounded-lg p-0 lg:py-2 grid grid-rows-3 gap-0 bg-green-50 dark:bg-green-900 border border-green-300 dark:border-green-700">
<span class="font-bold text-center">{{ $titel }}</span>
<span class="font-bold text-2xl text-center">{{ $value }}</span>
{{-- <x-filament::loading-indicator class="h-5 w-5" /> --}}
</div>
<div class="fi-sc-component">
<div class="fi-wi-stats-overview-stat grid grid-rows-2 gap-2">
<div class="fi-wi-stats-overview-stat-label-ctn">
<span class="fi-wi-stats-overview-stat-label">
{{ $titel }}
</span>
</div>
<div id="odometer" class="odometer fi-wi-stats-overview-stat-value">123</div>
</div>
</div>
@@ -1,76 +0,0 @@
@php
use Filament\Widgets\View\Components\ChartWidgetComponent;
use Illuminate\View\ComponentAttributeBag;
$color = $this->getColor();
$heading = $this->getHeading();
$description = $this->getDescription();
$filters = $this->getFilters();
$isCollapsible = $this->isCollapsible();
$type = $this->getType();
$maxHeight = $this->getMaxHeight();
$hasMaxHeight = filled($maxHeight) && $maxHeight !== '100%';
@endphp
{{-- <x-filament-widgets::widget x-data="{ isCollapsed: false }" x-on:collapse-all-charts.window="isCollapsed = true"> --}}
{{-- :collapsible="$this->isCollapsible()" x-bind:collapsed="isCollapsed" --}}
<x-filament-widgets::widget class="fi-wi-chart">
<x-filament::section :description="$description" :heading="$heading" :collapsible="$isCollapsible">
@if ($filters || method_exists($this, 'getFiltersSchema'))
<x-slot name="afterHeader">
@if ($filters)
<x-filament::input.wrapper inline-prefix wire:target="filter" class="fi-wi-chart-filter">
<x-filament::input.select inline-prefix wire:model.live="filter">
@foreach ($filters as $value => $label)
<option value="{{ $value }}">
{{ $label }}
</option>
@endforeach
</x-filament::input.select>
</x-filament::input.wrapper>
@endif
@if (method_exists($this, 'getFiltersSchema'))
<x-filament::dropdown placement="bottom-end" shift width="xs" class="fi-wi-chart-filter">
<x-slot name="trigger">
{{ $this->getFiltersTriggerAction() }}
</x-slot>
<div class="fi-wi-chart-filter-content">
{{ $this->getFiltersSchema() }}
@if (method_exists($this, 'hasDeferredFilters') && $this->hasDeferredFilters())
<div class="fi-wi-chart-filter-content-actions-ctn">
{{ $this->getFiltersApplyAction() }}
{{ $this->getFiltersResetAction() }}
</div>
@endif
</div>
</x-filament::dropdown>
@endif
</x-slot>
@endif
<div @if ($pollingInterval = $this->getPollingInterval()) wire:poll.{{ $pollingInterval }}="updateChartData" @endif>
<div x-load
x-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('chart', 'filament/widgets') }}"
wire:ignore data-chart-type="{{ $type }}" x-data="chart({
cachedData: @js($this->getCachedData()),
options: @js($this->getOptions()),
type: @js($type),
})"
{{ new ComponentAttributeBag()->color(ChartWidgetComponent::class, $color)->class(['fi-wi-chart-canvas-ctn', 'fi-wi-chart-canvas-ctn-no-aspect-ratio' => $hasMaxHeight]) }}>
<canvas x-ref="canvas" @style(['width: 100%', 'height: 100%; max-height: 100%' => !$hasMaxHeight, "max-height: {$maxHeight}" => $hasMaxHeight])></canvas>
<span x-ref="backgroundColorElement" class="fi-wi-chart-bg-color"></span>
<span x-ref="borderColorElement" class="fi-wi-chart-border-color"></span>
<span x-ref="gridColorElement" class="fi-wi-chart-grid-color"></span>
<span x-ref="textColorElement" class="fi-wi-chart-text-color"></span>
</div>
</div>
</x-filament::section>
</x-filament-widgets::widget>
+6 -6
View File
@@ -1,14 +1,14 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
'resources/css/filament/admin/theme.css',
"resources/css/app.css",
"resources/js/app.js",
"resources/css/filament/admin/theme.css",
],
refresh: true,
}),