GifproGifpro

Image Lazy Loading with IntersectionObserver

CODE PREVIEW

P

Prompt

Create a lazy loading image system using IntersectionObserver API. Images should load only when they enter the viewport.

この実装はIntersectionObserver APIを使用して画像を遅延読み込みします。画像はdata-src属性から始まり、ビューポートに入った時のみ読み込まれます(50pxのマージン付き)。読み込み時にフェードインアニメーションで視覚的フィードバックを提供します。

Prompt Overview

This implementation uses the IntersectionObserver API to lazy load images. Images start with a data-src attribute and load only when they enter the viewport (plus 50px margin). A fade-in animation provides visual feedback when images load.

Was this prompt helpful?

Comments

Comments appear after moderation

Homeヘルプ