Skip to content

Commit d1c0f10

Browse files
author
olaru
committed
Update image name
1 parent aec5041 commit d1c0f10

6 files changed

Lines changed: 123 additions & 2 deletions

File tree

‎public/css/app.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
9.82 KB
Loading
9.82 KB
Loading

‎src/App/assets/scss/components/_custom.scss‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,75 @@ h1.error-code {
801801
}
802802
}
803803

804+
/* ============================================================
805+
Adopters
806+
============================================================ */
807+
808+
.trusted-by {
809+
padding: 28px 0;
810+
background: var(--rose);
811+
border-top: 1px solid rgba(255, 255, 255, .15);
812+
border-bottom: 1px solid rgba(255, 255, 255, .15);
813+
}
814+
815+
html[data-theme="dark"] .trusted-by {
816+
background: var(--bg);
817+
border-top-color: var(--border-soft);
818+
border-bottom-color: var(--border-soft);
819+
}
820+
821+
.trusted-by-label {
822+
margin: 0 0 16px;
823+
text-align: center;
824+
font-family: var(--mono);
825+
font-size: 12px;
826+
letter-spacing: .06em;
827+
text-transform: uppercase;
828+
color: rgba(255, 255, 255, .8);
829+
}
830+
831+
.trusted-by-viewport {
832+
overflow: hidden;
833+
-webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
834+
mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
835+
}
836+
837+
.trusted-by-track {
838+
display: flex;
839+
align-items: center;
840+
width: max-content;
841+
animation: trusted-by-scroll linear infinite;
842+
}
843+
844+
.trusted-by-viewport:hover .trusted-by-track {
845+
animation-play-state: paused;
846+
}
847+
848+
.trusted-by-group {
849+
display: flex;
850+
align-items: center;
851+
gap: 40px;
852+
padding-right: 40px;
853+
flex: 0 0 auto;
854+
}
855+
856+
.trusted-by-logo {
857+
height: 32px;
858+
width: auto;
859+
flex: 0 0 auto;
860+
}
861+
862+
@keyframes trusted-by-scroll {
863+
from { transform: translateX(0); }
864+
to { transform: translateX(-50%); }
865+
}
866+
867+
@media (prefers-reduced-motion: reduce) {
868+
.trusted-by-track {
869+
animation: none;
870+
}
871+
}
872+
804873
/* ============================================================
805874
Split / traits
806875
============================================================ */

‎src/App/src/Handler/GetIndexViewHandler.php‎

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,19 @@
1313
use Psr\Http\Message\ServerRequestInterface;
1414
use Psr\Http\Server\RequestHandlerInterface;
1515

16+
use function array_map;
17+
use function basename;
1618
use function file_get_contents;
19+
use function glob;
1720
use function is_file;
21+
use function pathinfo;
22+
use function sort;
1823
use function str_contains;
24+
use function str_replace;
25+
use function ucwords;
26+
27+
use const GLOB_BRACE;
28+
use const PATHINFO_FILENAME;
1929

2030
class GetIndexViewHandler implements RequestHandlerInterface
2131
{
@@ -41,7 +51,32 @@ public function handle(ServerRequestInterface $request): ResponseInterface
4151

4252
$posts = $this->postRepository->getRecentPosts(3);
4353
return new HtmlResponse(
44-
$this->template->render('app::index', ['posts' => $posts])
54+
$this->template->render('app::index', [
55+
'posts' => $posts,
56+
'adopterLogos' => $this->getAdopterLogos(),
57+
])
58+
);
59+
}
60+
61+
/**
62+
* @return list<array{file: non-empty-string, alt: string}>
63+
*/
64+
private function getAdopterLogos(): array
65+
{
66+
$files = glob($this->mdPagesPath . '/images/app/content/adopters/*.{png,jpg,jpeg,svg,webp}', GLOB_BRACE);
67+
if ($files === false) {
68+
return [];
69+
}
70+
71+
$names = array_map(basename(...), $files);
72+
sort($names);
73+
74+
return array_map(
75+
static fn (string $name): array => [
76+
'file' => $name,
77+
'alt' => ucwords(str_replace(['-', '_'], ' ', pathinfo($name, PATHINFO_FILENAME))),
78+
],
79+
$names
4580
);
4681
}
4782
}

‎src/App/templates/app/index.html.twig‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@
4343
</div>
4444
</section>
4545

46+
{% if adopterLogos is defined and adopterLogos is not empty %}
47+
<section class="trusted-by">
48+
<div class="wrap trusted-by-viewport">
49+
<p class="trusted-by-label">Trusted by teams running Dotkernel in production</p>
50+
<div class="trusted-by-track" style="animation-duration: {{ (adopterLogos|length * 5)|round(0, 'ceil') }}s;">
51+
{% for i in 0..1 %}
52+
<div class="trusted-by-group" aria-hidden="{{ i == 1 ? 'true' : 'false' }}">
53+
{% for logo in adopterLogos %}
54+
<img class="trusted-by-logo" src="{{ asset('images/app/content/adopters/' ~ logo.file) }}" alt="{{ logo.alt }}" loading="lazy">
55+
{% endfor %}
56+
</div>
57+
{% endfor %}
58+
</div>
59+
</div>
60+
</section>
61+
{% endif %}
62+
4663
<section class="what-is-platform">
4764
<div class="wrap split">
4865
<div>

0 commit comments

Comments
 (0)