Improve the image loading

This commit is contained in:
Arnaud 2024-10-21 13:47:02 +02:00
parent d4667c5ec7
commit 6d79614883
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663
15 changed files with 45 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

BIN
public/img/onboarding.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

BIN
public/img/onboarding.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

View File

@ -0,0 +1,6 @@
.onboarding-image {
position: absolute;
right: -40px;
max-height: 90%;
width: auto;
}

View File

@ -0,0 +1,35 @@
import "./OmBoardingImage.css";
export function OnBoardingImage() {
return (
<picture>
<source
srcSet="/img/onboarding@4x.webp 4x,
/img/onboarding@3x.webp 3x,
/img/onboarding@2x.webp 2x,
/img/onboarding@1.5x.webp 1.5x,
/img/onboarding.webp 1x"
sizes="(max-width: 600px) 100vw,
(max-width: 1200px) 50vw,
33vw"
type="image/webp"
/>
<source
srcSet="/img/onboarding@4x.png 4x,
/img/onboarding@3x.png 3x,
/img/onboarding@2x.png 2x,
/img/onboarding@1.5x.png 1.5x,
/img/onboarding.png 1x"
sizes="(max-width: 600px) 100vw,
(max-width: 1200px) 50vw,
33vw"
type="image/png"
/>
<img
src="/img/onboarding.png"
alt="Onboarding Image"
className="onboarding-image"
/>
</picture>
);
}

View File

@ -1,10 +1,5 @@
.index {
width: 100%;
background-image: url(/bg.png);
background-position: 10px 10px;
background-position: right;
background-repeat: no-repeat;
background-size: auto 90%;
padding: 3rem 6rem;
}

View File

@ -11,6 +11,7 @@ import { classnames } from "../utils/classnames";
import { OnBoardingStepThree } from "../components/OnBoarding/OnBoardingStepThree";
import { attributes } from "../utils/attributes";
import { CodexLogo } from "../components/CodexLogo/CodexLogo";
import { OnBoardingImage } from "../components/OnBoarding/OnBoardingImage";
export const Route = createFileRoute("/")({
component: Index,
@ -80,6 +81,9 @@ function Index() {
</div>
</div>
</div>
<div className="index-column">
<OnBoardingImage />
</div>
<div className="index-columnRight">
<div className="index-logo">
<div className="index-network">