-
Notifications
You must be signed in to change notification settings - Fork 1
Athai/optimized images #51
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // Type declarations for product-images.js (vite-imagetools transforms). | ||
| // Icon exports are URL strings. SrcSet exports are "url Nw, url Mw" srcset strings. | ||
|
|
||
| export declare const IconSwipeableAds: string; | ||
| export declare const IconCarouselAds: string; | ||
| export declare const IconVideoAds: string; | ||
| export declare const IconGameController: string; | ||
| export declare const IconCheckoutProduct: string; | ||
|
|
||
| export declare const PreviewSwipeableAdSrcSet: string; | ||
| export declare const PreviewCarouselAdSrcSet: string; | ||
| export declare const PreviewVideoAdSrcSet: string; | ||
| export declare const PreviewCheckoutProductSrcSet: string; | ||
|
|
||
| export declare const PreviewSwipeableGameSrcSet: string; | ||
| export declare const PreviewCarouselGameSrcSet: string; | ||
| export declare const PreviewVideoGameSrcSet: string; | ||
| export declare const PreviewCheckoutGameSrcSet: string; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // vite-imagetools query-param imports. | ||
| // TypeScript resolves the companion product-images.d.ts for types. | ||
| // Vite processes this file and runs the actual imagetools transforms at build time. | ||
|
|
||
| // Icons: WebP at 2× display size (displayed at 80–88px), single URL | ||
| export { default as IconSwipeableAds } from "./icon-swipeable-ads.png?w=160&format=webp"; | ||
| export { default as IconCarouselAds } from "./icon-carousel-ads.png?w=160&format=webp"; | ||
| export { default as IconVideoAds } from "./icon-video-ads.png?w=160&format=webp"; | ||
| export { default as IconGameController } from "./icon-game-controller.png?w=176&format=webp"; | ||
| export { default as IconCheckoutProduct } from "./icon-checkout-product.png?w=160&format=webp"; | ||
|
|
||
| // Ad preview images: displayed at height 400px (fixed CSS), width ~300px | ||
| // Generates two sizes and returns a "url 300w, url 600w" srcset string | ||
| export { default as PreviewSwipeableAdSrcSet } from "./preview-swipeable-ad.png?w=300;600&format=webp&as=srcset"; | ||
| export { default as PreviewCarouselAdSrcSet } from "./preview-carousel-ad.png?w=300;600&format=webp&as=srcset"; | ||
| export { default as PreviewVideoAdSrcSet } from "./preview-video-ad.png?w=300;600&format=webp&as=srcset"; | ||
| export { default as PreviewCheckoutProductSrcSet } from "./preview-checkout-product.png?w=300;600&format=webp&as=srcset"; | ||
|
|
||
| // Game preview images: displayed at exactly 200×250px with object-fit: cover | ||
| // Generates two sizes and returns a "url 200w, url 400w" srcset string | ||
| export { default as PreviewSwipeableGameSrcSet } from "./preview-swipeable-game.png?w=200;400&format=webp&as=srcset"; | ||
| export { default as PreviewCarouselGameSrcSet } from "./preview-carousel-game.jpg?w=200;400&format=webp&as=srcset"; | ||
| export { default as PreviewVideoGameSrcSet } from "./preview-video-game.jpg?w=200;400&format=webp&as=srcset"; | ||
| export { default as PreviewCheckoutGameSrcSet } from "./preview-checkout-game.png?w=200;400&format=webp&as=srcset"; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| // Type declarations for sdk-images.js (vite-imagetools transforms). | ||
| // All exports are "url Nw, url Mw" srcset strings. | ||
|
|
||
| export declare const PreviewUnitySrcSet: string; | ||
| export declare const PreviewJSSrcSet: string; |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,7 @@ | ||||||
| // vite-imagetools query-param imports. | ||||||
| // TypeScript resolves the companion sdk-images.d.ts for types. | ||||||
| // Vite processes this file and runs the actual imagetools transforms at build time. | ||||||
|
|
||||||
| // SDK preview images: displayed at width 400px (fixed CSS) | ||||||
| export { default as PreviewUnitySrcSet } from "./preview-unity.png?w=400;800&format=webp&as=srcset"; | ||||||
| export { default as PreviewJSSrcSet } from "./preview-js.jpg?w=400;800&format=webp&as=srcset"; | ||||||
|
||||||
| export { default as PreviewJSSrcSet } from "./preview-js.jpg?w=400;800&format=webp&as=srcset"; | |
| export { default as PreviewJSSrcSet } from "./preview-js.jpg?w=400;800&format=webp;jpg&as=picture"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,3 +56,11 @@ | |
|
|
||
| margin-bottom: var(--bolt-space-8); | ||
| } | ||
|
|
||
| .hero h1 { | ||
| text-align: center; | ||
| } | ||
|
|
||
| .hero p { | ||
| text-align: center; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| .heading1 { | ||
| font-size: var(--bolt-font-heading-1-size); | ||
| line-height: 0; | ||
| line-height: 1.2; | ||
| font-weight: var(--bolt-font-heading-1-weight); | ||
| margin-block: 0; | ||
| } | ||
| .heading1.large { | ||
| font-size: var(--bolt-font-heading-1-large-size); | ||
| line-height: 0; | ||
| } | ||
|
|
||
| .heading1.xlarge { | ||
| font-size: var(--bolt-font-heading-1-xlarge-size); | ||
| line-height: 0; | ||
| } | ||
|
|
||
| .heading2 { | ||
| font-size: var(--bolt-font-heading-2-size); | ||
| line-height: 0; | ||
| line-height: 1.2; | ||
| font-weight: var(--bolt-font-heading-2-weight); | ||
| margin-block: 0; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,4 +8,5 @@ | |
|
|
||
| .previewImage { | ||
| width: 400px; | ||
| max-width: 100%; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All generated image URLs are forced to WebP (
format=webp). That will render blank in browsers without WebP support. If non-WebP clients must be supported, generate multiple formats and/or use a<picture>fallback strategy so PNG/JPEG can still load.