Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 37d070c

Browse files
committedJan 8, 2025··
Added alternative image support
Signed-off-by: Jean-Baptiste Bianchi <jb.bianchi@neuroglia.io>
1 parent ff62cd1 commit 37d070c

File tree

5 files changed

+161
-4
lines changed

5 files changed

+161
-4
lines changed
 

Diff for: ‎public/img/logos/redhat.png

-3.84 KB
Binary file not shown.

Diff for: ‎public/img/logos/redhat.svg

+73
Loading

Diff for: ‎public/img/logos/redhat_reverse.svg

+73
Loading

Diff for: ‎src/components/Card.astro

+13-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ interface Props {
44
alignment?: 'center' | 'start' | 'end';
55
icon?: string;
66
image?: string;
7+
imageDark?: string;
78
imageSize?: 'small' | 'medium';
89
}
910
@@ -12,6 +13,7 @@ const {
1213
alignment = 'center',
1314
icon,
1415
image,
16+
imageDark,
1517
imageSize = 'small',
1618
} = Astro.props;
1719
---
@@ -25,7 +27,7 @@ const {
2527
),
2628
]}>
2729
<div class="card-body">
28-
{ image &&
30+
{ (image || imageDark) &&
2931
<div class:list={[
3032
'my-4',
3133
'flex',
@@ -35,7 +37,8 @@ const {
3537
`justify-center`
3638
),
3739
]}>
38-
<img src={image} class={`img--${imageSize}`} />
40+
{ image && <img src={image} class:list={[`img--${imageSize}`, image && imageDark ? 'image-light' : '']} /> }
41+
{ imageDark && <img src={imageDark} class:list={[`img--${imageSize}`, image && imageDark ? 'image-dark' : '']} /> }
3942
</div>
4043
}
4144
{ icon && <i class={icon}></i> }
@@ -63,4 +66,12 @@ const {
6366
height: 75px;
6467
max-width: none;
6568
}
69+
70+
html[data-theme="dark"] .image-light {
71+
display: none;
72+
}
73+
74+
html[data-theme="light"] .image-dark {
75+
display: none;
76+
}
6677
</style>

Diff for: ‎src/pages/index.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ do:
149149
<p>Neuroglia is a consultancy and solution design company for the digital transformation of companies and their services.</p>
150150
<a class="link link-accent" href="https://neuroglia.io/" target="_blank" rel="noopener">Learn More</a>
151151
</Card>
152-
<Card title="Red Hat" image="img/logos/redhat.png" imageSize="medium">
152+
<Card title="Red Hat" image="img/logos/redhat.svg" imageDark="img/logos/redhat_reverse.svg" imageSize="medium">
153153
<p>Red Hat sponsors Apache KIE SonataFlow, a tool for creating cloud-native workflows. SonataFlow supports service and event orchestration, integrating with your architecture using CloudEvents, REST calls, and other standard components.</p>
154154
<a class="link link-accent" href="https://www.redhat.com/en/technologies/cloud-computing/openshift/serverless" target="_blank" rel="noopener">Learn More</a>
155155
</Card>
156156
<Card title="Warrify" image="img/logos/warrify.png" imageSize="medium">
157157
<p>Warrify offers a leading data platform for the retail industry. With "warrify Journeys" (powered by Serverless Workflows) retailers are discovering new ways how to engage their customers in real time.</p>
158158
<a class="link link-accent" href="https://www.warrify.com" target="_blank" rel="noopener">Learn More</a>
159-
</Card>
159+
</Card>
160160
</Section>
161161

162162
<!-- Sponsors -->

0 commit comments

Comments
 (0)
Please sign in to comment.