Files
site-profile/src/components/ui/images/ImageTheme.astro
Alex Lebens 63cbcdf39b
All checks were successful
renovate / renovate (push) Successful in 46s
test-build / build (push) Successful in 1m8s
feat: improve logos and clickability of cards on about and apps
2026-02-10 18:02:12 -06:00

53 lines
1.0 KiB
Plaintext

---
import { Image } from 'astro:assets';
import { blurStyle } from '@support/image';
const { srcLight, srcDark, alt, style, disableBlur, width, height } = Astro.props;
const showBlur = !disableBlur;
const blurLight = (srcLight?.fsPath && showBlur) ? await blurStyle(srcLight.fsPath) : {};
const blurDark = (srcDark?.fsPath && showBlur) ? await blurStyle(srcDark.fsPath) : {};
---
<div class="themed-image-container">
<Image
src={srcLight}
alt={alt}
class={`light-logo ${style}`}
style={blurLight}
inferSize={true}
width={width}
height={height}
/>
<Image
src={srcDark}
alt={alt}
class={`dark-logo ${style}`}
style={blurDark}
inferSize={true}
width={width}
height={height}
/>
</div>
<style>
.themed-image-container {
display: grid;
grid-template-areas: "stack";
}
.themed-image-container :global(img) {
grid-area: stack;
}
:global(.dark) .light-logo {
display: none !important;
}
:global(.dark) .dark-logo {
display: block !important;
}
</style>