improve image optimization usage

This commit is contained in:
MarconLP 2023-04-28 17:23:13 +02:00
parent 42bcf81ee5
commit f97ee8d49e
No known key found for this signature in database
GPG key ID: F4CAFFDFA3451D5E
3 changed files with 27 additions and 25 deletions

View file

@ -30,19 +30,13 @@ const config = {
}, },
{ {
protocol: 'https', protocol: 'https',
hostname: '*.ytimg.com', hostname: 'tailwindui.com',
port: '', port: '',
pathname: '/**', pathname: '/**',
}, },
{ {
protocol: 'https', protocol: 'https',
hostname: '*.imgur.com', hostname: '*.producthunt.com',
port: '',
pathname: '/**',
},
{
protocol: 'https',
hostname: '*.githubusercontent.com',
port: '', port: '',
pathname: '/**', pathname: '/**',
}, },

View file

@ -10,12 +10,7 @@ import { CheckIcon } from "@heroicons/react/20/solid";
import { CheckCircleIcon } from "@heroicons/react/24/outline"; import { CheckCircleIcon } from "@heroicons/react/24/outline";
import Footer from "~/components/Footer"; import Footer from "~/components/Footer";
import Header from "~/components/Header"; import Header from "~/components/Header";
import Image from "next/image";
const navigation = [
{ name: "Features", href: "#features" },
{ name: "Pricing", href: "/pricing" },
{ name: "Discord", href: "https://discord.com/invite/invalid" },
];
const Home: NextPage = () => { const Home: NextPage = () => {
const [, setRecordOpen] = useAtom(recordVideoModalOpen); const [, setRecordOpen] = useAtom(recordVideoModalOpen);
@ -115,7 +110,7 @@ const Home: NextPage = () => {
className="mr-8 h-[54px] min-w-[250px] overflow-hidden" className="mr-8 h-[54px] min-w-[250px] overflow-hidden"
> >
<a href={url} target="_blank"> <a href={url} target="_blank">
<img <Image
src={image} src={image}
alt={title} alt={title}
className="h-[54px] w-[250px]" className="h-[54px] w-[250px]"
@ -145,8 +140,10 @@ const Home: NextPage = () => {
</div> </div>
<div className="mt-6 flex flex-col gap-x-6 lg:mt-16 lg:flex-row lg:gap-x-20"> <div className="mt-6 flex flex-col gap-x-6 lg:mt-16 lg:flex-row lg:gap-x-20">
<div className="mb-24 flex flex-1 items-center justify-center lg:mb-0"> <div className="mb-24 flex flex-1 items-center justify-center lg:mb-0">
<img <Image
src="https://i.ibb.co/wcpMNG9/633edb0b80d27778f9078a5c-home-main-2x.webp" src="https://f003.backblazeb2.com/file/test-cloudflares/how+it+works.webp"
width={600}
height={575}
alt="step description" alt="step description"
/> />
</div> </div>
@ -210,6 +207,8 @@ const Home: NextPage = () => {
"To centralize team knowledge", "To centralize team knowledge",
"To collaborate asynchronously", "To collaborate asynchronously",
], ],
image:
"https://f003.backblazeb2.com/file/test-cloudflares/engineering+usecase.png",
}, },
{ {
title: "Bug Reporting", title: "Bug Reporting",
@ -220,6 +219,8 @@ const Home: NextPage = () => {
"Request a quick demo when the bug is fixed", "Request a quick demo when the bug is fixed",
"Keep it in your issue tracking system", "Keep it in your issue tracking system",
], ],
image:
"https://f003.backblazeb2.com/file/test-cloudflares/bug+report+usecase.webp",
}, },
{ {
title: "Education", title: "Education",
@ -229,6 +230,8 @@ const Home: NextPage = () => {
"To complement a curriculum", "To complement a curriculum",
"To add context to assignments", "To add context to assignments",
], ],
image:
"https://f003.backblazeb2.com/file/test-cloudflares/education+usecase.webp",
}, },
{ {
title: "Support", title: "Support",
@ -239,13 +242,15 @@ const Home: NextPage = () => {
"To improve self-serve content", "To improve self-serve content",
"To accelerate team onboarding", "To accelerate team onboarding",
], ],
image:
"https://f003.backblazeb2.com/file/test-cloudflares/support+usecase.webp",
}, },
].map(({ title, description, features }) => ( ].map(({ title, description, features, image }) => (
<div <div
key={title} key={title}
className="flex-1 overflow-hidden rounded-lg border border-[#eaeaea]" className="max-w-[600px] flex-1 overflow-hidden rounded-lg border border-[#eaeaea]"
> >
<div className="flex flex-col py-8"> <div className="flex flex-col pb-2 pt-8">
<div className="flex flex-col px-8"> <div className="flex flex-col px-8">
<span className="mb-3 text-xl font-semibold"> <span className="mb-3 text-xl font-semibold">
{title} {title}
@ -261,9 +266,12 @@ const Home: NextPage = () => {
))} ))}
</div> </div>
</div> </div>
<img <Image
src="https://i.imgur.com/8UqJzoD.png" src={image}
width={600}
height={575}
alt="usecase cover" alt="usecase cover"
unoptimized
/> />
</div> </div>
))} ))}
@ -280,7 +288,7 @@ const Home: NextPage = () => {
].map(({ stat, value }) => ( ].map(({ stat, value }) => (
<div <div
key={stat} key={stat}
className="flex flex-1 flex-col py-5 text-center lg:border-r lg:border-[#eaeaea] lg:py-0" className="flex flex-1 flex-col py-5 text-center lg:border-r lg:border-[#eaeaea] lg:py-0 lg:last:border-r-0"
> >
<span className="text-6xl font-bold text-black">{value}</span> <span className="text-6xl font-bold text-black">{value}</span>
<span className="pt-2 text-sm font-semibold uppercase text-[#666]"> <span className="pt-2 text-sm font-semibold uppercase text-[#666]">

View file

@ -162,7 +162,7 @@ interface VideoCardProps {
const VideoCardSkeleton = () => { const VideoCardSkeleton = () => {
return ( return (
<div className="h-[240px] w-[250px] animate-pulse overflow-hidden rounded-lg border border-[#6c668533] text-sm font-normal"> <div className="animate-pulse h-[240px] w-[250px] overflow-hidden rounded-lg border border-[#6c668533] text-sm font-normal">
<figure className="relative aspect-video w-full bg-slate-200"></figure> <figure className="relative aspect-video w-full bg-slate-200"></figure>
<div className="m-4 flex flex-col"> <div className="m-4 flex flex-col">
<span className="h-4 rounded bg-slate-200"></span> <span className="h-4 rounded bg-slate-200"></span>
@ -177,7 +177,7 @@ const VideoCard = ({ title, id, createdAt, thumbnailUrl }: VideoCardProps) => {
<Link href={`/share/${id}`}> <Link href={`/share/${id}`}>
<div className="h-[240px] w-[250px] cursor-pointer overflow-hidden rounded-lg border border-[#6c668533] text-sm font-normal"> <div className="h-[240px] w-[250px] cursor-pointer overflow-hidden rounded-lg border border-[#6c668533] text-sm font-normal">
<figure> <figure>
<Image <img
src={thumbnailUrl} src={thumbnailUrl}
alt="video thumbnail" alt="video thumbnail"
width={248} width={248}