mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-11 18:56:06 +09:00
fix: ImageMod
- svg not found from public/images - fix responsive ham menu not closing on lg screen
This commit is contained in:
@@ -16,31 +16,19 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Destructuring Astro.props to get the component's props
|
// Destructuring Astro.props to get the component's props
|
||||||
let {
|
let { src, alt, width, height, loading, decoding, class: className, format, style } = Astro.props;
|
||||||
src,
|
|
||||||
alt,
|
|
||||||
width,
|
|
||||||
height,
|
|
||||||
loading,
|
|
||||||
decoding,
|
|
||||||
class: className,
|
|
||||||
format,
|
|
||||||
style,
|
|
||||||
} = Astro.props;
|
|
||||||
|
|
||||||
src = `/public${src}`;
|
src = `/public${src}`;
|
||||||
|
|
||||||
// Glob pattern to load images from the /public/images folder
|
// Glob pattern to load images from the /public/images folder
|
||||||
const images = import.meta.glob("/public/images/**/*.{jpeg,jpg,png,gif}");
|
const images = import.meta.glob("/public/images/**/*.{jpeg,jpg,png,gif,svg}");
|
||||||
|
|
||||||
// Check if the source path is valid
|
// Check if the source path is valid
|
||||||
const isValidPath = images[src] ? true : false;
|
const isValidPath = images[src] ? true : false;
|
||||||
|
|
||||||
// Log a warning message in red if the image is not found
|
// Log a warning message in red if the image is not found
|
||||||
!isValidPath &&
|
!isValidPath &&
|
||||||
console.error(
|
console.error(`\x1b[31mImage not found - ${src}.\x1b[0m Make sure the image is in the /public/images folder.`);
|
||||||
`\x1b[31mImage not found - ${src}.\x1b[0m Make sure the image is in the /public/images folder.`,
|
|
||||||
);
|
|
||||||
---
|
---
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ input#nav-toggle:checked + label #hide-button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input#nav-toggle:checked ~ #nav-menu {
|
input#nav-toggle:checked ~ #nav-menu {
|
||||||
@apply block;
|
@apply max-lg:block;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* swiper pagination */
|
/* swiper pagination */
|
||||||
|
|||||||
Reference in New Issue
Block a user