diff --git a/resources/css/app.css b/resources/css/app.css index 091a0bf..46e3f15 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -16,6 +16,8 @@ --color-surface-muted: #eaeff5; --color-tint-blue: #dce9f5; --color-tint-purple: #ede9f4; + --color-tint-directory: #e3edf5; + --color-tint-stats: #e8e7f2; --color-border: rgba(36, 33, 89, 0.12); --radius-default: 0.625rem; @@ -30,3 +32,77 @@ [x-cloak] { display: none !important; } + +@keyframes book-flip { + 0%, 100% { transform: rotateY(0deg); } + 35% { transform: rotateY(30deg) scaleX(0.8); } + 65% { transform: rotateY(-20deg) scaleX(0.9); } +} + +@keyframes arrow-bounce { + 0%, 100% { transform: translateY(-3px); } + 50% { transform: translateY(4px); } +} + +@keyframes building-scroll { + 0%, 100% { transform: translateY(0); } + 30% { transform: translateY(-3px); } + 70% { transform: translateY(3px); } +} + +@keyframes bar-1 { + 0%, 100% { transform: scaleY(0.45); } + 50% { transform: scaleY(1); } +} + +@keyframes bar-2 { + 0%, 100% { transform: scaleY(0.75); } + 50% { transform: scaleY(0.4); } +} + +@keyframes bar-3 { + 0%, 100% { transform: scaleY(0.6); } + 50% { transform: scaleY(1); } +} + +@keyframes bar-4 { + 0%, 100% { transform: scaleY(0.9); } + 50% { transform: scaleY(0.5); } +} + +.icon-book { + animation: book-flip 2.2s ease-in-out infinite; + transform-style: preserve-3d; +} + +.icon-arrow { + animation: arrow-bounce 1.1s ease-in-out infinite; +} + +.icon-building { + animation: building-scroll 1.8s ease-in-out infinite; +} + +.bar-1, +.bar-2, +.bar-3, +.bar-4 { + transform-origin: center bottom; +} + +.bar-1 { animation: bar-1 1.3s ease-in-out infinite; } +.bar-2 { animation: bar-2 1.3s ease-in-out 0.2s infinite; } +.bar-3 { animation: bar-3 1.3s ease-in-out 0.4s infinite; } +.bar-4 { animation: bar-4 1.3s ease-in-out 0.6s infinite; } + +@media (prefers-reduced-motion: reduce) { + .icon-book, + .icon-arrow, + .icon-building, + .bar-1, + .bar-2, + .bar-3, + .bar-4 { + animation: none; + } +} diff --git "a/resources/views/pages/\342\232\241home.blade.php" "b/resources/views/pages/\342\232\241home.blade.php" index cc719dd..e4346c5 100644 --- "a/resources/views/pages/\342\232\241home.blade.php" +++ "b/resources/views/pages/\342\232\241home.blade.php" @@ -61,16 +61,44 @@ public function featuredResources(): Collection

{{ __('home.features_title') }}

@foreach ([ - ['bg' => 'bg-tint-blue', 'color' => 'text-primary', 'title' => 'home.feat_edu_title', 'desc' => 'home.feat_edu_desc'], - ['bg' => 'bg-tint-purple', 'color' => 'text-accent', 'title' => 'home.feat_tools_title', 'desc' => 'home.feat_tools_desc'], - ['bg' => 'bg-surface-muted', 'color' => 'text-muted', 'title' => 'home.feat_org_title', 'desc' => 'home.feat_org_desc'], - ['bg' => 'bg-tint-blue/50', 'color' => 'text-navy', 'title' => 'home.feat_stats_title', 'desc' => 'home.feat_stats_desc'], + ['icon' => 'book', 'bg' => 'bg-tint-blue', 'color' => 'text-primary', 'title' => 'home.feat_edu_title', 'desc' => 'home.feat_edu_desc'], + ['icon' => 'download', 'bg' => 'bg-tint-purple', 'color' => 'text-accent', 'title' => 'home.feat_tools_title', 'desc' => 'home.feat_tools_desc'], + ['icon' => 'building', 'bg' => 'bg-tint-directory', 'color' => 'text-muted', 'title' => 'home.feat_org_title', 'desc' => 'home.feat_org_desc'], + ['icon' => 'chart', 'bg' => 'bg-tint-stats', 'color' => 'text-navy', 'title' => 'home.feat_stats_title', 'desc' => 'home.feat_stats_desc'], ] as $card) -
-
- +
+
+ @if ($card['icon'] === 'book') + + @elseif ($card['icon'] === 'download') + + @elseif ($card['icon'] === 'building') + + @else + + @endif
-

{{ __($card['title']) }}

+

{{ __($card['title']) }}

{{ __($card['desc']) }}

@endforeach diff --git a/tests/Feature/HomePageTest.php b/tests/Feature/HomePageTest.php index 121585e..ca94c0f 100644 --- a/tests/Feature/HomePageTest.php +++ b/tests/Feature/HomePageTest.php @@ -27,10 +27,19 @@ ->assertSee('IntersectionObserver', false); }); -test('homepage feature icons move on hover', function () { +test('homepage feature icons match the public design animation', function () { $this->get('/ro') ->assertOk() - ->assertSee('group-hover:-translate-y-1 group-hover:scale-110', false); + ->assertSee('data-feature-icon="book"', false) + ->assertSee('data-feature-icon="download"', false) + ->assertSee('data-feature-icon="building"', false) + ->assertSee('data-feature-icon="chart"', false) + ->assertSee('icon-book', false) + ->assertSee('icon-arrow', false) + ->assertSee('icon-building', false) + ->assertSee('bar-1', false) + ->assertSee('hover:scale-[1.06]', false) + ->assertSee('group-hover:scale-110 group-hover:shadow-lg', false); }); test('homepage shows at most six featured resources', function () {