Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Un-optimize images #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions app/components/activity-teaser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
cloudinaryImageName,
altText,
}: ActivityTeaserComponentProps) => {
const webpSrcSet = `

Check warning on line 18 in app/components/activity-teaser.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

'webpSrcSet' is assigned a value but never used
${CloudinaryImageRequestHelper.getImageUrl(
cloudinaryImageName,
CloudinaryImageFormat.WEBP,
Expand All @@ -38,7 +38,7 @@
256
)} 3x`;

const jpgSrcSet = `

Check warning on line 41 in app/components/activity-teaser.tsx

View workflow job for this annotation

GitHub Actions / ⬣ ESLint

'jpgSrcSet' is assigned a value but never used
${CloudinaryImageRequestHelper.getImageUrl(
cloudinaryImageName,
CloudinaryImageFormat.JPG,
Expand All @@ -64,25 +64,16 @@
return (
<header className="h-96 flex-none basis-full rounded-xl px-2 sm:basis-1/2 lg:basis-1/3 2xl:basis-1/4">
<div className="flex flex-col">
<picture>
<source type="image/webp" srcSet={webpSrcSet}></source>
<source type="image/jpg" srcSet={jpgSrcSet}></source>
<img
className="top-0 m-0 h-64 w-auto rounded-xl object-cover"
src={CloudinaryImageRequestHelper.getImageUrl(
cloudinaryImageName,
CloudinaryImageFormat.JPG,
CloudinaryImageDensity.SINGLE,
undefined,
256
CloudinaryImageDensity.SINGLE
)}
srcSet={jpgSrcSet}
alt={altText}
loading="lazy"
height="256"
/>
</picture>

<div className="prose mt-4">
<h3 className="text-2xl">{title}</h3>
</div>
Expand Down
6 changes: 0 additions & 6 deletions app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ export const links: LinksFunction = () => {
return [
{ rel: "icon", href: "data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🥾</text></svg>"},
{ rel: "stylesheet", href: tailwindStylesheetUrl },
{ rel: "preconnect", href: "https://res.cloudinary.com" },
{
rel: "preload",
as: "image",
href: "https://res.cloudinary.com/dbsjhw9tp/image/upload/f_auto/v1653757476/der-almohi/der-almohi-hero-illustration.ai",
},
];
};

Expand Down
Loading