Responsive Resize Observer Playground
Prompt
Create an interactive playground to demonstrate the Resize Observer API in a responsive layout. The page should have multiple resizable panels that update in real-time when their size changes. Use a clean, modern design with a dark theme. Include a code display panel that shows the current dimensions and aspect ratio of each resizable element.
CODE PREVIEW
AIとの対話に追加する一言
プロンプトと一緒にコピーして、AIがより正確に意図を汲み取れるようにします
このコードをそのまま使いたいので、CDNリンクも含めた完全なHTMLファイルとして出力してください。
初心者なので、各行にコメントを追加して、何をしているか説明してください。
このコードをWordPressのテーマに組み込む方法も教えてください。
動作確認済みのコードをお願いします。エラーが出る場合の対処法も含めて。
このインタラクティブプレイグラウンドは、DOM要素のサイズ変更をリアルタイムで監視できるResize Observer APIをデモしています。右下のハンドルを使って3つのパネルのサイズを変更すると、幅、高さ、アスペクト比が即座に更新されます。コードパネルには、最後にリサイズされたパネルの最新の寸法が表示されます。レスポンシブデザインやアダプティブレイアウト、要素のサイズ変更に効率的に対応する必要があるあらゆるシナリオで役立ちます。
Prompt Overview
This interactive playground demonstrates the Resize Observer API, which allows you to monitor size changes of DOM elements in real-time. Resize any of the three panels using the bottom-right handle to see immediate updates to width, height, and aspect ratio. The code panel displays the latest dimensions for the most recently resized panel. This is useful for responsive design, adaptive layouts, and any scenario where you need to react to element size changes efficiently.
Was this prompt helpful?
Comments
Comments appear after moderation
この記事が役に立ったら投げ銭で応援
Apple Pay / Google Pay / カード (Visa/Mastercard/JCB/Amex) / Link / Alipay / WeChat Pay 対応 · Stripeで安全に決済
開発者が選ぶ最強ツール集
運営者が毎日使っているツール・ガジェット 6選