Skip to content

Commit

Permalink
Merge pull request #261 from maretol/feature-comic-image
Browse files Browse the repository at this point in the history
Feature comic image
  • Loading branch information
maretol authored Jan 13, 2025
2 parents c19dd54 + eb93b66 commit 4af967b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pages/components/small/comic_image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
import Image from 'next/image'
import { PlaceholderImageBase64 } from './placeholder'

export default function ComicImage({ src, alt, className }: { src: string; alt: string; className?: string }) {
export default function ComicImage({
src,
alt,
priority,
loading,
className,
}: {
src: string
alt: string
priority?: boolean
loading?: 'lazy' | 'eager'
className?: string
}) {
const imageLoader = ({ src }: { src: string }) => {
const url = 'https://www.maretol.xyz/cdn-cgi/image/#{option}/#{origin}'
return url.replace('#{option}', 'format=auto').replace('#{origin}', src)
Expand All @@ -15,7 +27,8 @@ export default function ComicImage({ src, alt, className }: { src: string; alt:
src={src}
width={500}
height={1000}
priority
priority={priority}
loading={loading}
alt={alt}
className={className}
placeholder={`data:image/png;base64,${PlaceholderImageBase64}`}
Expand Down

0 comments on commit 4af967b

Please sign in to comment.